GeneralUndefined control sequence ...\Gin@ext image\GPT@AttrShort

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

Undefined control sequence ...\Gin@ext image\GPT@AttrShort

Post by Johannes_B »

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

Code: Select all

\documentclass[11pt,german]{dinbrief}
\usepackage[german]{babel}
\usepackage[ansinew]{inputenc}
\usepackage{calc}
\usepackage{color}
\usepackage[nodayofweek,raise]{datetime}
\usepackage{dcolumn}
\usepackage{eurosym}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage{xspace}
\usepackage{hyperref}

\nowindowrules
\centeraddress
								%\nowindowtics
\nobackaddressrule

\begin{document}
\begin{letter}{%
	}
	\opening{%
		Sehr geehrte,%
	}
	\thispagestyle{empty}
	\includegraphics[viewport=45pt 30pt  525pt 120pt,clip]{example-image}
	\label{LastPage}
	\closing[%
		\hspace*{-6mm}%
		{\includegraphics[viewport=45pt 30pt  525pt 120pt,clip]{example-image}}
	]
	{%
	Wombat
	}
\end{letter}
\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.

Recommended reading 2024:

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

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

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

Re: Cannot include jpg in document

Post by mb2 »

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: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Cannot include jpg in document

Post by Johannes_B »

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: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Undefined control sequence ...\Gin@ext image\GPT@AttrShort

Post by Stefan Kottwitz »

The problem in your example code is nesting square brackets:

Code: Select all

\closing[%
  \hspace*{-6mm}%
        \includegraphics[45pt,30pt][525pt,120pt]{sample.jpg}%
        ]
The LaTeX parser cannot work with brackets inside brackets. But you can "hide" the command with the inside brackets by grouping in braces:

Code: Select all

\closing[%
  \hspace*{-6mm}%
        {\includegraphics[45pt,30pt][525pt,120pt]{sample.jpg}}%
        ]
Stefan
LaTeX.org admin
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Cannot include jpg in document

Post by Johannes_B »

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: 12
Joined: Sat Jun 04, 2016 2:20 pm

Re: Cannot include jpg in document

Post by mb2 »

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