# Where to find official (!) and extended documentation for tex/latex's commandline options (especially -interaction modes)?

Today I tried to learn more about the several interaction modes for tex/latex/pdflatex etc. The manpages turned out to be not very helpful:

\$ man tex

...
-interaction mode
Sets  the interaction mode.  The mode can be either batchmode,
nonstopmode, scrollmode, and errorstop‐mode. The meaning of these
modes is the same as that of the corresponding \commands.
...

While Google quickly helped me to learn what I wanted to know, I was suprised that I wasn't able to find useful and official documentation about this topic. After turning the whole documentation of my TeXLive distribution upside down I am asking now, if someone can please point me to the official and detailed documenation (if it exists) concerning the interaction modes and maybe the default values to some of the other commandline options.

Edit because the output of man latex is totally different from waht I pasted here...

-
Could you say what's wrong with the example you give? To me, that or the (for me) more obvious latex --help seems to cover everything pretty well. –  Joseph Wright Jan 13 at 13:58
For example, interaction mode is something that TeX has, which is what the ... same as that of the corresponding ... part is about. So for this I'd expect to read The TeXbook or similar for more info. –  Joseph Wright Jan 13 at 14:01
If you wouldn't know, could you tell how exactly each mode differs from the other from the above given description? Because I could not, at least not without experimenting. –  Niklas Jan 13 at 14:07
@Niklas so you are not really asking for information about the commandline but about the primitive tex commands such as \scrollmode for which the official doc is the TeXBook, or texdoc texbytopic for a free alternative. –  David Carlisle Jan 13 at 14:50
@DavidCarlisle Thanks, that was exactly what I was looking for. –  Niklas Jan 13 at 15:01

The man page points these command line options as being equivalent to using the command forms such as \scrollmode, for which the official doc is the TeXBook, or

texdoc texbytopic

for a free alternative (see chapter 32).

-

# Interaction modes

TeX and the derived programs pdftex, xetex and luatex have four interaction modes:

• batch mode
• nonstop mode
• scroll mode
• errorstop mode

This is in order of increasing user interaction.

1. In batch mode nothing is printed on the terminal, errors are scrolled as if <return> is hit at every error; missing files that TeX tries to input or request from keyboard input (\read on a not open input stream) cause the job to abort.

2. In nonstop mode the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode.

3. In scroll mode, TeX will stop only for missing files to input or if keyboard input is necessary.

4. In errorstop mode, TeX will stop at each error, asking for user intervention.

The four modes can be set in the document using the control sequences

\batchmode \nonstopmode \scrollmode \errorstopmode

wherever one deems this useful. They will change the default interaction mode from the moment TeX will process them; note that interaction mode changes are always global. The default interaction mode is "errorstop", unless declared differently on the command line with the option

tex -interaction=[batchmode|nonstopmode|scrollmode|errorstopmode]

where tex stands for any typesetting engine known to the system (it could be pdflatex, for instance, or xetex or whatever).

Engines with e-TeX extensions (pdftex, xetex and luatex) can access to the current interaction mode by looking at the internal integer register

\interactionmode

that holds the values 0, 1, 2, 3 corresponding respectively to batch, nonstop, scroll or errorstop. One can even change the current interaction mode by saying

\interactionmode=<integer>

thus making it possible to change temporarily the mode and reverting back to the previous one:

\chardef\previousinteractionmode=\interactionmode
\batchmode
<some code where we want not to stop for errors>
\interactionmode=\previousinteractionmode

(for an application see this answer)

# Other useful command line options

• -jobname=string sets the name of the job independently of the file on which the engine is run on

• -halt-on-error stops the run at the first error (independently on the interaction mode)

• -file-line-error changes the format of error messages to show not only the line number, but also the file TeX is currently reading the input from

• -shell-escape enables the possibility of running system commands from within TeX

• -no-shell-escape disables the above

• -draftmode (only pdftex and luatex) produces no PDF output, so it can be useful for syntax checking

There are other options, but are somewhat esoteric or aimed mainly to format building.

-