Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What was the control sequence to get the current page in plain TeX? I thought it was \thepage, and this works in LaTeX, but it returns a undefined-control-sequence error in plain TeX.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You can use

\number\pageno

Third dangerous bend sign on page 252 of the TeXbook:

The page number appears in TeX’s internal register \count0, as explained in Chapter 15, and plain TeX makes \pageno an abbreviation for \count0. Thus you can say \pageno=100 if you want the next page of your output to be number 100. The \folio macro converts negative page numbers to roman numerals; if your manuscript begins with \pageno=-1, the pages will be numbered i, ii, iii, iv, v, etc. In fact, Appendix B defines \folio to be an abbreviation for \ifnum\pageno<0 \romannumeral-\pageno \else\number\pageno \fi

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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