I'm working on a way to have my .svg exported with inkscape to .pdf_tex if the .svg file was changed. That allows me to change the figure, hit Ctrl+S and then just compile my tex file.

I adapted some commands which I found here so that I can access my figures anywhere (previously it was only working with the working directory).

Now to make it easier to use, I'd like to just declare \graphicspath and then have my commands use it.

Right now I'm doing the following:


which I can then use in my own command like


Now how do I get my \figurepath to use \graphicspath? Is there something like get(grahicspath)?


Okay, so here is what I'm working with at the moment:




  {inkscape -z -D --file=\figurepath{#1.svg} 
  --export-pdf=\figurepath{#1.pdf} --export-latex}

It runs and is quite useful. What it does is check if the svg file has been edited and if yes it exports a new pdf_tex with inkscape. There are some other examples around which do the same, but they all worked only for svgs in the working directory. I couldn't find one where it is possible to use svgs from any location on your computer.

In order for this to work, it is necessary to add -shell-escape to pdflatex, e. g. I'm using Texstudio and under Options->Commands I edited the line PdfLaTex to look like

pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex

Under Windows it is also required to add the location of inkscape.exe to PATH. To do this type System in the search panel and then go to advanced system settings. Under advanced click Environment Variables... and a window will pop up, find PATH in system variables, click edit and add the directory of inkscape.

There is a known bug with the 0.48 versions of inkscape, which will print

 RegistryTool: Could not set the value 'Path/to/inkscape'

nevertheless it works and this bug has been fixed in the 0.91 version.

2 Answers 2


The original LaTeX code found on page 3 of this document, on which your question seems to be based on, requires the packages graphicx.sty and color.sty (or xcolor.sty) to work.

A slightly different approach is to make additional use of the package import.sty:


    {inkscape -z -D --file=#1#2.svg --export-pdf=#1#2.pdf --export-latex}%

Now \includesvg has an optional argument which accepts the relative path to the files (note that all three files, i.e. .PDF, .PDF_TEX, and .SVG, must have the same name and be present in the same directory).

Examples of usage:

\includesvg{mydwg} % working directory

Actually it's the other way round:-) the path mechanism is implemented for \input and \includegraphics locally sets it to the value given in \graphicspath .

So most efficient is don't use \graphicspath just set


before you run latex which will add that folder to the start of the search path.

Or, if you want to use the \graphicspath notation but have \input see it, use


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .