Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Page numbering

1 view
Skip to first unread message

Giacomo

unread,
Nov 5, 2005, 7:18:36 AM11/5/05
to
I'm numbering the pages of a document using the following code:
**********
\newcount\TotalPages
\TotalPages=\z@

% To know the number of pages (we write it in the .aux file)
\def\NumberLastPage{9999} % Initialization

\AtEndDocument{%
\immediate\write\@auxout{%
\string\gdef\string\NumberLastPage{\the\TotalPages}}}

\fancyput(17.5cm,2.5cm){%
\psframe[linestyle=none,fillstyle=solid,fillcolor=yellow](-1,-\paperheight)
\rput(-0.5,-\pst@dimh){%
\pscirclebox[fillstyle=solid,fillcolor=black]{%
\textcolor{white}{\textbf{\thepage}}}}}

\let\@outputpageORIG\@outputpage

\def\@outputpage{%
\global\advance\TotalPages\@ne
\pst@cnth=\NumberLastPage
\advance\pst@cnth\@ne
\pst@dimh=\paperheight
\divide\pst@dimh\pst@cnth
\pst@dimg=\pst@dimh
\divide\pst@dimg\tw@
\pst@cntg=\thepage
\advance\pst@cntg\m@ne
\multiply\pst@dimh\pst@cntg
\advance\pst@dimh\pst@dimg
\@outputpageORIG}
**********

How can I make the enumeration start from a page different from the
first one? (in particular, the third one)

Where can I find a manual about the syntax used in that code?

Thanks,
Giacomo.

Robin Fairbairns

unread,
Nov 6, 2005, 4:16:10 AM11/6/05
to
Giacomo <a...@b.cde> writes:
>I'm numbering the pages of a document using the following code:
>**********
>\newcount\TotalPages
>\TotalPages=\z@
>
>% To know the number of pages (we write it in the .aux file)
>\def\NumberLastPage{9999} % Initialization
>
>\AtEndDocument{%
>\immediate\write\@auxout{%
> \string\gdef\string\NumberLastPage{\the\TotalPages}}}

this will typically be wrong :-(

>\fancyput(17.5cm,2.5cm){%
>\psframe[linestyle=none,fillstyle=solid,fillcolor=yellow](-1,-\paperheight)
>\rput(-0.5,-\pst@dimh){%
> \pscirclebox[fillstyle=solid,fillcolor=black]{%
> \textcolor{white}{\textbf{\thepage}}}}}

i'm afraid i don't understand where this happens.

>\let\@outputpageORIG\@outputpage
>
>\def\@outputpage{%
>\global\advance\TotalPages\@ne

here, you're counting the pages.

>\pst@cnth=\NumberLastPage
>\advance\pst@cnth\@ne

this is correcting one of the errors in the setting of
\numberlastpage, that i mentioned above, i suppose.

>\pst@dimh=\paperheight
>\divide\pst@dimh\pst@cnth
>\pst@dimg=\pst@dimh
>\divide\pst@dimg\tw@
>\pst@cntg=\thepage
>\advance\pst@cntg\m@ne
>\multiply\pst@dimh\pst@cntg
>\advance\pst@dimh\pst@dimg

this is calculating a value for use in the \fancyput, above,

>\@outputpageORIG}
>**********
>
>How can I make the enumeration start from a page different from the
>first one? (in particular, the third one)

without understanding how \fancyput is called, it's not easy to say.

>Where can I find a manual about the syntax used in that code?

from the texbook, or equivalent. look in the faq about books/
tutorials (on-line books are listed in the latter answer).

of course, if the author of your code had read the faq, [s]he'ld have
been pointed to alternative ways of doing this sort of stuff. iirc,
there's a discussion of thumbnails in the fanchdy docs, there's the
lastpage and totpages packages, and so on.
--
Robin (http://www.tex.ac.uk/faq) Fairbairns, Cambridge

0 new messages