# Latex \tracing commands list?

Often I need to recall the different \tracing commands; and a couple of times I stumbled on some webpages that worked fine for me; sadly, I didn't keep them, and my searches don't take me there anymore.

So I thought I'd ask about links to where one can read a list of \tracing commands?

For instance, TRALICS : a LaTeX to XML translator (T) mentions:

\tracingall
\tracingassigns
\tracingcommands
\tracinggroups
\tracingifs
\tracinglostchars
\tracingmacros
\tracingnesting
\tracingonline
\tracingoutput
\tracingpages
\tracingparagraphs
\tracingrestores
\tracingstats
\tracingscantokens


.. but, I'm pretty sure there was something like \tracingboxes (and not so sure if there was something like \tracingglues); yet I cannot find any resources mentioning those.

• The TeXbook, Tex for the Impatient and the e-TeX package documentation can be valuable resources for the \tracing... family. – Gonzalo Medina Jun 20 '12 at 2:30
• Thanks for those links, @GonzaloMedina - they look really good! But I was hoping more for a quick, compehensive webpage list (possibly with notes about where the commands come from, e.g. "tracingall" from Latex, "traceon" from trace package, etc..) Thanks again - cheers! – sdaau Jun 20 '12 at 2:38
• I wish there was a \tracingglues! – LarsH Aug 7 '13 at 15:35

Scanning the TeX Book and the TeX program provide the most detail with regards to the \tracing... commands. Also a list is provided online in the TeX Primitive Control Sequences. The combined list includes:

• \tracingcommands [pi] if positive, writes commands to the .log file.
• \tracinglostchars [pi] if positive, writes characters not in the current font to the .log file.
• \tracingmacros [pi] if positive, writes to the .log file when expanding macros and arguments.
• \tracingonline [pi] if positive, writes diagnostic output to the terminal as well as to the .log file.
• \tracingoutput [pi] if positive, writes contents of shipped out boxes to the .log file.
• \tracingpages [pi] if positive, writes the page-cost calculations to the .log file.
• \tracingparagraphs [pi] if positive, writes a summary of the line-breaking calculations to the .log file.
• \tracingrestores [pi] if positive, writes save-stack details to the .log file.
• \tracingstats [pi] if positive, writes memory usage statistics to the .log file.
• \tracingall turns on every possible mode of interaction

Those marked with [pi] take a parameter argument in the form of an integer. For example, one would use \tracingcommands1.

e-TeX introduces a number of new features in the form of:

• \tracingassigns [pi] When the program is compiled with the code for collecting statistics and \tracingassigns has a value of 1 or more, all assignments subject to TEX's grouping mechanism are traced.
• \tracinggroups [pi] a further aid to debugging runaway-group problems, \tracinggroups (an internal read/write integer) causes e-TeX to trace entry and exit to every group while set to a positive non-zero value.
• \tracingifs [pi] When \tracingifs has a value of 1 or more, all conditionals (including \unless, \or, \else, and \fi) are traced, together with the starting line and nesting level; the \showifs command displays the state of all currently active conditionals.
• \tracingscantokens [pi] an internal read/write integer, assigning it a positive non-zero value will cause an open-parenthesis and space to be displayed whenever \scantokens is invoked; the matching close-parenthesis will be recorded when the scan is complete. If a traceback occurs during the expansion of \scantokens, the first displayed line number will reflect the logical line number of the pseudo-file created from the parameter to \scantokens; thus enabling \tracingscantokens can assist in identifying why an seemingly irrational line number is shewn as the source of error (the traceback always continues until the line number of the actual source file is displayed).

These additions are explained in the e-TeX system documentation.

TeX for the Impatient defines \tracingboxes:

\def\tracingboxes{\showboxbreadth = \maxdimen
\showboxdepth = \maxdimen}%

• \tracingboxes causes boxes to be displayed completely when they're traced. (TeX normally shows only three levels of boxing and ﬁve items within each box.)

The xcolor package adds \tracingcolors (from the documentation, section 2.13 Color Information, p 28-29):

• \tracingcolors=<int> controls the amount of information that is written into the .log file:
• <int> ≤ 0: no specific colour logging.
• <int> ≥ 1: ignored colour definitions due to \providecolor are logged.
• <int> ≥ 2: multiple (i.e. overwritten) colour definitions are logged.
• <int> ≥ 3: every command that defines a colour will be logged.
• <int> ≥ 4: every command that sets a colour will be logged.

The etoolbox package adds \tracingpatches (from the documentation, section 3.4 Patching, p 11-12):

Also note that the commands in this section will not automatically issue any error messages if patching fails. Instead, they take a <failure> argument which should provide suitable fallback code or an error message. Issuing \tracingpatches in the preamble will cause the commands to write debugging information to the transcript file.

[...]

\tracingpatches

Enables tracing for all patching commands, including \ifpatchable. The debugging information will be written to the transcript file. This is useful if the reason why a patch is not applied or \ifpatchable yields <false> is not obvious. This command must be issued in the preamble.

Analogously, regexpatch supplies \tracingxpatches.

multicol defines the counter tracingmulticols that can be modified using \setcounter{tracingmulticols}{<number>}. From the multicol documentation (section 2.7 Tracing the output, p 5):

To understand the reasoning behind the decisions TeX makes when processing a multicols environment, a tracing mechanism is provided. If you set the counter tracingmulticols to a positive <number> you then will get some tracing information on the terminal and in the transcript file:

<number> = 1. TeX will now tell you, whenever it enters or leaves a multicols environment, the number of columns it is working on and its decision about starting a new page before or after the environment.

<number> = 2. In this case you also get information from the balancing routine: the heights tried for the left and right-most columns, information about shrinking if the \raggedcolumns declaration is in force and the value of the unbalance counter if positive.

<number> = 3. Setting <number> to this value will additionally trace the mark handling algorithm. It will show what marks are found, what marks are considered, etc. To fully understand this information you will probably have to read carefully trough the implementation.

<number> >= 4. Setting <number> to such a high value will additionally place an \hrule into your output, separating the part of text which had already been considered on the previous page from the rest. Clearly this setting should not be used for the final output. It will also activate even more debugging code for mark handling.

tabularx provides \tracingtabularx (section 4.1 Terminal output, p 2, of the tabularx documentation):

If this declaration is made, say in the document preamble, then all following tabularx environments will print information about column widths as they repeatedly reset the tables to find the correct widths.

As an alternative to using the \tracingtabularx declaration, either of the options infoshow or debugshow may be given, either in the \usepackage command that loads tabularx, or as a global option in the \documentclass command.

For years the file ltoutput.dtx contained some hidden code to trace the detailed behaviour of the float placement algorithm of LaTeX. Prompted by questions on StackExchange we now extract this code into a new fltrace package. To see the float algorithm in action (or to understand why it decides to place all your floats at the very end of the document) use

\usepackage{fltrace} \tracefloats


To stop tracing somewhere in the document use \tracefloatsoff and to see the current value of various float parameters use \tracefloatvals. As the package is identical to the kernel code with tracing added, it may or may not work if you load any other package that manipulates that part of the kernel code. In such a case your best bet is to load fltrace first.

The tracefnt package provides for tracing the actions concerned with loading, substituting and using fonts. The package accepts the following options:

• errorshow

Write all information about font changes, etc. but only to the transcript file unless an error occurs. This means that information about font substitution will not be shown on the terminal.

• warningshow

Show all font warnings on the terminal. This setting corresponds to the default behaviour when this tracefnt package is not used!

• infoshow

Show all font warnings and all font info messages (that are normally only written to the transcript file) also on the terminal. This is the default when this tracefnt package is loaded.

• debugshow

In addition to what is shown by infoshow, show also changes of math fonts (as far as possible): beware, this option can produce a large amount of output.

• loading

Show the names of external font files when they are loaded. This option shows only 'newly loaded' fonts, not those already preloaded in the format or the class file before this tracefnt package becomes active.

• pausing

Turn all font warnings into errors so that LaTeX will stop.

Warning: The actions of this package can change the layout of a document and even, in rare cases, produce clearly wrong output, so it should not be used in the final formatting of 'real documents'.

\pdftracingfonts (pdfTeX):

An integer variable controlling the tracing of font expansion. It is zero by default; then we get a log (with fontexpansion) like this

...\tenrm t

...\tenrm (+20) e

Without font expansion, this default should be compatible with TeX's original log output. If \pdftracingfonts is set to 1 (or greater), we get a more verbose log:

...\xivtt (cmtt10@14.0pt) t

...\xivtt (cmtt10+20@14.0pt) e

\XeTeXtracingfonts (XeTeX):
• You can add \tracingboxes; a description can be found in TeX for the Impatient. – Gonzalo Medina Jun 20 '12 at 3:02
• And there is also \XeTeXtracingfonts=1. – Stephen Oct 4 '12 at 8:48
• ... and \pdftracingfonts. – Robert Feb 8 '13 at 5:58
• Not yet in this list: LaTeX's \showoutput, which shows pages being shipped out: it activates \tracingonline (log diagnostic to terminal),\tracingoutput (dump shipped out boxes), \tracingboxes (show full box contents when dumping them), and \errorstopmode (ask for input on errors). – Blaisorblade Sep 24 '17 at 0:47