[OS X TeX] Problem with Quotes in PDF File

Rick Zaccone zaccone at bucknell.edu
Sat Jan 28 14:59:25 EST 2006


I sometimes create LaTeX files containing programming examples.  I  
distribute these file to students electronically.  I would like them  
to be able to copy the code in these files, paste them into a text  
editor, and try them out.  Unfortunately, this doesn't work with the  
PDF files I create with TeXShop.  I think this problem is not  
specific to TeXShop or the Macintosh, so this may not be the proper  
place to raise this issue.

Consider the following LaTeX file:

\documentclass{article}
\begin{document}

\begin{verbatim}
!"#$%&'
()*+,-./
01234567
89:;<=>?
@ABCDEFG
HIJKLMNO
PQRSTUVW
XYZ[\]^_
`abcdefg
hijklmno
pqrstuvw
xyz{|}~
\end{verbatim}

\end{document}

This will produce an output file containing every printable ASCII  
character.  Unfortunately, the left quote (`) and right quote (') are  
not the same in the output file.  If I open the resulting PDF file in  
Acrobat Reader and copy the characters, I get

  !"#$%&’
()*+,-./
01234567
89:;<=>?
@ABCDEFG
HIJKLMNO
PQRSTUVW
XYZ[\]^_
‘abcdefg
hijklmno
pqrstuvw
xyz{|}~

There are two differences.  In the source file the left quote is  
octal 047 (39 decimal, 0x27 hex).  In the PDF file the left quote is  
0222 in octal (146 decimal, 0x92 hex).  It seems that the character  
has been translated into its "curly" equivalent.  The same thing has  
happened to the right quote.

Of course, compilers are unforgiving about something like this.   
Students can't just copy code examples and expect them to compile  
which is a big problem.

Is there any way to fix this?  That is, I would like the correct  
values for left and right quotes to appear in my PDF file.  How can I  
accomplish this?

Rick

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list