home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / text / tex / 9411 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.8 KB  |  53 lines

  1. Path: sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!zodiac.rutgers.edu!leichter
  2. From: leichter@zodiac.rutgers.edu
  3. Newsgroups: comp.text.tex
  4. Date: 17 Jul 92 22:17 MDT
  5. Subject: Re: ligatures, kern pairs, and \relax
  6. Sender: Notesfile to Usenet Gateway <notes@glas.apc.org>
  7. Message-ID: <1992Jul17.141706.1@zodiac.rutger>
  8. References: <25545@life.ai.mit.edu>
  9. Nf-ID: #R:life.ai.mit.edu:25545:1992Jul17.141706.1@zodiac.rutger:1742244653:001:1318
  10. Nf-From: zodiac.rutgers.edu!leichter    Jul 17 22:17:00 1992
  11. Lines: 40
  12.  
  13.  
  14. In article <25545@life.ai.mit.edu>, bkph@kauai.ai.mit.edu (Berthold K.P. Horn)
  15. writes:
  16.     Suppose there is a font that has a ligature --  ==>  endash
  17.  
  18.     Now suppose I have a keyboard that doesn't have a -, but does have a +
  19.     key. So I decide to make + active and redefine it to generate the
  20.     appropriate character code for minus, something like
  21.  
  22.     \catcode`\+=\active  \def+{\char45}
  23.  
  24.     Now I can type ++ and have it print endash, but...
  25.     if a number follows the endash I am in trouble - for example:
  26.  
  27.     pp.~23++67
  28.  
  29.     `cause now TeX complains about bad character code since it expands
  30.     into pp.~23\char4567  
  31.  
  32.     So I can add a \relax to the definition
  33.  
  34.     \catcode`\+=\active  \def+{\char45\relax}
  35.  
  36.     Now I don't get the complaint about bad character code, but the
  37.     ligature doesn't work anymore!  What is the solution? (Assume that the
  38.     character code of the desired character may actually be > 127, so that
  39.     using the desired character in the definition isn`t an option).
  40.  
  41. Ligature substitution takes place very early, long before TeX can know the
  42. \relax is a no-op.  For ligature substitution (or kerning) to take place, the
  43. characters must be immediately adjacent.
  44.  
  45. There is, however, a simple way to do what you want.  Try:
  46.  
  47.     \def+{\char45 }
  48.  
  49. which works because a single space is discarded after a number.
  50.  
  51.                             -- Jerry
  52.  
  53.