[pdftex] Backtick producing a wrong character code in PDF output

Reinhard Kotucha reinhard.kotucha at web.de
Fri Jan 28 22:59:20 CET 2022


On 2022-01-28 at 12:01:05 -0800, Ilya Zakharevich wrote:

 > On Fri, Jan 28, 2022 at 07:42:55PM +0100, Reinhard Kotucha wrote:
 > >  > The problem is that after \verb|`|, it seems that the generated glyph
 > >  > is marked as U+2018.
 > 
 > > Could you try \usepackage{upquote} ?
 > 
 > Did you notice that I do not complain about “the shape of the glyph”?
 > I discuss only how cut-and-paste, search etc. would behave.
 > 
 >    (It seems that Adobe Acrobat is special-casing font “Tt”.  Should
 >     not PDFTeX do this instead when it marks glyphs with character
 >     codes in PDF?)

You can't cut-and-paste to pdftex.  You actually paste to your
text editor.  Make sure that your text editor does the right thing.
pdftex does exactly what you tell it.  No more, no less.

 >     	  Anyway — thanks for your suggestion.  However:
 > 
 > `upquote´ DOES change things — but only ½ of the behaviour (with
 > \verb, but not with \texttt).  The docs say
 >     This does not affect \tt, \texttt, etc.
 > so the code excerpts in \footnote⸣s etc. are not affected by this package.

The distinct behaviour is on purpose.  \verb is for computer code and
\texttt is for normal text.  If you are writing normal text with a
typewriter font you want "typograhic" quotes of course.

 > Moreover, tons of existing documents with code excerpts are written
 > without using `upquote´.  Should they all be modified to special-case
 > PDF output?

Yes, definitely!  The philosophy of TeX is that you always get the
same output even if you wrote your document 100 years ago.  If you
want different output you have to change the document sources.

There are more than thousand macro packages relying on the current
behavior of pdftex.  A tiny change in pdftex will break many of them.
Therefore pdftex is frozen for about two decades and no new features
were added ever since.

Furthermore, it's absolutely undesirable to modify the engine in order
to implement something which can be easily implemented with macro
code.  This would make pdftex a moving target.

But as I said before, pdftex is frozen forever and will definitely
not be changed.

Regards,
  Reinhard

-- 
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------



More information about the pdftex mailing list.