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.


1 Answer 1


You can use


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

You must log in to answer this question.

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