bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

standard quotes for PDF


From: Han-Wen Nienhuys
Subject: standard quotes for PDF
Date: Fri, 2 Jun 2006 01:22:44 +0000 (UTC)

hello,


the following patch (against a somewhat older version of texinfo.tex)
makes sure that a regular quote ( ' ) is printed using a regular quote
in the output.

We have lots of users that cut & paste code from PDF files, which
doesn't work, because the standard TeX curly quote gets translated to
the wrong glyph.

--- texinfo/doc/texinfo.tex     2006-06-02 03:19:04.000000000 +0200
+++ texinfo.tex 2006-06-02 03:19:10.000000000 +0200
@@ -1878,9 +1878,12 @@
 {
   \catcode`\-=\active
   \catcode`\_=\active
+  \catcode`\'=\active
   %
   \global\def\code{\begingroup
     \catcode`\-=\active  \catcode`\_=\active
+    \catcode`\'=\active
+    \let'\singlequotechar
     \ifallowcodebreaks
      \let-\codedash
      \let_\codeunder
@@ -5059,11 +5062,10 @@
 %
 \maketwodispenvs {lisp}{example}{%
   \nonfillstart
-  \tt
+  \tt\quoteexpand
   \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
   \gobble       % eat return
 }
-
 % @display/@smalldisplay: same as @lisp except keep current font.
 %
 \makedispenv {display}{%
@@ -5191,6 +5193,12 @@
 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
 %
 \def\starttabbox{\setbox0=\hbox\bgroup}
+%
+%
+% Don't replace quotes with curly quotes. This makes cut & pasting
+% from a PDF file problematic.
+% 
+\def\singlequotechar{\char'15\relax}
 \begingroup
   \catcode`\^^I=\active
   \gdef\tabexpand{%
@@ -5203,6 +5211,11 @@
       \wd0=\dimen0 \box0 \starttabbox
     }%
   }
+  \catcode`\'=\active
+  \gdef\quoteexpand{%
+    \catcode`\'=\active
+    \def'{\singlequotechar}
+  }%
 \endgroup
 \def\setupverbatim{%
   \let\nonarrowing = t%
@@ -5212,6 +5225,7 @@
   \def\par{\leavevmode\egroup\box0\endgraf}%
   \catcode`\`=\active
   \tabexpand
+  \quoteexpand
   % Respect line breaks,
   % print special symbols as themselves, and
   % make each space count

 







reply via email to

[Prev in Thread] Current Thread [Next in Thread]