LaTeX forum ⇒ Graphics, Figures & TablesCan'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

Postby lgallindo » Tue Sep 06, 2016 5:44 pm

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


I'm getting the following error output:
  1. <use images/crap/ufrpelogo1.jpeg>
  2. ! Undefined control sequence.
  3. <argument> ...@base \Gin@ext image\GPT@AttrShort
  4. \ifx \GPT@print \ltx@empty...
  5. 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:

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

Postby Stefan Kottwitz » Tue Sep 06, 2016 8:06 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.
LaTeX.org admin

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

Postby lgallindo » Tue Sep 06, 2016 11:37 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.
(264 Bytes) Downloaded 243 times
MWE.log
Requested log.
(6.34 KiB) Downloaded 192 times

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

Postby lgallindo » Tue Sep 06, 2016 11:38 pm

More attachments.

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

User avatar
cgnieder
Site Moderator
Posts: 1990
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Tue Sep 13, 2016 8:58 pm

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

  1. \documentclass{article}
  2. \usepackage{graphicx,mwe}
  3.  
  4. \begin{document}
  5. \includegraphics[width=2.5cm,natwidth=151, natheight=165]{example-image-a}
  6. \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


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 7 guests