6

I know that TeX does not update the page number until it can decide where to break a page. And when I write

\number\count0

\number\count0

\number\count0
% ...

to fill two pages, the second page of the output begins with

1
1
2
2
2
...

Therefore, if something appears on the top of a page, then I can't get the correct page number for it. In LaTeX we have \label and \pageref as a workaround. But is there a way to do this in plain TeX?

2 Answers 2

6

Yes of course you could implement the same system latex uses, with a two-pass writing to the aux file. You could define some macros just to do this or more simply

\input eplain

and use the eplain macros which provide various cross referencing features in a more plain style than the latex macros.

3

Yes of course you could implement the same system latex uses, with a two-pass writing to the auxiliary file. You could define some macros just to do this or more simply

\input opmac

and use the opmac macros \ref and \pgref which provide various cross referencing features in a more plain style than the latex macros.

1
  • This was cheap :(
    – morbusg
    Commented Jun 29, 2017 at 21:18

You must log in to answer this question.

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