1

I want to include a .svg file into my document. I have a .svg file with the name test.svg

This is the document:

\documentclass[12pt,leqno,a4paper]{article}

\usepackage{graphicx}
\usepackage{svg}

\begin{document}

\begin{figure}[htbp]
\centering
  \includesvg{test}
  \caption{svg image}
\end{figure} 

\end{document}

Even though I basically just did what I found here, I get the following error message:

LOG FILE :
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex 2015.10.22) 16 FEB 2016 22:39
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**filename.tex
(./filename.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/leqno.clo
File: leqno.clo 2015/03/31 v1.1i Standard LaTeX option (left equation numbers)
)
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg
File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
)
Package graphics Info: Driver file: pdftex.def on input line 94.
(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count87
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
(/usr/share/texlive/texmf-dist/tex/latex/svg/svg.sty
Package: svg 2012/09/05 v1.0 SVG inclusion and extraction
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks15
\XKV@tempa@toks=\toks16
)
\XKV@depth=\count88
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
(/usr/share/texlive/texmf-dist/tex/latex/subfig/subfig.sty
Package: subfig 2005/06/28 ver: 1.3 subfig package
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty
Package: caption 2013/05/02 v3.3-89 Customizing captions (AR)
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty
Package: caption3 2013/05/02 v1.6-88 caption3 kernel (AR)
Package caption3 Info: TeX engine: e-TeX on input line 57.
\captionmargin=\dimen105
\captionmargin@=\dimen106
\captionwidth=\dimen107
\caption@tempdima=\dimen108
\caption@indent=\dimen109
\caption@parindent=\dimen110
\caption@hangindent=\dimen111
)
\c@ContinuedFloat=\count89
)
\c@KVtest=\count90
\sf@farskip=\skip43
\sf@captopadj=\dimen112
\sf@capskip=\skip44
\sf@nearskip=\skip45
\c@subfigure=\count91
\c@subfigure@save=\count92
\c@lofdepth=\count93
\c@subtable=\count94
\c@subtable@save=\count95
\c@lotdepth=\count96
\sf@top=\skip46
\sf@bottom=\skip47
)
(/usr/share/texlive/texmf-dist/tex/latex/import/import.sty
Package: import 2009/03/23 v 5.1
)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/transparent.sty
Package: transparent 2007/01/08 v1.0 Transparency via pdfTeX's color stack (HO)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty
Package: auxhook 2011/03/04 v1.3 Hooks for auxiliary files (HO)
))
(/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
)
\SVG@out@width=\skip48
\SVG@out@height=\skip49
\c@svgfigure=\count97
)
(./Yanick_Nedderhoff_MA-proposal.aux)
\openout1 = `Yanick_Nedderhoff_MA-proposal.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9.
LaTeX Font Info: ... okay on input line 9.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9.
LaTeX Font Info: ... okay on input line 9.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9.
LaTeX Font Info: ... okay on input line 9.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9.
LaTeX Font Info: ... okay on input line 9.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9.
LaTeX Font Info: ... okay on input line 9.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9.
LaTeX Font Info: ... okay on input line 9.
(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count98
\scratchdimen=\dimen113
\scratchbox=\box26
\nofMPsegments=\count99
\nofMParguments=\count100
\everyMPshowfont=\toks17
\MPscratchCnt=\count101
\MPscratchDim=\dimen114
\MPnumerator=\count102
\makeMPintoPDFobject=\count103
\everyMPtoPDFconversion=\toks18
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
Package: grfext 2010/08/19 v1.1 Manage graphics extensions (HO)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty
Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO)
))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
)))
Package grfext Info: Graphics extension search list:
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext) \AppendGraphicsExtensions on input line 452.
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
Package caption Info: Begin \AtBeginDocument code.
Package caption Info: subfig package v1.3 is loaded.
Package caption Info: End \AtBeginDocument code.
runsystem(inkscape -z -C -f./test.svg -A./test.pdf --export-latex)...disabled (
restricted).
! LaTeX Error: File `./test' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.14 \includesvg{test}
I could not locate the file with any of these extensions:
.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! LaTeX Error: File `./test' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.14 \includesvg{test}
I could not locate the file with any of these extensions:
.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! LaTeX Error: File `test.pdf_tex' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: pdf_tex)
Enter file name:
! Emergency stop.
<read *>
l.14 \includesvg{test}
^^M
*** (cannot \read from terminal in nonstop modes)
Here is how much of TeX's memory you used:
3476 strings out of 493085
53156 string characters out of 6136916
118399 words of memory out of 5000000
6931 multiletter control sequences out of 15000+600000
3938 words of font info for 15 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
68i,2n,98p,269b,235s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!

The file can't be found. The problem:

I could not locate the file with any of these extensions:
.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps

But it is specifically said here that one should not use the .svg extension. Also, when I try to use it anyway, I get an error as well.

inkscape and texlive-latex-extra are installed. Do you have any ideas on this?

  • 1
    You need to compile with shell-escape enabled. The output clearly shows that you are not doing so: restricted \write18 enabled. – cfr Feb 16 '16 at 21:55
  • 1
    That did it, thanks! If you post it as an answer, I'll mark it as correct. – Yanick Nedderhoff Feb 17 '16 at 11:41
2

You need to compile with shell-escape enabled. The output clearly shows that you are not doing so, but this is unlikely to be obvious from the console output or log unless you know what to look for.

The key part of the output is right near the beginning where it says restricted \write18 enabled. This means that the compiler will only allow external programmes from a strictly limited (restricted) list to be used.

Shell escape is required in order to actually run inkscape as an external programme since it is not included in this list of reasonably-believed-safe programmes allowed in restricted mode.

(This is not because inkscape is believed unsafe, of course. The list is necessarily limited to a small number of programmes whose behaviour is believed to be safe even in somewhat hostile environments.)

  • 1
    for complete novices the message restricted \write18 enabled is not clear; should be only restricted \write18 is enabled or something like that. – user4686 Feb 17 '16 at 12:45
  • @jfbu I agree. I didn't mean 'clear' as in 'should have been obvious' but in the sense of 'this is why I can be certain that it is not enabled'. Actually, I included that text precisely because I wanted to explain how to tell for sure whether shell escape was enabled. It would be even better if the information also included something explicitly about shell-escape since the connection between that option and \write18 is hardly obvious. – cfr Feb 17 '16 at 12:53
  • ah yes, that's even more relevant indeed! – user4686 Feb 17 '16 at 12:54
  • I edited my answer to try to make myself clearer. I realised from your comment that my use of clear was not very clear at all :(. Hopefully it is better now. – cfr Feb 17 '16 at 12:59

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.