[tex-k] TeX error exit upon \showthe

Olaf Weber olaf at infovore.xs4all.nl
Tue Feb 10 09:16:57 CET 2004

Reinhard Kotucha writes:
> "Olaf" == Olaf Weber <olaf at infovore.xs4all.nl> writes:
>> Hartmut Henkel writes:

>>> I'm wondering about the following, in TeX and pdfTeX: Upon
>>> \showthe\wd0 one gets e. g.

>>> > 5.55994pt.
>>> l.13 \showthe\wd0

>>> ? h This isn't an error message; I'm just \showing something.

>>> So it's only an informal message, harmless, definitely not an
>>> error! But in tex.web still the procedure error is called from
>>> procedure show_whatever. Consequently TeX or pdfTeX end with
>>> uexit(1), which means FAIL, so that e. g. a make would quit
>>> after such a TeX run. It looks wrong to me, but it is in the
>>> TeX core... Can anybody give me a short hint about this? Thanks
>>> a lot.

>> Well, it _is_ in the TeX core, in the sense that even after a
>> \show* the error history has become "tainted".  And the core TeX
>> code (that is, DEK's code) doesn't signal to the 'error' routine
>> that this was intentional and harmless...

> Hi Olaf,
> do you think that it shouldn't be changed because it's in the core?  I
> mentioned this behaviour when we met in Bremen last year, you said
> that if I think it is a bug I should send you a mail.

I'm not saying the behaviour cannot (or even shouldn't) be changed.
What DEK implemented is that \showthe uses the same code path as error
reporting, and as a result it "taints" the run as if an error has

It looks like changing this is fairly easy, and should be fairly
harmless, though there are probably people who would prefer the old

> Though I think that this behaviour is wrong if the operating system
> has a concept of "exit codes",  I found it quite convenient sometimes.

> If you run tex from the commandline the exit status doesn't matter.
> If your makefile runs LaTeX three times to get cross references right,
> it is probably better if it aborts after the first run if you forgot
> to remove the \show or \showthe.

> I think that the behaviour can be changed because it is definitely
> operating system dependant.  On the other hand, I doubt that it is
> worth the trouble.

> What is more important is that TeX exits with status 1 in certain
> cases.  For instance, if an \input file is not found, TeX ends up in
> an endless loop.  LaTeX's x.tex breakes this loop but the exit status
> was 0 because it just executed \end.  In the next LaTeX release it
> will call \errmessage{} before.  \errmessage sets the exit status to 1.

> x.tex is designed to work with plain TeX as well, but it would be nice
> if we would have something for metapost and metafont as well.

> For metapost I use a file x.mp
> ------------------------------
> batchmode;
> errmessage "";
> end;
> ------------------------------

> The same file will work for metafont if it is called x.mf.

> It would be nice if those two little files would be part of future TeX
> disributions.


Olaf Weber

               (This space left blank for technical reasons.)

More information about the tex-k mailing list