1

How can I suppress the links to the last page on each page? Consider the following example:

\documentclass[colorlinks]{moderncv}
\usepackage{lipsum}
\name{}{}

\begin{document} \lipsum \end{document}

Here we have the page numbering 1/2 and 2/2, but the last 2 is marked red because it is a link. How can I suppress the behavior so that I have 1/2 and 2/2 only?

Thrash
  • 653

1 Answers1

0

You can simply add something like

\fancyfoot[r]{\color{color2}\pagenumberfont\strut\thepage/\pageref*{lastpage}}

after your \begin{document} line. The * after the \pageref will only print the page number, without a link.

  • Thanks, but there is a problem with documents that consist of a single page. In this case the output is 1/1, but I want the original behavior, i.e. no display of the page number. – Thrash Jul 29 '23 at 11:34
  • If you want this to be handled automatically, you have to do some ifthenelse magic as is done in the original code. For the case of only a single page,\thispagestyle{empty} is probably what you want. – Jochen Martin Eppler Jul 30 '23 at 16:11
  • Thanks for the original code. How do I have to change it (i.e. what do I have to put in the preamble) so that the situation is handled automatically? Can this in the future maybe be integrated as a documentclass option of moderncv so that a user can switch between these two behaviors globally? – Thrash Jul 31 '23 at 20:16