7

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?

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
|improve this answer|||||
  • Why toks and not let? – Yiannis Lazarides Oct 18 '13 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 '13 at 6:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.