LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Can't insert pdf image Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
lgallindo
Posts: 3
Joined: Tue Sep 06, 2016 5:26 pm

Can't insert pdf image

Hi, I'm trying to compile the following on Tex Live 2016 on Windows:
\documentclass[12pt, a4paper]{report} \usepackage{graphicx} \begin{document} \thispagestyle{empty}\begin{figure}[!htb]\centering\includegraphics[width=2.5cm, natwidth=151, natheight=165]{images/crap/ufrpelogo1.jpeg}\end{figure} \end{document}

I'm getting the following error output:
<use images/crap/ufrpelogo1.jpeg>! Undefined control sequence.<argument> ...@base \Gin@ext  image\GPT@AttrShort                                                    \ifx \GPT@print \ltx@empty...l.10 ...atheight=165]{images/crap/ufrpelogo1.jpeg}

I never got trouble with graphicx before, but the university demands those configs (centering, width=2.5cm, natwidth=151, natheight=165) on its logo.

PS.: On a unrelated note, how do I format code on these posts?
Last edited by lgallindo on Tue Sep 06, 2016 11:40 pm, edited 2 times in total.

Tags:

Stefan Kottwitz
Posts: 9549
Joined: Mon Mar 10, 2008 9:44 pm
Welcome to the forum!

The code is correct. I guess the error message doesn't belong to this code but to your original code that is different. Did you try this example? Can you post the log file, as attachment here?
I remember such errors when using graphics instead of graphicx or when using \includegraphics with optional arguments within an optional argument, so nesting brackets that doesn't work.

Stefan

PS: to format code, use the "Code" button above the edit field. Or the [code]...[/code] syntax. I corrected it above. If you move the mouse cursor over a button, there's a small popup help information.

lgallindo
Posts: 3
Joined: Tue Sep 06, 2016 5:26 pm
I guess the error message doesn't belong to this code but to your original code that is different.

Nope, this exact code. It was extracted from a thesis. Logfile attached.

Out of completude, I'm using pdflatex via TexWorks on TexLive on Windows 7.
Attachments
MWE.tex
LaTeX file.
MWE.log
Requested log.

lgallindo
Posts: 3
Joined: Tue Sep 06, 2016 5:26 pm
More attachments.

The other machine, this one with MikTeX, gives the same error.
Attachments
The image I'm trying to embed.
ufrpelogo1.jpeg (9.25 KiB) Viewed 3063 times
MWE.pdf
Produced pdf.

cgnieder
Site Moderator
Posts: 1990
Joined: Sat Apr 16, 2011 7:27 pm
I can reproduce the issue with a real minimal working example:

\documentclass{article}\usepackage{graphicx,mwe} \begin{document}\includegraphics[width=2.5cm,natwidth=151, natheight=165]{example-image-a}\end{document}

With natwidth and natheight you are trying to specify a bounding box which is not supported by the pdftex driver:

the driver pdftex.def does not support the manual specification of the bounding box, because it is not needed. If the user wants to have a portion of the image, there are options viewport and trim to specify this wish in a cleaner way. Option bb is treated as viewport with a warning.

So leave those options out and use the alternative options if you need them.

Regards
site moderator & package author