I'm trying to understand the meaning of \p@
from plain.tex:
\newdimen\p@ \p@=1pt % this saves macro space and time
While trying to figure it out, I stumbled upon strange behavior.
Consider this:
\newdimen\mydimen
\catcode`@=11
\mydimen=10\p@
\showthe\mydimen
The result is 10.0pt
Now add \nonstopmode
and \showthe\nointerlineskip
at the beginning, so that it becomes:
\nonstopmode
\showthe\nointerlineskip
\newdimen\mydimen
\catcode`@=11
\mydimen=10\p@
\showthe\mydimen
The result is 0.0pt
Following is the log of the second example with \tracingcommands=1
appended.
{vertical mode: \nonstopmode}
{\showthe}
> -1000.0pt.
\nointerlineskip ->\prevdepth
-1000\p@
l.4 \showthe\nointerlineskip
{the character -}
{horizontal mode: the character -}
{\dimen11}
! Missing number, treated as zero.
<to be read again>
\global
\alloc@ #1#2#3#4#5->\global
\advance \count 1#1by\@ne \ch@ck #1#4#2\allocati...
l.5 \newdimen\mydimen
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\global
\alloc@ #1#2#3#4#5->\global
\advance \count 1#1by\@ne \ch@ck #1#4#2\allocati...
l.5 \newdimen\mydimen
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
{\global}
{\count21}
{\global}
{\immediate}
\mydimen=\dimen16
{\catcode}
{\dimen16}
{\showthe}
> 0.0pt.
l.8 \showthe\mydimen
{\par}
{vertical mode: \par}
)
! Emergency stop.
The questions are: 1) how \p@
works; 2) why the value of \mydimen is 0.0pt
in the second case; 3) how to interpret the log.