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

LaTeX and PDF export: Incorrect export of SVG images included via ![]() #2192

Open
aravindh-krishnamoorthy opened this issue Nov 14, 2024 · 2 comments

Comments

@aravindh-krishnamoorthy

Problem description

Presently, SVG images can be directly included in Jupyter notebooks via the ![SVG file](file.svg) directive. However:

  • LaTeX export results in \includegraphics{file.svg} which is unsupported in LaTeX as of now.
  • PDF via LaTeX export fails due to XeLaTeX compilation error.

Version Info

nbconvert 7.16.4

How to reproduce

  • Open a new Jupyter notebook file.
  • Include an SVD via ![SVG file](file.svg) in a Markdown cell.
  • Export the resulting notebook to LaTeX or PDF as: jupyter nbconvert --debug <filename> --to latex or jupyter nbconvert --debug <filename> --to pdf

Workaround

@aravindh-krishnamoorthy
Copy link
Author

Note that an alternative fix is to use the svg2pdf.py preprocessor to "pre-convert" the SVG file included via ![]() into PDF, as it is currently done for image/svg+xml.

IMHO the \includepackage{svg} method is better. However, this is open and up for debate.

@t-makaro
Copy link
Contributor

Duplicate of #244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants