Article View: comp.text.tex
Article #333Re: ligatures, kern pairs, and \relax
From: leichter
Date: Sat, 18 Jul 1992 04:17
Date: Sat, 18 Jul 1992 04:17
39 lines
1880 bytes
1880 bytes
In article <25545@life.ai.mit.edu>, bkph@kauai.ai.mit.edu (Berthold K.P. Horn)
writes:
Suppose there is a font that has a ligature -- ==> endash
Now suppose I have a keyboard that doesn't have a -, but does have a +
key. So I decide to make + active and redefine it to generate the
appropriate character code for minus, something like
\catcode`\+=\active \def+{\char45}
Now I can type ++ and have it print endash, but...
if a number follows the endash I am in trouble - for example:
pp.~23++67
`cause now TeX complains about bad character code since it expands
into pp.~23\char4567
So I can add a \relax to the definition
\catcode`\+=\active \def+{\char45\relax}
Now I don't get the complaint about bad character code, but the
ligature doesn't work anymore! What is the solution? (Assume that the
character code of the desired character may actually be > 127, so that
using the desired character in the definition isn`t an option).
Ligature substitution takes place very early, long before TeX can know the
\relax is a no-op. For ligature substitution (or kerning) to take place, the
characters must be immediately adjacent.
There is, however, a simple way to do what you want. Try:
\def+{\char45 }
which works because a single space is discarded after a number.
-- Jerry
Technical Details
Message-ID:
<1992Jul17.141706.1@zodiac.rutger>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!zodiac.rutgers.edu!leichterReferences:
<25545@life.ai.mit.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!zodiac.rutgers.edu!leichter From: leichter@zodiac.rutgers.edu Newsgroups: comp.text.tex Date: 17 Jul 92 22:17 MDT Subject: Re: ligatures, kern pairs, and \relax Sender: Notesfile to Usenet Gateway <notes@glas.apc.org> Message-ID: <1992Jul17.141706.1@zodiac.rutger> References: <25545@life.ai.mit.edu> Nf-ID: #R:life.ai.mit.edu:25545:1992Jul17.141706.1@zodiac.rutger:1742244653:001:1318 Nf-From: zodiac.rutgers.edu!leichter Jul 17 22:17:00 1992 Lines: 40