2

This question already has an answer here:

I am trying to include a .pdf_tex file into my latex document. I saved the file from svg in Inkscape to .pdf_tex file. And I use this in my latex document:

\begin{figure}
  \centering
  \input{myfile2.pdf_tex}
\end{figure}

myfile2.pdf_tex is in the same file as the main folder. But the error said

Package pdftex.def Error: `myfile2.pdf' not found

I don't know what's going on here and tried to check for many forum but couldn't find the answer. I using texmaker.

LOG FILE :
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex 2017.1.23) 23 JAN 2017 19:44
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**"Report-PhysicallyCoupledTask copy.tex"
(./Report-PhysicallyCoupledTask copy.tex
LaTeX2e <2017/01/01>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
LaTeX Font Info: Try loading font information for OT1+lmtt on input line 63.
(/usr/local/texlive/2016/texmf-dist/tex/latex/lm/ot1lmtt.fd
File: ot1lmtt.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
LaTeX Font Info: External font `lmex10' loaded for size
(Font) <12> on input line 66.
LaTeX Font Info: External font `lmex10' loaded for size
(Font) <8> on input line 66.
LaTeX Font Info: External font `lmex10' loaded for size
(Font) <6> on input line 66.
LaTeX Warning: No \author given.
LaTeX Font Info: External font `lmex10' loaded for size
(Font) <9> on input line 72.
LaTeX Font Warning: Font shape `OT1/lmr/bx/sc' undefined
(Font) using `OT1/lmr/bx/n' instead on input line 85.
(./myfile2.pdf_tex <myfile2.pdf, id=83, page=1, 1284.8pt x 702.625pt>
File: myfile2.pdf Graphic file (type pdf)
<use myfile2.pdf, page 1>
Package pdftex.def Info: myfile2.pdf, page1 used on input line 52.
(pdftex.def) Requested size: 1284.79999pt x 702.64471pt.
<myfile2.pdf, id=84, page=2, 1284.8pt x 702.625pt>
File: myfile2.pdf Graphic file (type pdf)
<use myfile2.pdf, page 2>
Package pdftex.def Info: myfile2.pdf, page2 used on input line 55.
(pdftex.def) Requested size: 1284.79999pt x 702.64471pt.
<myfile2.pdf, id=85, page=3, 1284.8pt x 702.625pt>
File: myfile2.pdf Graphic file (type pdf)
<use myfile2.pdf, page 3>
Package pdftex.def Info: myfile2.pdf, page3 used on input line 59.
(pdftex.def) Requested size: 1284.79999pt x 702.64471pt.
!pdfTeX error: /Library/TeX/texbin/pdflatex (file ./myfile2.pdf): PDF inclusion
: required page does not exist <3>
==> Fatal error occurred, no output PDF file produced!

pdf_tex file:

%% Creator: Inkscape inkscape 0.91, www.inkscape.org
%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010
%% Accompanies image file 'myfile2.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
%%
\begingroup%
  \makeatletter%
  \providecommand\color[2][]{%
    \errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}%
    \renewcommand\color[2][]{}%
  }%
  \providecommand\transparent[1]{%
    \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%
    \renewcommand\transparent[1]{}%
  }%
  \providecommand\rotatebox[2]{#2}%
  \ifx\svgwidth\undefined%
    \setlength{\unitlength}{1280bp}%
    \ifx\svgscale\undefined%
      \relax%
    \else%
      \setlength{\unitlength}{\unitlength * \real{\svgscale}}%
    \fi%
  \else%
    \setlength{\unitlength}{\svgwidth}%
  \fi%
  \global\let\svgwidth\undefined%
  \global\let\svgscale\undefined%
  \makeatother%
  \begin{picture}(1,0.546875)%
    \put(0,0){\includegraphics[width=\unitlength,page=1]{myfile2.pdf}}%
    \put(0.46834302,0.50912102){\color[rgb]{0.14901961,0.14901961,0.14901961}\rotatebox{90}{\makebox(0,0)[b]{\smash{Force difference [N]}}}}%
    \put(0.63887864,0.31148664){\color[rgb]{0.14901961,0.14901961,0.14901961}\makebox(0,0)[b]{\smash{Total force [N]}}}%
    \put(0,0){\includegraphics[width=\unitlength,page=2]{myfile2.pdf}}%
    \put(0.52089864,0.34793664){\color[rgb]{0.14901961,0.14901961,0.14901961}\makebox(0,0)[b]{\smash{0}}}%
    \put(0.63887864,0.34793664){\color[rgb]{0.14901961,0.14901961,0.14901961}\makebox(0,0)[b]{\smash{15}}}%
    \put(0.75685864,0.34793664){\color[rgb]{0.14901961,0.14901961,0.14901961}\makebox(0,0)[b]{\smash{30}}}%
    \put(0,0){\includegraphics[width=\unitlength,page=3]{myfile2.pdf}}%
    \put(0.49981927,0.36697227){\color[rgb]{0.14901961,0.14901961,0.14901961}\makebox(0,0)[rb]{\smash{-3}}}%
    \put(0.49981927,0.46725539){\color[rgb]{0.14901961,0.14901961,0.14901961}\makebox(0,0)[rb]{\smash{0}}}%
    \put(0.49981927,0.63439414){\color[rgb]{0.14901961,0.14901961,0.14901961}\makebox(0,0)[rb]{\smash{5}}}%
    \put(0,0){\includegraphics[width=\unitlength,page=4]{myfile2.pdf}}%
  \end{picture}%
\endgroup%

marked as duplicate by user36296, Community Jan 24 '17 at 11:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Didn't Inkscape also create a pdf file? You need that as well. If I'm not mistaken the pdf_tex file just contains the inclusion of the pdf file plus some code to add text on top of the pdf file. Thus you need both generated files. – daleif Jan 23 '17 at 18:49
  • What is a .pdf_tex file? Do you mean a .tex file that you compile with pdftex? Do you mean a PDF file created by pdftex. – Herb Schulz Jan 23 '17 at 19:00
  • 1
    @HerbSchulz it's a name given to some Inkscape to latex output files. It is a strange naming convention – daleif Jan 23 '17 at 19:50
  • 2
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Martin Schröder Jan 23 '17 at 20:13
  • 1
    Can you upload the pdf somewhere so others can test the code. Perhaps even extend your sniplet at the start to a full minimal example, so we know the preamble you are using for testing this. Btw what exactly are in those graphs? At least the text seems simple enough for this to be made directly in latex using tikz – daleif Jan 23 '17 at 20:27

Browse other questions tagged or ask your own question.