1

I can't compile the book I've been working on anymore after a general package update. I restricted the issue to a recent version of the svg package (Oct. 10). In this MWE:

% !TeX spellcheck = it_IT
% !TeX TS-program = lualatex
% !TeX encoding = UTF-8

\documentclass{scrreprt}

\usepackage{svg}
\setsvg{
  inkscapeexe="C:/Program Files/Inkscape/inkscape.com",
  inkscapearea=nocrop,
 }

\begin{document}
  Hello world!
  \includesvg{crystal}
\end{document}

I'm using TeXstudio 2.12.16. When I try to compile the above code I get

Process started: lualatex.exe -synctex=1 -interaction=nonstopmode --shell-escape "document".tex

Process exited with error(s)

with no other info in the Log tab. However, if I check the .log file, I find

! error:  (file ./svg-inkscape/"crystal"_svg-tex.pdf) (pdf backend): cannot find
 image file './svg-inkscape/"crystal"_svg-tex.pdf'
!  ==> Fatal error occurred, no output PDF file produced!

when the _svg-tex.pdf has actually been created and the PDF file produced, just without the picture. Trying to use \includeinkscape{crystal_svg-tex.pdf} is not working either, since I end up with the same messages.

Am I missing something?

5
  • 1
    quoting to allow spaces without messing up generated filenames is tricky, could you try the workaround with unquote used here github.com/ho-tex/oberdiek/issues/73#issuecomment-543101052 and let me know... Oct 19, 2019 at 10:59
  • alternative workaround is \makeatletter \def\set@curr@file#1{\def\@curr@file{#1}} Oct 19, 2019 at 11:05
  • Thank you, the first solution seems to work in the MWE! Could there be any side effect?
    – TeoFed89
    Oct 19, 2019 at 11:17
  • Edit: it works both in the MWE and in the full text!
    – TeoFed89
    Oct 19, 2019 at 11:32
  • @TeoFed89 created an issue on GitHub: github.com/mrpiggi/svg/issues/16 I can not confirm this error with version v2.02c of package svg
    – mrpiggi
    Oct 20, 2019 at 19:52

1 Answer 1

5

The latest latex release improves the file handling in several ways notably spaces and non-ascii UTF-8 characters are allowed in most contexts. In order to allow spaces web2c TeX implementations allow double quoted strings so "foo bar.tex" or even foo" "bar.svg etc.

If the filename is just handled by TeX this is easy enough to manage but if (as here) it is passed to a back end pipeline of other applications doing svg to pdf conversions and including files with derived names, making sure the quoting is always in the right place is a bit tricky.

We will iron out any difficulties in the coming days but meanwhile there are a couple of workarounds you can use

1)

\makeatletter
\let\quote@name\unquote@name
\makeatother

This disables the macro that adds double quotes so you will not get ./svg-inkscape/"crystal"_svg-tex.pdf but conversely filenames with spaces will fail, but if you do not hav espaces in your filenames this should be OK.

2)

\makeatletter
\def\set@curr@file#1{\def\@curr@file{#1}}
\makeatother

This essentially disables all the new filename handling so spaces and UTF-8 protection are both disabled. Again, if you only have ascii filenames this is probably OK.

Both these workarounds affect all filehandling, \input and \usepackage etc, not just \includesvg and \includegraphics

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.