I want to add one of two different texts, depending on whether it appears on the last page.
I tried this:
\documentclass{article}
\usepackage[angle=0, opacity=1, scale=1,position={0,0}]{background}
\usepackage{lastpage}
\setlength{\parskip}{6cm}
\begin{document}
\SetBgContents{
\ifnum\thepage=\pageref{LastPage} This is the last page\else More pages follow\fi
}
A lot of paragraphs
A lot of paragraphs
A lot of paragraphs
A lot of paragraphs
A lot of paragraphs
A lot of paragraphs
\end{document}
But this fails when the .aux file is not yet created with:
! Missing number, treated as zero. <to be read again> \protect l.22 A lot of paragraphs
I think because then \pageref{LastPage} is ?? which I cannot compare using \ifnum.
How can I make this work?
\lipsum[10](untested) or\lipsum[1-10]– May 23 '19 at 15:04