Skip to content
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

Open
1 task done
davidvandebunte opened this issue Dec 26, 2024 · 2 comments
Open
1 task done

Cannot export notebook with images to PDF #2189

davidvandebunte opened this issue Dec 26, 2024 · 2 comments
Labels
type:Bug A problem with the definition of one of the docker images maintained here

Comments

@davidvandebunte
Copy link

davidvandebunte commented Dec 26, 2024

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?

docker run --rm \                                                                      
    -p "$JPORT":"$JPORT" \                                                             
    --env JUPYTER_ENABLE_LAB=yes \                                                     
    --env NB_USER="$USER" \                                                            
    --env NB_GID=1000 \                                                                
    --volume "$HOME":"$HOME" \                                                         
    --volume $(pwd):$(pwd) \                                                           
    --user root \                                                                      
    --workdir $(pwd) \                                                                 
    quay.io/jupyter/datascience-notebook \
    start.sh jupyter lab \                                                             
    --port "$JPORT" \                                                                  
    --notebook-dir $(pwd)

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

! Undefined control sequence.
l.450 \pandocbounded
{\includesvg[keepaspectratio]{KeychainLabels.svg}}

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

  • I've updated my Docker version to the latest available, and the issue persists
@davidvandebunte davidvandebunte added the type:Bug A problem with the definition of one of the docker images maintained here label Dec 26, 2024
@mathbunnyru
Copy link
Member

Hi @davidvandebunte,

Could you make your example reproducible on any machine?
Remove docker command flags which are not needed, write a command which would work on any machine with docker installed, add a file example.
In general, it's a great idea to simplify an issue as much as possible and create an MRE

@davidvandebunte
Copy link
Author

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 docker run command you're already using. Then create a notebook with an image in it; here's a Markdown cell:

Hello there! Here's an image:

![upload.wikimedia.org/wikipedia/commons/6/6b/Bitmap_VS_SVG.svg](https://upload.wikimedia.org/wikipedia/commons/6/6b/Bitmap_VS_SVG.svg)

Let me know if that doesn't work, though. I'll edit my docker run command above to make it shorter though, it's the longest part of the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug A problem with the definition of one of the docker images maintained here
Projects
None yet
Development

No branches or pull requests

2 participants