TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a solution that will allow me to prevent some parts of the final pdf file (header, footer) from being selected and copied. It is to allow easier quoting of longer parts of texts from documents that will be published.

share|improve this question
Related: tex.stackexchange.com/questions/18483/… – krlmlr Mar 27 '12 at 13:51
up vote 27 down vote accepted

Based on this answer, you could use accsupp to define a \squelch command:


This text is selectable \squelch{but this text isn't}.

The squelched text cannot be highlighted in Acrobat, and copying the whole line gives this:

This text is selectable .

It's easy to combine this with fancyhdr:


You could also define a variant \squelchstyle for use with KOMA-Script's \addtokomafont:

share|improve this answer
This works even when viewing the document in evince. Amazing! – krlmlr Mar 27 '12 at 11:38
Redefining \thepage to do anything other than return a page number is a really bad idea. See the answers to this question tex.stackexchange.com/q/3731/627 and squelch the page numbers by defining a new page style (eg with the fancyhdr package). – Lev Bishop Mar 31 '12 at 18:18
etextools seems to cause problems with biblatex, is there another way to use something like squelchstyle? – maetra Mar 31 '12 at 19:57
nice, that does the job I was looking for – maetra Mar 31 '12 at 20:45
Is there any way to get this working with latex -> dvips -> ps2pdf (GhostScript)? – Markus Schmassmann May 9 '12 at 19:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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