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?


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.


\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.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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