LaTeX export: Support SVG image files via the svg LaTeX package#2190
LaTeX export: Support SVG image files via the svg LaTeX package#2190aravindh-krishnamoorthy wants to merge 4 commits intojupyter:mainfrom
svg LaTeX package#2190Conversation
svg LaTeX packagesvg LaTeX package
|
I looked into using the svg package for nbconvert latex once. It requires running latex with a shell escape which is a no-go. Given that we already have an svg2pdf preprocessor, I think that making that work with markdown cells would be better. |
True! Lemme try to find a fix which uses the |
|
I'm not super familiar with svg2pdf, but it would likely have to handle markdown cells very differently, since you'd need to parse the markdown to find the image first. Hence why this has been an open issue so long. |
Note
PDF via LaTeXalso uses theLaTeXoutput to generate the PDF. However, it continues to be broken even after this PR. It is felt that support forPDF via LaTeXis best done in another PR.Summary
Jupyter notebooks allow inclusion of SVG images via
. However, forLaTeXexport, unlike other image formats, SVG images does not work. This is mainly because\includegraphicsdoesn't support SVGs yet.In this PR, a solution is provided via
\usepackage{svg}. The fix works by hooking onto\includegraphicsto detect SVG images from their file extension and replace the\includegraphicscall by\includesvg.Cautionary areas
The following are the reasons why we have to be cautious before merging this PR.
svgLaTeX package utilizes Inkscape to convert SVGs to PDFs. Hence, the experience for LaTeX export may not be seamless for novice LaTeX users.