LaTeX forum ⇒ GeneralUndefined control sequence ...\Gin@ext image\GPT@AttrShort Topic is solved

General information and discussion about TeXnicCenter
User avatar
Johannes_B
Site Moderator
Posts: 3551
Joined: Thu Nov 01, 2012 4:08 pm

Re: Cannot include jpg in document

Postby Johannes_B » Sun Jun 05, 2016 12:39 pm

You are using package graphics, which the documentation of dinbrief recommends. Bad advice, use the modern and extended version, named graphicx.

  1. \documentclass[11pt,german]{dinbrief}
  2. \usepackage[german]{babel}
  3. \usepackage[ansinew]{inputenc}
  4. \usepackage{calc}
  5. \usepackage{color}
  6. \usepackage[nodayofweek,raise]{datetime}
  7. \usepackage{dcolumn}
  8. \usepackage{eurosym}
  9. \usepackage{fancyhdr}
  10. \usepackage{graphicx}
  11. \usepackage{ifthen}
  12. \usepackage{xspace}
  13. \usepackage{hyperref}
  14.  
  15. \nowindowrules
  16. \centeraddress
  17. %\nowindowtics
  18. \nobackaddressrule
  19.  
  20. \begin{document}
  21. \begin{letter}{%
  22. }
  23. \opening{%
  24. Sehr geehrte,%
  25. }
  26. \thispagestyle{empty}
  27. \includegraphics[viewport=45pt 30pt 525pt 120pt,clip]{example-image}
  28. \label{LastPage}
  29. \closing[%
  30. \hspace*{-6mm}%
  31. {\includegraphics[viewport=45pt 30pt 525pt 120pt,clip]{example-image}}
  32. ]
  33. {%
  34. Wombat
  35. }
  36. \end{letter}
  37. \end{document}



By the way, i wouldn't use dinbrief, i would use scrletter from the KOMA-bundle.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

mb2
Posts: 10
Joined: Sat Jun 04, 2016 2:20 pm

Postby mb2 » Sun Jun 05, 2016 10:45 pm

Sorry, Gents,
I thought more about the compiler error that I incurred and come to think that I did not put forward the problem correctly.
Please consider the following:
I had taken the error message "! Undefined control sequence." for an indication that the compiler had not found the macro or the image file itself to include as graphics.
I believe my inference was false.
Reviewing the log file, the context of the error looks as follows:

File: image.jpg Graphic file (type jpg)
<use image.jpg>
Package pdftex.def Info: image.jpg used on input line 214.
(pdftex.def) Requested size: 539.99869pt x 119.9997pt.

! Undefined control sequence.
<argument> ...@base \Gin@ext image\GPT@AttrShort
\ifx \GPT@print \ltx@empty...

\Gscale@box ...Gscale@y {#2}\setbox \z@ \hbox {{#3
}}\setbox \tw@ \hbox {\Gsc...

\Ginclude@jpg ...se \egroup \fi \GPT@clipend \fi }
\GPT@ResetColorEnd }
\ETE@OrgGin@setfile ... Ginclude@#1\endcsname {#3}
}\dp \z@ \z@ \ht \z@ \Gin@...

\Gin@setfile ...y \ETE@OrgGin@setfile {#1}{#2}{#3}
\else \begingroup \ETE@Ins...

\Ginclude@graphics ...sname {\Gin@base \Gin@ext }}
\fi \endgroup
\Gin@iii ...p \Gin@ury {#4}\Ginclude@graphics {#5}
\endgroup
\@begin@tempboxa ...mpboxa #1{\color@begingroup #2
\color@endgroup }\def \wid...

\Gscale@box@dd #1#2#3->\@begin@tempboxa \hbox {#3}
\setlength \@tempdima {#1}...

\ka@db@closing ...3} \setbox \@tempboxa =\hbox {#1
} \ka@db@tmpdimb =\ht \@te...
l.214 }

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

It seems the image was found and included, but the error occurred in the subsequent processing.
The whole idea is to include a digital signature inside the optional argument of the closing command of a letter.

\closing[%
\hspace*{-5mm}%
\mysignature% <- here is an \includegraphics command using the package graphics, see post above
]
{%
\MfG%
}

Would it be possible to readdress the problem as presented now?
Please consider.
Many thanks.

User avatar
Johannes_B
Site Moderator
Posts: 3551
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Jun 06, 2016 8:53 am

It has been already in the answer above. Use package graphicx. You cannot do the stuff you want with package graphics (mind the s) and a jpg image.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8460
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Jun 06, 2016 9:09 am

The problem in your example code is nesting square brackets:

  1. \closing[%
  2. \hspace*{-6mm}%
  3. \includegraphics[45pt,30pt][525pt,120pt]{sample.jpg}%
  4. ]


The LaTeX parser cannot work with brackets inside brackets. But you can "hide" the command with the inside brackets by grouping in braces:

  1. \closing[%
  2. \hspace*{-6mm}%
  3. {\includegraphics[45pt,30pt][525pt,120pt]{sample.jpg}}%
  4. ]


Stefan
Site admin

User avatar
Johannes_B
Site Moderator
Posts: 3551
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Jun 06, 2016 9:28 am

That problem has to be avoided as well, but you cannot use the old syntax with jpg files.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

mb2
Posts: 10
Joined: Sat Jun 04, 2016 2:20 pm

Postby mb2 » Mon Jun 06, 2016 8:37 pm

Dear Johannes and Stefan,
With your advice I could solve the problem.
I changed to graphicx (and ngerman).
The file runs without error. Output is fine.
You made my day.
Thank you very much indeed.
I would have been lost without you.
Speak soon, mb


Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests