[OS X TeX] Problems customizing report.cls

Ross Moore ross at ics.mq.edu.au
Sat Apr 16 02:55:02 CEST 2005


Hi Herb,

On 16/04/2005, at 2:44 AM, Herb Schulz wrote:

> Howdy,
>
> \p@ is a shorthand for a length of 1pt (i.e., it is a single token 
> rather
> than 3 tokens).

Yes; the number of tokens to be handled is one aspect of the
increased efficiency.

Another is that \p@ (or any control-sequence, for that matter)
is a token for what is known as a 'pointer' in other computing
paradigms. Thus processing the \p@ is just a matter of looking
up its value in some internal table. This will get you quickly
to the appropriate bit of memory where the value was pre-stored.

With  '1pt'  it's necessary to do more work, first parsing the
tokens to check that they match the specifications for a <dimen>,
and then allocating some memory to hold this newly-declared length.

Thus it's clearly better to use an existing pointer (such as \p@ )
to refer to a constant quantity, when one already exists globally.



> Similarly, \z@ is shorthand for 0pt.

Also, \@ne , \tw@  etc, for numbers 1, 2, ...

Here there's just one token, but the memory-management
aspects still could lead to a small increase in performance,
if used repeatedly, say within looping constructions.


Hope this helps,

	Ross



>
> Good Luck,
>
> Herb Schulz
> (herbs at wideopenwest.com)
>
> --------------------- Info ---------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>            & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>
>
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list