Re: page numbering based on sections - is this possible
pasquale Nardone <[email protected]>
| Newsgroups | gmane.comp.tex.tetex.general |
|---|---|
| Message-ID | <p06100501bdc43e8caf1c@[10.0.0.39]> |
>Hello,
>
>Does anybody know of a way to change the way page numbering is formatted?
>
>We would like to produce a document that,
>instead of using sequential page numbering
>(1,2,3,4,.....), numbers the pages based on the
>sections.
>(I.e., for the 6th page of Section 3, we would
>like the page number to be '6-3').
>
>We have a very large document that we like to
>maintain hard copies of, but the document
>changes frequently, and it is not practical to
>reprint the entire document every time it
>changes, so we would like to print changed
>sections only, and not have the entire page
>numbers be messed up throughout the rest of the
>document.
>
>Thanks for any info.
>
>-Duane
In TeX this is very simple
you need to define a counter which specify the section
\newcount\mysection
\mysection=1
then each time you call a routine called say
\Section it will increase the counter
\def\Section#1#2 etc...{some stuff that you want
and add the increment: \global\advance\mysection
by 1}
then say at the beginning:
\nopagenumbers
\footline={\line{\hfill \the\pageno - \the\mysection}
that's it
ps:\pageno is by default a counter which count pages...
--
Prediction is difficult, especially of the future: NEILS BOHR
Pasquale Nardone
Université Libre de Bruxelles
Physique Générale &
Laboratoire de Didactique,
CP 231, Bld du Triomphe, 2
1050 Bruxelles, Belgium
tel: +32.2.6505515
tel secr: +32.2.6505618
fax: +32.2.6505332
web: http://homepages.ulb.ac.be/~pnardon/
ou encore http://physinfo.ulb.ac.be/