I'm trying to use the svg package for inserting svg images in my latex file, as suggested in other questions. But now I ran into a problem:

For example I have a image figure1.svg, if I write


it will give an error says

ERROR: LaTeX Error: File `figure1.pdf_tex' not found.

But if I write


it will give another error says

ERROR: LaTeX Error: Unknown graphics extension: .svg.

How can I fix this problem? I'll prefer not having to convert all my svg files to pdf_tex files with some external program.


My LaTeX environment is latest the TeXLive 2013 on Windows 7. A MWE code would be



  \caption{svg image}

  • 1
    I just tried it using a simple SVG. I had all prerequisites: adding the --shell-escape option to pdflatex and installing ImageMagick. To me it seems as if the package is a bit buggy. – Uwe Ziegenhagen Jul 7 '13 at 6:40
  • 2
    I spite of your last sentence, I suggest change all \includesvg{..} by \includegraphics{...} without any extension and (1) import the latex document with Lyx to allow an automatic conversion with rsvg-convert or (2) work directly with pdf files that still can be edited with Inkscape. For many files is less painfull the command line (inkscape -f file.svg -A file.pdf). – Fran Jul 7 '13 at 10:11
  • May be useful: How to include SVG diagrams in LaTeX? – user11232 Jul 7 '13 at 13:10
  • 1
    Had this same error using XeLaTeX with Texmaker on GNU/Linux where \includesvg{image} or \includesvg{image.svg} just wouldn't work. Had to do \includegraphics{image} and then it magically started working. – ZN13 May 23 '17 at 10:30
  • Convert to PNG. Then, \includegraphics{}. You're welcome. – hola Jun 3 '17 at 10:42

The problem is that you have given a file extension: you should not do this (indeed this seems clear in the svg manual. For me, the short demo

\usepackage{amsmath} % you need amsmath as the demo includes a use of \eqref

  \caption{svg image}


using the demonstration file used by the package works fine.

Note that for this to work:

  • You need Inkscape on your path (why?) (schtandard pointed to this step-by-step of the setup)
  • You need to compile your .tex file to PDF with the --shell-escape option enabled
  • 2
    Getting this to work on Windows is OK, but on my Mac seems tricky. That's likely an Inkscape/Mac issue, so not relevant here! – Joseph Wright Aug 24 '13 at 6:56
  • 3
    Calling svg as \usepackage[inkscape={/Applications/Inkscape.app/Contents/Resources/bin/inkscape -z -C}]{svg} seems to solve the issue on Mac OS X (assuming Inkscape has been installed with the .dmg file. – egreg Aug 24 '13 at 10:54
  • 1
    @LWZ No, what actually happens is that the svg package uses Inkscape to convert to PDF on-the-fly. You have to have Inkscape available for this to work. – Joseph Wright Aug 24 '13 at 16:34
  • 1
    I had problems when the image was located in different folder e.g. ../images/image2. The pdfs are created on the fly in this directory, but then tex tries to include the pdfs from the previous directory. – sauerburger Jun 30 '15 at 18:15
  • 2
    @JosephWright what is meant by this You need Inkscape on your path. Path that we give while installing inkspacke, should be of .tex file? – Infinity Dec 6 '17 at 11:56

I had the same problem.

I found a simple way to deal with it.

  • Just open the svg file by Inkscape.

  • Save as the .pdf format

  • On the next pop up window:

    • Embed Fonts

    • Use exported object's size

    • Margin 0.1

  • click ok

Next the generated pdf file will be imported by latex easily as same as png or eps.

But some times inkscape does not read the svg file properly and some mistakes are occurred. In this case the solution which works for me is:

  • generate a pdf version of figure by your used designer software

  • include the pdf file in latex

  • use trim for cropping the figure in latex

for example:

\includegraphics[width=0.8\textwidth, trim={1cm 3cm 1cm 8cm},clip]{Fig.pdf}
  • 3
    Welcome to TeX.SX! This is not really an answer as you do not include the svg (that's what's asked for). – TeXnician Oct 30 '17 at 7:51
  • 8
    @TeXnician You are very stringent. Generally I like this, but in this case … You are absolutely right: It's not an answer to the asked question but an alternative way to avoid the problem. – Schweinebacke Oct 30 '17 at 9:16
  • It's a relevant answer since using the svg package is using inkscape and will create a .pdf in the root directory anyway. BTW inkscape can do this in one command if someone wish to integrate it in a script or whatever – Welgriv Sep 23 '20 at 8:53

While this may not be a valuable option for some users, it may be worth it for some:

Online SVG to PDF converters.

Here you may find Google search results.

After this one may follow the usual strategies for embedding PDF files into LaTeX,
(as described for example in the answer above).

Hope this helps some users. ;)

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.