28

I have found the source code within octavo.dtx (from the octavo package) and it has some parts called \p@. I have searched throughout the document, but cannot understand what this is defined as or what it does and it is too short a term to do a Web search. Is this specific to the document or common to TeX? Here is a portion of the code:

\if@titlepage

    \newcommand\maketitle{\begin{titlepage}%

    \let\footnotesize\small

    \let\footnoterule\relax

    \let\footnote\thanks

%    \end{macrocode}

%    The title itself is centered vertically, with a little offset brought by

%    a |\vskip|.

%    \begin{macrocode}

    \null\vfil

    \vskip 60\p@

%    \end{macrocode}
  • What does the \p@ do?
31

This is abbreviated notation for a 1pt dimension, as included in latex.ltx and therefore common to all LaTeX documents:

\newdimen\p@ \p@=1pt % this saves macro space and time
\newdimen\z@ \z@=0pt % can be used both for 0pt and 0

As such, you can use it in calculation with dimensions, such that 60\p@ translates to 60 times 1pt, or 60pt. In a similar fashion, \z@ provides a 0pt dimension.

Using

\makeatletter
\show\p@
\makeatother

yields

\p@=\dimen11

indicating that it is a TeX dimension (number 11). Consequently, issuing \showthe\p@ yields 1.0pt in your .log.

  • 16
    Perhaps it should be added that these shorthands are from the days when space and speed was much more limited than it is today and using them gives some tiny advantage in both dimensions. However, these days I would recomment for newly designed class files to use explicit dimensions for better readability. – Frank Mittelbach Dec 18 '11 at 8:37
  • 2
    @FrankMittelbach: Welcome to TeX.SX, Frank! What took you so long? :) Yes, it shows the longevity of the code. – Werner Dec 18 '11 at 15:23
  • simply the fact that my day has only 24 hours and no posting ever told me how to double it - if you know the answer to THAT then ... – Frank Mittelbach Dec 18 '11 at 18:31
  • What would be the effects of using \p@=1bp (or even something crazy like \p@=2bp)? – svenper Feb 2 at 17:07
  • @svenper: You can search for \p@ in the LaTeX kernel to see all the macros using it. It varies from footnotes, to certain math constructions, the ToC dotted lines, float separations from the text and other floats... it's scattered throughout, so it'll have visible affects. – Werner Feb 2 at 19:39

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.