[OS X TeX] Problems customizing report.cls
Herb Schulz
herbs at wideopenwest.com
Sat Apr 16 03:15:27 CEST 2005
On 4/15/05 7:55 PM, "Ross Moore" <ross at ics.mq.edu.au> wrote:
> 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
>
Howdy,
Thanks for the information. I'm used to thinking in terms of pointers and
pointers to pointers, etc., from my old days doing C at a Telecommunications
Firm.
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>
More information about the macostex-archives
mailing list