[Tex/LaTex] commands in interaction mode

macrostex-core

Q: Which commands can I supply back to LaTeX when it pauses on a line of code during compilation and is waiting for me to give it more information before proceeding?

E.g., in the post How do I use \show? (to which this question is a follow-up) I found that with \show\section in my code the LaTeX compilation would pause and I would get useful information about \section printed to the terminal. I could supply X back to the terminal and have the program exit (printing that useful information already mentioned to a .log file).

Q: So, what other commands could I supply at this point?

I'm having trouble finding information on the web regarding this. The post Different LaTeX interaction modes mentions that q will get LaTeX to proceed in a different, "quiet" mode. Running this, I see that something different is happening in the log-file. However (as with X) no .pdf is created.

Q: Is there a command I can supply that would sort of ignore the \show\section command in my .tex file and produce a .pdf?

Best Answer

So, what other commands could I supply at this point?

At the prompt you can enter a question mark to see the possible commands:

/tmp $ tex
This is TeX, Version 3.1415926 (TeX Live 2010)
**\show\x
> \x=undefined.
<*> \show\x

? ?
Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something, 
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.
? 

Is there a command I can supply that would sort of ignore the \show\section command in my .tex file and produce a .pdf?

Press return, then the compilation proceeds. However, \show is always treated as an error:

/tmp $ tex
This is TeX, Version 3.1415926 (TeX Live 2010)
**\show\x
> \x=undefined.
<*> \show\x

? 

*\null

*\bye
[1]
Output written on texput.dvi (1 page, 196 bytes).
Transcript written on texput.log.
/tmp $ echo $?
1

So you should use \show only for debugging purposes, not for normal compilation runs. If you want to print the meaning of a control sequence without giving an error, use \immediate\write16{\meaning\foo} (in LaTeX, \typeout is equivalent to \immediate\write16).