[Tex/LaTex] What are the default values in LaTeX commands or variables

latex-basetex-core

How can I know what is the default value for line spacing in LaTeX (for example what is the default value of \baselinestretch command before renewcommanding it?) and how I can print this value in the PDF file?

I used \the\textheight‎‎ to show the default value of text height in the output file.

I just tested these two commands in this simple example (in a report class and the font size is default):

\documentclass{‎‏‎report‎}‎‎‎

\begin{document}
\the\textheight‎‎
\end{document}

and I get 550.0pt in output.

Is there something like this to know and print all default values of all pre-defined variables in a LaTeX output? (in a report class with a default font size for instance)

Best Answer

LaTeX allocates

  • 56 \count registers
  • 92 \dimen registers
  • 31 \skip registers
  • 16 \box registers
  • 4 \toks registers

Running a document with the report class allocates another

  • 9 \count registers
  • 1 \dimen register
  • 2 \skip registers

Several of these parameters are for internal usage. If we exclude parameters with @ in their name, we get

\count registers

\interfootnotelinepenalty
\interdisplaylinepenalty

\dimen registers

\maxdimen
\normallineskiplimit
\jot
\leftmargin
\rightmargin
\listparindent
\itemindent
\labelwidth
\labelsep
\linewidth
\leftmargini
\leftmarginii
\leftmarginiii
\leftmarginiv
\leftmarginv
\leftmarginvi
\fboxrule
\fboxsep
\tabbingsep
\arraycolsep
\tabcolsep
\arrayrulewidth
\doublerulesep
\unitlength
\footnotesep
\topmargin
\oddsidemargin
\evensidemargin
\headheight
\headsep
\footskip
\textheight
\textwidth
\columnwidth
\columnsep
\columnseprule
\marginparwidth
\marginparsep
\marginparpush
\paperheight
\paperwidth

\skip registers

\hideskip
\normalbaselineskip
\normallineskip
\smallskipamount
\medskipamount
\bigskipamount
\fill
\topsep
\partopsep
\itemsep
\parsep
\floatsep
\textfloatsep
\intextsep
\dblfloatsep
\dbltextfloatsep

The report class adds

  • \bibindent (a \dimen)
  • \abovecaptionskip (a \skip)
  • \belowcaptionskip (a \skip)

Packages will add many more.

There are also all the internal parameters of TeX that will have a default value (see List of TeX internal parameters? for a partial list, but you should consult the big manuals, either the TeXbook or TeX by topic).

All these (with the exception of box registers) can be looked at with \the.

There are also “pseudovariables”, that is, parameterless macros which hold a value. Among them

\baselinestretch
\arraystretch

and some more. These can be looked at with \meaning.