I am currently working on my PhD thesis, and I am having trouble including a pdf_tex and pdf file created using Inkscape. I am using TeXStudio and PDFLaTeX.

The relevant files are:


The svg has added annotations to the png file. This is exported as a pdf and pdf_tex file for use in the thesis.

The command to include the file with the diagram is in thesis.tex.

    % Chapter 5

The figure import command in Chapter05/teleoperation.tex is:

    \caption{\SolidWorks Model with Coordinate Systems Highlighted}

When I try to compile the document, it comes up with the error:


LaTeX Warning: File `solidworks_model_view.pdf' not found on input line 52.

! Package pdftex.def Error: File `solidworks_model_view.pdf' not found.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.

l.52 ...length,page=1]{solidworks_model_view.pdf}}

In other words, it is finding the .pdf_tex file just fine, but is choking on the \includegraphics command inside to get the pdf file. I thought the \import command modified the search paths for files in its command. My graphicspath is set so I can import graphics file from that directory tree just fine.

If I change the figure inclusion to:


Everything works perfectly fine. Why can I not do the same with \import and pdf_tex files?

For completeness, here is the pdf_tex file generated by Inkscape. THe offending \includegraphics directive is on line 52.

    %% Creator: Inkscape 0.91_64bit, www.inkscape.org
    %% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010
    %% Accompanies image file 'solidworks_model_view.pdf' (pdf, eps, ps)
    %% To include the image in your LaTeX document, write
    %%   \input{<filename>.pdf_tex}
    %%  instead of
    %%   \includegraphics{<filename>.pdf}
    %% To scale the image, write
    %%   \def\svgwidth{<desired width>}
    %%   \input{<filename>.pdf_tex}
    %%  instead of
    %%   \includegraphics[width=<desired width>]{<filename>.pdf}
    %% Images with a different path to the parent latex file can
    %% be accessed with the `import' package (which may need to be
    %% installed) using
    %%   \usepackage{import}
    %% in the preamble, and then including the image with
    %%   \import{<path to file>}{<filename>.pdf_tex}
    %% Alternatively, one can specify
    %%   \graphicspath{{<path to file>/}}
    %% For more information, please see info/svg-inkscape on CTAN:
    %%   http://tug.ctan.org/tex-archive/info/svg-inkscape
        \errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}%
        \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%
          \setlength{\unitlength}{\unitlength * \real{\svgscale}}%
  • 1
    just use standard \input{solidworks_model_view.pdf_tex} and make sure that the directory with your tex/image combination is in your TEXINPUTS path – David Carlisle Jul 15 '15 at 9:24
  • you can't use page key with \includegraphics[width=\unitlength,page=1]{solidworks_model_view.pdf} use \includegraphics[width=\unitlength]{solidworks_model_view.pdf} – touhami Jul 15 '15 at 9:30
  • @touhami page should work with pdf files. – David Carlisle Jul 15 '15 at 9:38
  • @DavidCarlisle i did not know – touhami Jul 15 '15 at 9:56
  • @DavidCarlisle, thanks fort he tip but I would prefer to not to alter environment variables, as I want to keep all my compilation steps portable between different computers (my University computer uses Windows and my home computer uses Linux). – bjem Jul 15 '15 at 22:23

Ok, I've just been battling the same problem.

My solution was to add a \graphicspath{{figs/}} in the beginning of the file, so that it know where to look for the .pdf file. I'm not sure why, but adding figs/ in the beginning of the input command \input{figs/AMB-SyRM4d.pdf_tex} was not enough.

Hope this helps.

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.