🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #389

Re: Page numbering by chapter in LaTeX

#389
From: Hellmuth Broda
Date: Tue, 25 Jul 1989 16:15
77 lines
2716 bytes
In article <31495@ccicpg.UUCP> swonk@ccicpg.UUCP (Glen Swonk) writes:
>I would like to write a large document in pieces,
>so that each chapter can be compiled/debugged separately.
>
>What I would like is a page numbering scheme that the page number
>would restart at the beginning of each chapter (like it
>does in some technical manuals).
>
>For example:
>
>	Chapter1: Intro
>		pages 1-1 thru 1-10
>
>	Chapter2: Operation
>		pages 2-1 thru 2-12
>
>	Chapter3: Maintenance
>		pages 3-1 thru 3-33
>
>Of course, I would like to generate a table of contents
>that reflect the page numbering style.
>
>
>Any help is appreciated.
>thanks
>
>-- 
>Glenn L. Swonk		CCI Computers 
>(714)458-7282		9801 Muirlands Boulevard
>			Irvine, CA 92718
>uunet!ccicpg!swonk

We have been using the following approach:


\documentstyle{report}
\title{}
\author{}

\begin{document}
\maketitle
\pagenumbering{Roman}
\tableofcontents
\clearpage
\addcontentsline{toc}{chapter}{\protect\numberline{}{List of tables}}
\listoftables
\clearpage
\typeout{Starting chapter relative page numbering...}%  
\makeatletter%                                        
\def\pagenumbering#1{\global\c@page \@ne%            
   \gdef\thepage{\thechapter -\csname @#1\endcsname \c@page}}% 
\makeatother
\setcounter{page}{1}
\pagenumbering{arabic}%
\chapter{}
\chapter{}
%...
\appendix
\chapter{}
%...
\end{document}

------------
This works with all xrefs, cits etc.  We had to twiggle our local 
makeindex somewhat to have it digest the new page numbers but that
was a job on a few awk scripts.


Hope that helps---Hellmuth Broda

 ___________________________________________________________________________
| Dr.rer.nat. Hellmuth W. Broda |  c/o CIBA-GEIGY Scientific Computing Ctr. |
| Biologist and Systems Analyst |  R-1045.3.16, P.O.Box, Tel:+4161 697-7109 |
| UUCP:...!uunet!mcvax!cernvax!cgch!whbr         CH-4002 Basel, Switzerland |
| Internet:whbr%cgch.uucp@uunet.uu.net; BITNET:whbr%cgch.uucp@cernvax.bitnet|
 ---------------------------------------------------------------------------
                ---The early bird gets caught by the worm---
Technical Details
Message-ID: <849@cgch.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!cs.utexas.edu!uunet!mcvax!cernvax!cgch!whbr
References: <31495@ccicpg.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!cs.utexas.edu!uunet!mcvax!cernvax!cgch!whbr
From: whbr@cgch.UUCP (Hellmuth Broda)
Newsgroups: comp.text
Subject: Re: Page numbering by chapter in LaTeX
Summary: redefine \pagenumbering
Keywords: LaTeX
Message-ID: <849@cgch.UUCP>
Date: 25 Jul 89 16:15:30 GMT
References: <31495@ccicpg.UUCP>
Sender: news@cgch.UUCP
Reply-To: whbr@cgchd6.UUCP (Hellmuth Broda)
Organization: c/o CIBA-GEIGY Ltd, Sci.Comp.Centre, CH-4002 Basel, Switzerland
Lines: 77