[pdftex] Blank lines are ignored when copying-and-pasting from PDF

David Rendon darfguard-latex at yahoo.com
Sun Jan 3 06:59:37 CET 2010

On Jan 2, 2010, at 10:36 AM, martijn.list wrote:

> I'm including a PGP public key block in my document using with  
> verbatim:
> \begin{verbatim}
> Version: GnuPG v1.4.9 (GNU/Linux)
> mQGiBElPrxcRBADTrz89p8FEAC/DEpNmbanNruED96RAuE0FRgbERqvgeSB7SVeW
> [snip]
> TrzgYl9YhiNdY7s=
> =4Rpa
> \end{verbatim}
> Now when I convert the Latex document to PDF (using pdflatex) the  
> PDF document shows the blank line between ...GnuPG v1.4.9 (GNU/ 
> Linux) and mQGiBElP...
> But, when I copy and paste the PGP key to a text editor it won't  
> include the blank line. Because the blank line is mandatory the  
> result will be an invalid PGP key. Is it possible to add a newline  
> to the final PDF output to make sure that copy-and-paste will  
> include the blank line?

This workaround is far from ideal, but you might want to try it if  
everything else fails.

It turns out that several programs including Microsoft Word (at least  
on the Mac), OmniGraffle, and others, produce a PDF file that does  
preserve the empty line. I'm sure you will be able to find an adequate  
program for Ubuntu.

If you insert such a PDF created with the external program as a figure  
in your TeX document, the empty line will also be preserved in the PDF  
produced by pdftex.

It's a nasty workaround but it works.


David Rendon

More information about the pdftex mailing list