mrpiggi / svg

Handling SVG pictures in LaTeX documents using Inkscape, ImageMagick and/or Ghostscript
Other
65 stars 12 forks source link

SVG Package does not work with document class "convert" #29

Closed pforero closed 4 years ago

pforero commented 4 years ago

When creating a standalone document to convert it into a PNG file, I get an error if I include the SVG package.

MWE

%\documentclass{standalone}
\documentclass[convert={density=720,outext=.png}]{standalone}
\usepackage{svg}

\begin{document}

\includesvg{test}

\end{document}

Without the convert option it works perfectly. With the convert option I get the following log result:

(/usr/local/texlive/2020/texmf-dist/tex/latex/svg/svg.sty
Package: svg 2020/05/07 v2.02f (include SVG pictures)
 (/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrbase.sty
Package: scrbase 2020/04/19 v3.30 KOMA-Script package (KOMA-Script-independent basics and keyval usage)

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.478 \FamilyProcessOptions{KOMA}
                                 \relax
? 
! Emergency stop.

I have tried to compile using both, pdftex and luatex, and get the same result.

u-fischer commented 4 years ago

Imho it is a standalone bug. It cleans up \@classoptionslist but forgets to do the same with \XKV@classoptionslist and then scrbase fails which tries to handle this option list.

\documentclass[ngerman,convert={density=720,outext=.png}]{standalone}
\makeatletter 
\show\@classoptionslist 
\show\XKV@classoptionslist
\usepackage{scrbase}

\begin{document}
abc 
\end{document}
mrpiggi commented 4 years ago

I created an issue for standalone: https://bitbucket.org/martin_scharrer/standalone/issues/51

mrpiggi commented 4 years ago

Nevertheless, you can also convert individual graphics directly with package svg-extract.

\documentclass{scrartcl}
\usepackage[convert=true,convertformat=png]{svg-extract}
\begin{document}
\includesvg[convertdpi=720]{test}
\end{document}
mrpiggi commented 4 years ago

Thanks to @u-fischer for figuring out the problem.

pforero commented 4 years ago

Perfect! Thanks to both of you. Work around worked perfectly, and now standalone is aware of the issues. Thanks for all the help!