8

I'm happy with Plain TeX's page-numbering format, except that I want to turn it off for the first few pages of my book. I can do this with the \nopagenumbers macro, but is there a macro with the opposite effect, to make the page numbers reappear later? Or do I have to manually re-establish the default footer?

1 Answer 1

6

A quick look at \nopagenumbers shows

> \nopagenumbers=macro:
->\footline {\hfil }.

while \showthe\footline yields

> \hss \tenrm \folio \hss .

Thus the simplest solution is by hand

\def\pagenumbers{\footline{\hss\tenrm\folio\hss}}

You could of course save the existing definition using something like

\newtoks\savedfootline
\savedfootline\expandafter{\the\footline}

and restore with

\footline\expandafter{\the\savedfootline}

or use a group within your document: \begingroup before \nopagenumbers and \endgroup after.

Note that whatever approach you use, make sure you force a new page, for example

\begingroup
  \nopagenumbers
  <content>
  \vfil
  \eject
\endgroup
2
  • Why toks and not let?
    – yannisl
    Oct 18, 2013 at 6:04
  • @YiannisLazarides You can't \let here as that will still point to the same toks, not the content of the toks (same for all registers). I could save the content in a macro in this case, but in general you can't be sure of that so best practice is to save toks in toks, not macros.
    – Joseph Wright
    Oct 18, 2013 at 6:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .