1

Is there any easy way to insert some text at a given page number? I could manually trace the page and write something there, but looking for a geeky solution. I am not worried about the position of the text, just accessing the page would work.

\documentclass{article}
\usepackage{lipsum}


\begin{document}
\lipsum[1-50]

%%%%%%%% Write `Some garbage text` at page 3
\end{document}
2
  • 1
    Do you want it written within the text block, in the header/footer, or outside the text block?
    – Werner
    Nov 28, 2020 at 4:41
  • Your solution is fine for me at the moment. Would appreciate, however, if you could describe the individual cases that you mentioned.
    – hola
    Nov 28, 2020 at 6:50

1 Answer 1

2

If you just want to place some text at some random location on page 3, here's an option using eso-pic:

enter image description here

\documentclass{article}

\usepackage{lipsum}
\usepackage{eso-pic}

\AddToShipoutPictureFG{% Place something in the page ForeGround...
  \AtTextUpperLeft{% ...at the text block upper left corner...
    \ifnum\value{page}=3 % ...only on page 3...
      \makebox[\textwidth]{% ...in the horizontal centre of the text block...
        \raisebox{\dimexpr-.5\height-.5\textheight}{% ...at the vertical centre of the text block
          \Huge RaNDoM TeXT
        }%
      }%
    \fi
  }%
}

\begin{document}

\sloppy\lipsum[1-50]

\end{document}

You must log in to answer this question.

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