Graphics, Figures & TablesCan't insert pdf image

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

Can't insert pdf image

Post by lgallindo »

Hi, I'm trying to compile the following on Tex Live 2016 on Windows:

Code: Select all

\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:

Code: Select all

<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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Can't insert pdf image

Post by Stefan Kottwitz »

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.
LaTeX.org admin
lgallindo
Posts: 3
Joined: Tue Sep 06, 2016 5:26 pm

Can't insert pdf image

Post by lgallindo »

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.
(264 Bytes) Downloaded 590 times
MWE.log
Requested log.
(6.34 KiB) Downloaded 450 times
lgallindo
Posts: 3
Joined: Tue Sep 06, 2016 5:26 pm

Re: Can't insert pdf image

Post by lgallindo »

More attachments.

The other machine, this one with MikTeX, gives the same error.
Attachments
The image I'm trying to embed.
The image I'm trying to embed.
ufrpelogo1.jpeg (9.25 KiB) Viewed 8481 times
MWE.pdf
Produced pdf.
(957 Bytes) Downloaded 349 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Can't insert pdf image

Post by cgnieder »

I can reproduce the issue with a real Infominimal working example:

Code: Select all

\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
Post Reply