3

Is there any way in pdflatex to make the page numbers non selectable in the outputed documents. I know that there are some pdfs floating around out there where the page number is not included in selects. By page numbers I mean the ones placed at the bottom of each page to mark the current page, not those placed by using a reference command.

4
  • Which page numbers do you mean? In the ToC/LoF/LoT/ListOfWhatever? In a page reference by \pageref or in \cite - generated references?
    – user31729
    Apr 20, 2017 at 20:42
  • @ChristianHupfer Updated question to be more clear. I mean the page numbers that mark the page as being that page.
    – HSchmale
    Apr 20, 2017 at 20:49
  • Would it be enough if the pagenumbers would not be included if the selected text is copied? Apr 20, 2017 at 21:24

1 Answer 1

6

The following is reader-specific:

enter image description here

\documentclass{article}

\usepackage{fancyhdr,accsupp,lipsum}
\pagestyle{fancy}
\fancyhf{}% Clear header/footer
\renewcommand{\headrulewidth}{0pt}% Remove header rule
\fancyfoot[C]{\BeginAccSupp{ActualText={}}\thepage\EndAccSupp{}}

\begin{document}

\lipsum[1-50]

\end{document}

accsupp provides the ability to set content in the document, but let the rendered PDF have it think it's something else.

As mentioned, it's reader-specific. Here's the same selection-view within SumatraPDF:

enter image description here

Note how the page number (1) is selected.

You must log in to answer this question.

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