I'm using <TeX_Engine> -jobname=TEX_TESTING -halt-on-error -interaction=nonstopmode <my_code>
to TeX the one-line code A\bye
. It does not work. Here are the logs:
Plain TeX:
This is TeX, Version 3.14159265 (TeX Live 2017) (preloaded format=tex
2017.5.23) 5 MAY 2019 17:59
**A\bye
! Emergency stop. <to be read again>
\par \bye ->\par
\vfill \supereject \end <*> A\bye
No pages of output.
pdfTeX:
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdftex 2017.5.23) 5 MAY 2019 17:59
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**A\bye
! Emergency stop.
<to be read again>
\par
\bye ->\par
\vfill \supereject \end
<*> A\bye
! ==> Fatal error occurred, no output PDF file produced!
XeTeX:
This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xetex 2017.5.23) 5 MAY 2019 17:59
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**A\bye
! Emergency stop.
<to be read again>
\par
\bye ->\par
\vfill \supereject \end
<*> A\bye
No pages of output.
LuaTeX:
This is LuaTeX, Version 1.0.4 (TeX Live 2017) (format=luatex 2017.5.23) 5 MAY 2019 17:59
restricted system commands enabled.
**A\bye
! Emergency stop.
<to be read again>
\par
\bye ->\par
\vfill \supereject \end
<*> A\bye
! ==> Fatal error occurred, no output PDF file produced!
What happened? In TeXShop things work. Is it because of -halt-on-error
or -interaction=nonstopmode
? I can't get rid of either because I really do not want stopping to happen under any circumstances.
What I need is the simplest valid TeX/XeTeX/LuaTeX code containing a certain string (here it is A
). That's it.
Best Answer
From the TeXbook page 23
Since you want to use TeX interactively rather than processing a file, you have to let TeX know by saying
\relax
. The error you see comes from the fact that TeX tries to readA\bye
as a file name, which involves full expansion of\bye
which is defined aswhich immediately chokes on
\par
because that is obviously not a legal part of a file name.So if instead
A\bye
you say\relax A\bye
it works as expected:You can also type only
\relax
at the**
prompt and then supply your commands at the*
prompt.