Skip to content
Snippets Groups Projects
Commit d7f2f7f0 authored by Christof Kaufmann's avatar Christof Kaufmann
Browse files

keras3-cpu: Fix broken PDF export of notebooks

To export a Jupyter Notebook as PDF from Jupyter Lab or VS Code
nbconvert is used. nbconvert calls pandoc to generate LaTeX source and
compile it as PDF. nbconvert uses a custom LaTeX template, which is not
compatible with pandoc >= 3.2.1, currently. This commit is a workaround
to make it compatible. Revert this commit as soon as
https://github.com/jupyter/nbconvert/pull/2196 is available in the base
docker image. However, the workaround should not do any harm, since it
checks whether the patch is required before modifying the template.
parent 50ceb533
No related branches found
No related tags found
1 merge request!40keras3-cpu: Fix broken PDF export of notebooks
...@@ -184,6 +184,11 @@ RUN chown -R ${NB_USER} "/home/${NB_USER}/.jupyter" && \ ...@@ -184,6 +184,11 @@ RUN chown -R ${NB_USER} "/home/${NB_USER}/.jupyter" && \
fix-permissions "/etc/skel" fix-permissions "/etc/skel"
# remember to copy back in post start hook # remember to copy back in post start hook
# workaround for PDF export until https://github.com/jupyter/nbconvert/pull/2196 arrives
RUN if ! grep -q "pandocbounded" /opt/conda/share/jupyter/nbconvert/templates/latex/base.tex.j2; then \
echo "Patching nbconvert latex template." && \
sed -i '168i\ \\newcommand{\\pandocbounded}[1]{#1}' /opt/conda/share/jupyter/nbconvert/templates/latex/base.tex.j2 ; \
fi
# override maintainer label from Jupyter docker stacks # override maintainer label from Jupyter docker stacks
LABEL maintainer="Christof Kaufmann <christof.kaufmann@hs-bochum.de>" LABEL maintainer="Christof Kaufmann <christof.kaufmann@hs-bochum.de>"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment