-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot export notebook with images to PDF #2189
Comments
Hi @davidvandebunte, Could you make your example reproducible on any machine? |
Hey @mathbunnyru, You'll likely find the issue is reproducible already with whatever docker image you are using (it doesn't have to be the datascience-notebook) and whatever Hello there! Here's an image:
 Let me know if that doesn't work, though. I'll edit my |
Ok, I've been able to reproduce the problem. This is purely a problem of
There is a PR, which fixes it: jupyter/nbconvert#2190 Good news - I've been able to make it kind-of work in our images, but not in a good way at all.
FROM quay.io/jupyter/minimal-notebook
RUN wget 'https://patch-diff.githubusercontent.com/raw/jupyter/nbconvert/pull/2190.diff' -P /tmp/ && \
sed -i 's/share\/templates\/latex\///g' /tmp/2190.diff && \
cd /opt/conda/share/jupyter/nbconvert/templates/latex && \
git apply /tmp/2190.diff
RUN cd /home/jovyan && \
wget 'upload.wikimedia.org/wikipedia/commons/6/6b/Bitmap_VS_SVG.svg'
USER root
RUN apt-get update --yes && \
apt-get install --yes --no-install-recommends \
inkscape && \
apt-get clean && rm -rf /var/lib/apt/lists/*
USER ${NB_UID}
Hello there! Here's an image:

jupyter nbconvert --to latex Untitled.ipynb
xelatex --shell-escape Untitled.tex |
A few key points:
I know it's not a proper solution. So, I am closing this issue. Hope this helps a little bit, or at least makes it clear where to look at. |
What docker image(s) are you using?
datascience-notebook
Host OS system
Ubuntu 24.04
Host architecture
x86_64
What Docker command are you running?
How to Reproduce the problem?
With a
.md
or.ipynb
notebook that includes images open, select "File -> Save and Export Notebook As" and then the "PDF" option.Command output
Expected behavior
A PDF file is produced.
Actual behavior
The JupyterLab server errors out.
Anything else?
See Pandoc 3.2.1 introduced new LaTex macro \pandocbounded · Issue #391 · Wandmalfarbe/pandoc-latex-template. It looks like the solution to this issue is to update to v2.5.0 of this package. It's possible that
nbconvert
needs an update first, see Incompatibility issue with latest version of pandoc · Issue #2173 · jupyter/nbconvert (which looks unresolved).Latest Docker version
The text was updated successfully, but these errors were encountered: