summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-howmanypp.html
blob: 90c263565be2ce38598dd6954239c5779f90c1df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<head>
<title>UK TeX FAQ -- question label howmanypp</title>
</head><body>
<h3>How many pages are there in my document?</h3>
<p/>Simple documents (those that start at page 1, and don&rsquo;t have any
breaks in their page numbering until their last page) present no
problem to the seeker after this truth.  The number of pages is
reported by the <i>lastpage</i> package in its <code>LastPage</code> label.
<p/>For more complicated documents (most obviously, books with frontmatter
in a different series of page numbers) this simple approach will not
do.
<p/>The <i>count1to</i> package defines a label <code>TotalPages</code>; this is
the value of its copy of <code>\</code><code>count1</code> (a reserved TeX count
register) at the end of the document.
<p/>Package <i>totpages</i> defines a label <code>TotPages</code>, but it also
makes the register it uses available as a LaTeX counter,
<code>TotPages</code>, which you can also reference via <code>\</code><code>theTotPages</code>.  Of
course, the counter <code>TotPages</code> is asynchronous in the same way that
page numbers are, but snapshots may safely be taken in the output
routine.
<p/>The <i>memoir</i> class defines two counters <code>lastpage</code> and
<code>lastsheet</code>, which are set (after the first run of a document)
to the equivalent of the <code>LastPage</code> label and the
<code>TotalPages</code> labels.
<p/>Both <i>count1to</i> and <i>totpages</i> need the support of
the <i>everyshi</i> package.
<dl>
<dt><tt><i>count1to.sty and everyshi.sty</i></tt><dd>
  Distributed in <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ms.zip">macros/latex/contrib/ms</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ms/">browse the directory</a>)
<dt><tt><i>lastpage.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/lastpage.zip">macros/latex/contrib/lastpage</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/lastpage/">browse the directory</a>)
<dt><tt><i>memoir.cls</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/memoir.zip">macros/latex/contrib/memoir</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/memoir/">browse the directory</a>)
<dt><tt><i>totpages.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/totpages.zip">macros/latex/contrib/totpages</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/totpages/">browse the directory</a>)
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=howmanypp">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=howmanypp</a>
</body>