TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got confused with whether or not I have to use \the.

  1. \the in \special{papersize=\the\paperwidth,\the\paperheight} is mandatory.
  2. But \the in neither \begin{pspicture}(\the\paperwidth,\the\paperheight) nor \psframe[linecolor=red](\the\paperwidth,\the\paperheight) is mandatory.


% it works

% it does not work

% it works
% it also works

What is the rule whether or not I have to use \the?

share|improve this question
A related question: What is the proper method of accessing a counter? – Peter Grill Jul 17 '11 at 21:24
up vote 14 down vote accepted

The TeX primitive \the returns the value of a length, counter or other register as text. You need to use it where you want to output strings, e.g. to external files (like the DVI in the case of \special) or to display it as part of the document.

For document internal macros which await a length or number expression you don't need to use \the but can use a length or counter register directly.

share|improve this answer

\the is used to convert TeX registers into their value, so for example \the\paperwidth expands to the paper width (in pt). Where TeX expects a dimension, it is possible to omit the \the. Thus for example in \begin{pspicture}(\the\paperwidth,\the\paperheight) the underlying code will be setting a dimen, which therefore expects a dimen value and therefore can use \paperwidth without the \the. In general, using \the is safe whether or not it is needed, so there is no problem with including it where it is not absolute required.

(The same approach applies to other register types, for example \count registers.)

share|improve this answer

Your Answer


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.