[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bad ligatures with fontenc
From: |
Gavin Smith |
Subject: |
Re: Bad ligatures with fontenc |
Date: |
Mon, 8 Aug 2022 21:16:21 +0100 |
On Mon, Aug 08, 2022 at 03:20:06PM +0100, Gavin Smith wrote:
> It appears in whatever font fontenc is using, there is a ligature that
> transforms ,, into a single character.
I found this page
https://tex.stackexchange.com/questions/192967/list-of-latex-ligatures
that references a "t1.etx" file that lists ligatures, although I don't
appear to have such a file on my system.
There is this file
https://tug.org/fontname/ec.enc
which has some lines that look relevant:
% Although these ligatures and kerns are somewhat questionable to have
% in an encoding file, they've been here forever, and they are
% traditional in the TeX world, so we preserve them.
%
% LIGKERN space l =: lslash ; space L =: Lslash ;
% LIGKERN question quoteleft =: questiondown ; exclam quoteleft =: exclamdown ;
% LIGKERN hyphen hyphen =: endash ; endash hyphen =: emdash ;
% LIGKERN quoteleft quoteleft =: quotedblleft ;
% LIGKERN quoteright quoteright =: quotedblright ;
%
% We blow away kerns to and from spaces (TeX doesn't have a
% space) and also remove any kerns from the numbers (although
% the only kern pair that mentions a number in Times-Roman.afm
% is one one.)
%
% LIGKERN space {} * ; * {} space ; zero {} * ; * {} zero ;
% LIGKERN one {} * ; * {} one ; two {} * ; * {} two ;
% LIGKERN three {} * ; * {} three ; four {} * ; * {} four ;
% LIGKERN five {} * ; * {} five ; six {} * ; * {} six ;
% LIGKERN seven {} * ; * {} seven ; eight {} * ; * {} eight ;
% LIGKERN nine {} * ; * {} nine ;
% LIGKERN comma comma =: quotedblbase ; less less =: guillemotleft ;
% LIGKERN greater greater =: guillemotright ;
There is also this
https://tex.stackexchange.com/questions/572005/how-to-avoid-ligatures-of-double-less-equal-sign-in-latex
which references the exact problem we are having: there it is << (left
shift operator in C++) that is being ligaturised ("ligated"? "ligatured"?)
into a left-pointing guillemet.
The latter link recommends the use of the microtype package, but this
is dependent on pdfTeX and won't work for other TeX engines, DVI
output, XeTeX, LuaTeX...
It looks like we need the T1 encoding for various characters like
\TH. Although we manage in texinfo.tex by using specific fonts,
this would probably be too rigid for the LaTeX output.
So the most reliable way I can think of for suppressing these
ligatures is to wrap problem characters in { ... } for fixed
width fonts. Completely verbatim environments where braces are not
special will probably require extra processing.
Maybe this is all clear to LaTeX insiders but I find there is not
a huge of amount of documentation of these issues leading to my reliance
on "grey literature".