[pdftex] Multiple references to image fails.

Heiko Oberdiek oberdiek at uni-freiburg.de
Wed Jun 11 07:16:45 CEST 2008


On Wed, Jun 11, 2008 at 09:57:52AM +1000, Bob Howlett wrote:

> Heiko Oberdiek wrote:
> >> Moving the definitions out of the box made them global.
> > 
> > No. As plain-TeX user you should know that.
> > 
> Strange comment ...
> A definition made inside an hbox is surely not global,
> and moving it out could easily make it global (if it is
> not in any other group).

Proof of the "no" by counter example:

% plain-TeX or iniTeX
\catcode`\{=1
\catcode`\}=2
\globaldefs=0 % default
\begingroup
  \hbox{\def\a{a}}
\endgroup
\show\a % undefined as expected
\end

Now let's move the definition of \a out of the \hbox:

% plain-TeX or iniTeX
\catcode`\{=1
\catcode`\}=2
\globaldefs=0 % default
\begingroup
  \hbox{}
  \def\a{a}
\endgroup
\show\a % undefined
\end

Moving of the definition of \a out of the \hbox doesn't
make \a global.

q.e.d.

> A definition made inside an hbox is surely not global,

Global definitions inside a box are possible:

a)
% plain-TeX or iniTeX
\catcode`\{=1
\catcode`\}=2
\globaldefs=0 % default
\hbox{\gdef\a{a}}
\show\a % \a=macro:->a
\end

b)
% plain-TeX or iniTeX
\catcode`\{=1
\catcode`\}=2
\globaldefs=1 % definitions are global by default
\hbox{\def\a{a}}
\show\a
\end

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>
-- 


More information about the pdftex mailing list