4

In the excellent answer by egreg to the question How Does Latex Know the Page Number of a Reference he said that

[t]his is not completely foolproof and there are examples around of cleverly written documents that never stabilize: each new run of LaTeX will change the page number associated to a label so it never remains the same. However, the chances that this happens in a real document are pretty small.

Does anyone happen to have such an example of source code?

I see how this works and I thought about this several times, but I was not able to simply create a document where this happens.

0

Here is an (not real document) example

\documentclass{article} 
\begin{document}
bla\label{yes}
\ifnum\value{page}=1
\makeatletter
\write\@auxout{\string\refstepcounter{page}}
\makeatother\fi
bla bla\pageref{yes}
\end{document}
| improve this answer | |

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