summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-nopageno.html
blob: 059b0abdf144dca6eeee0cfea5400fc812efed12 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<head>
<title>UK TeX FAQ -- question label nopageno</title>
</head><body>
<h3>How to get rid of page numbers</h3>
<p/><p/>Very occasionally, one wants a document with no page numbers.  For
such occasions, the package <i>nopageno</i> will make
<code>\</code><code>pagestyle{plain}</code> have the same effect as
<code>\</code><code>pagestyle{empty}</code>; in simple documents, this will suppress
all page numbering (it will not work, of course, if the document uses
some other pagestyle than <code>plain</code>).
<p/>To suppress page numbers from a sequence of pages, you may use
<code>\</code><code>pagestyle{empty}</code> at the start of the sequence, and restore
the original page style at the end.  Unfortunately, you still have to
deal with the page numbers on pages containing a <code>\</code><code>maketitle</code>,
<code>\</code><code>part</code> or <code>\</code><code>chapter</code> command, since the standard classes; deal
with those separately, as described below.
<p/>To suppress page numbers on a single page, use
<code>\</code><code>thispagestyle{empty}</code> somewhere within the text of the
page.  Note that, in the standard classes, <code>\</code><code>maketitle</code> and
<code>\</code><code>chapter</code> use <code>\</code><code>thispagestyle</code> internally, so your call
must be <em>after</em> those commands.
<p/>Unfortunately, <code>\</code><code>thispagestyle</code> doesn&#8217;t work for <i>book</i> or
<i>report</i> <code>\</code><code>part</code> commands: they set the page style (as do
<code>\</code><code>chapter</code> commands), but then they advance to the next page so
that you have no opportunity to change the style using
<code>\</code><code>thispagestyle</code>.  The present author has proposed solving the
problem with the following &#8220;grubby little patch&#8221;, on
<i>comp.text.tex</i>:
<blockquote>
<pre>
\makeatletter
\let\sv@endpart\@endpart
\def\@endpart{\thispagestyle{empty}\sv@endpart}
\makeatother
</pre>
</blockquote><p>
<p/>Both the <i>KOMA-script</i> classes and <i>memoir</i> have separate
page styles for the styles of various &#8220;special&#8221; pages, so, in a
<i>KOMA</i> class document one might say:
<blockquote>
<pre>
\renewcommand*{\titlepagestyle}{empty}
</pre>
</blockquote><p>
while <i>memoir</i> will do the job with
<blockquote>
  <code>\</code><code>aliaspagestyle{title}{empty}</code>
</blockquote><p>
<p/>An alternative (in all classes) is to use the rather delightful
<code>\</code><code>pagenumbering{gobble}</code>; this has the simple effect that any
attempt to print a page number produces nothing, so there&#8217;s no issue
about preventing any part of LaTeX from printing the number.
However, the <code>\</code><code>pagenumbering</code> command does have the side effect that
it resets the page number (to 1), so it is unlikely to be helpful
other than at the beginning of a document.
<p/>The <i>scrpage2</i> package separates out the representation of the
page number (it typesets the number using the <code>\</code><code>pagemark</code> command) from
the construction of the page header and footer; so one can say
<blockquote>
<pre>
\renewcommand*{\pagemark}{}
</pre>
</blockquote><p>
which will also suppress the printing of the page number.
<p/>Neither of these &#8220;suppress the page number&#8221; techniques touches the
page style in use; in practice this means they don&#8217;t make sense unless
you are using <code>\</code><code>pagestyle{plain}</code>
<dl>
<dt><tt><i>fancyhdr.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/fancyhdr.zip">macros/latex/contrib/fancyhdr</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/fancyhdr/">browse the directory</a>)
<dt><tt><i>KOMA script bundle</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/koma-script.zip">macros/latex/contrib/koma-script</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/koma-script/">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>nopageno.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/carlisle/nopageno.sty">macros/latex/contrib/carlisle/nopageno.sty</a>
<dt><tt><i>scrpage2.sty</i></tt><dd>Distributed as part of <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/koma-script.zip">macros/latex/contrib/koma-script</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/koma-script/">browse the directory</a>)
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=nopageno">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=nopageno</a>
</body>