Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
3  
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
1  
I wish there was a \tracingglues! –  LarsH Aug 7 '13 at 15:35
add comment

1 Answer 1

up vote 25 down vote accepted

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 five 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.

share|improve this answer
    
Many thanks for that list, @Werner! So all of these are tex built-ins, no e-tex (or etex) commands among them? (note to self: cseq.html is quite a large page, and may take a bit to load). –  sdaau Jun 20 '12 at 2:44
1  
@sdaau: As far as I can tell, yes. I'll add some more about e-TeX. –  Werner Jun 20 '12 at 2:47
1  
You can add \tracingboxes; a description can be found in TeX for the Impatient. –  Gonzalo Medina Jun 20 '12 at 3:02
1  
And there is also \XeTeXtracingfonts=1. –  Stephen Oct 4 '12 at 8:48
1  
... and \pdftracingfonts. –  Robert Feb 8 '13 at 5:58
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.