Discussion:
that nasty \undefined in supp-pdf.mkii again
(too old to reply)
Norbert Preining
2017-10-24 03:14:37 UTC
Permalink
Raw Message
Dear all,

back in 2010 (!!!) https://tug.org/pipermail/tex-live/2010-March/025102.html
I complained about the fact that a minimal tex document
\documentclass{article}
\usepackage{graphicx}
\newcommand{\undefined}{\textbf{undefined}}
\begin{document}
This is an \undefined\ command.
\end{document}
does not work anymore. This was due to the auto-loading of supp-pdf.mkii
that was introduced in TL2009 (or so).

The reason is that supp-pdf.mkii uses
\ifx\writestatus\undefined
to check for an undefined commands.

I argued that this is wrong to do it this way, especially since this
is loaded now in LaTeX. See
https://tug.org/pipermail/tex-live/2010-March/025107.html

There was the conclusion that pdftex.def should deal with this and
Heiko send a fixed pftex.def:
https://tug.org/pipermail/tex-live/2010-March/025126.html

I tested that and it worked.

But alas here we are in 2017 and a colleague just asked me the very same
question, because he writes a logic text book and uses \undefined as
a macro.

Can we somehow work that out again?

All the best

Norbert

--
PREINING Norbert http://www.preining.info
Accelia Inc. + JAIST + TeX Live + Debian Developer
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
Joseph Wright
2017-10-24 06:32:01 UTC
Permalink
Raw Message
Post by Norbert Preining
Dear all,
back in 2010 (!!!) https://tug.org/pipermail/tex-live/2010-March/025102.html
I complained about the fact that a minimal tex document
\documentclass{article}
\usepackage{graphicx}
\newcommand{\undefined}{\textbf{undefined}}
\begin{document}
This is an \undefined\ command.
\end{document}
does not work anymore. This was due to the auto-loading of supp-pdf.mkii
that was introduced in TL2009 (or so).
The reason is that supp-pdf.mkii uses
\ifx\writestatus\undefined
to check for an undefined commands.
I argued that this is wrong to do it this way, especially since this
is loaded now in LaTeX. See
https://tug.org/pipermail/tex-live/2010-March/025107.html
There was the conclusion that pdftex.def should deal with this and
https://tug.org/pipermail/tex-live/2010-March/025126.html
I tested that and it worked.
But alas here we are in 2017 and a colleague just asked me the very same
question, because he writes a logic text book and uses \undefined as
a macro.
Can we somehow work that out again?
All the best
Norbert
I have to say I'm surprised anyone would use \undefined as a macro, but
I guess as it's a 'user' name (cf. LaTeX's \@ifundefined) then there's
always a chance.

Heiko's earlier mail doesn't say what fix he proposed, and the old FTP
site is no longer available. It seems most likely that the approach of
ensuring \undefined is really not defined is likely to be best,
something like altering the current

\InputIfFileExists{supp-pdf.mkii}{}{}%

to

\let\***@saved@undefined\undefined
\let\undefined\***@undefined
\InputIfFileExists{supp-pdf.mkii}{}{}%
\let\undefined\***@saved@undefined

I guess will do it. I'll discuss with David C.

Joseph
Norbert Preining
2017-10-24 06:41:11 UTC
Permalink
Raw Message
Hi Joseph,
Post by Joseph Wright
I have to say I'm surprised anyone would use \undefined as a macro, but
If you discuss programming languages or syntax or similar, there is
a chance that \undefined is used as a proper macro. Nothing that
is queer to me.
Post by Joseph Wright
Heiko's earlier mail doesn't say what fix he proposed, and the old FTP
site is no longer available. It seems most likely that the approach of
Indeed, I tried that, too.
Post by Joseph Wright
\InputIfFileExists{supp-pdf.mkii}{}{}%
Ah, sounds fine, thanks!

Norbert

--
PREINING Norbert http://www.preining.info
Accelia Inc. + JAIST + TeX Live + Debian Developer
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
Ulrike Fischer
2017-10-24 07:19:28 UTC
Permalink
Raw Message
Post by Joseph Wright
Heiko's earlier mail doesn't say what fix he proposed, and the old FTP
site is no longer available.
You can see the changes in older pdftex.def. E.g. in one from TL14 I
see

\def\***@catcodes#1{%
\expandafter\edef\csname ***@restore@#1\endcsname{%
\let\noexpand\undefined
\expandafter\noexpand\csname GPTorg@#***@undefined\endcsname
\let\expandafter\noexpand\csname GPTorg@#***@undefined\endcsname
\noexpand\@undefined

and so on ...
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Joseph Wright
2017-10-24 08:14:23 UTC
Permalink
Raw Message
Post by Ulrike Fischer
Post by Joseph Wright
Heiko's earlier mail doesn't say what fix he proposed, and the old FTP
site is no longer available.
You can see the changes in older pdftex.def. E.g. in one from TL14 I
see
\let\noexpand\undefined
and so on ...
Ah yes: part of the rather 'extended' catcode business that was there.
I'll sort this.

Joseph

Loading...