2

I'm sort of stumped on this one. I'm trying to include some graphics that I created with Stata in a document. I'm using pdfLaTeX and graphicx. When I try to compile, I get the error message:

ERROR: Text line contains an invalid character.

--- TeX said ---
l.1 ^^@
           ^^PJFIF^^@^^A^^A^^A^^A,^^A,^^@^^@^^@C^^@^^A^^A^^A^^A^^A^^A^^A^^..."

My file is very simple:

\documentclass{article}
\usepackage{graphicx}
\usepackage{graphicx}
\begin{document}

\input{jpeg/math.eps.jpeg}
\end{document}

I've tried using EPS, JPEG and PDF with the pdftex option for graphicx.

Any ideas?

  • 4
    Use \includegraphics{...}, not \input{..}. And also remove the dot between math and eps in the file name. – Ulrike Fischer Mar 20 '12 at 15:18
  • I knew I was doing something stupid. Thank you. The dot I think is ok because that's the file name. – PaulB Mar 20 '12 at 15:19
  • 1
    nope, you were right - it doesn't like the .eps.jpeg file name. – PaulB Mar 20 '12 at 15:21
  • 1
    Why are you calling graphicx twice? Also, with an up-to-date system, you usually don't need to include a pdftex option or the like; I think there might actually be reasons not to do it. – doncherry Mar 20 '12 at 16:44
  • It is useful to read the package documentation (or at least open it). You can find the documentation file at the web address ctan.org/pkg/<package_name> so for graphicx it is ctan.org/pkg/graphicx – yo' Mar 21 '12 at 0:13
2

As Ulrike Fisher points out in comments: Use \includegraphics{...}, not \input{..}. And also remove the dot between math and eps in the file name.

| improve this answer | |

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.