3

Suppose, I want to write a word with diacritical marks, say fïbęj, and I cannot use Unicode or similar but instead I have to keep maximum compatibility for all sorts of situations. If I am not very much mistaken, I have to resort to one of the following:

  1. f\"ib\k{e}j
  2. f\"{i}b\k{e}j
  3. f{\"i}b{\k{e}}j
  4. f{\"{i}}b{\k{e}}j

I vaguely remember having read once that one of these alternatives is preferrable because it allows for a better kerning or something similar. However, testing this, I get the same bad kerning in all cases: The ascender of the f and the left dot of the ï collide, and so do the ogonek and the descender of the j.

Now, this was a deliberately pathological example and the respective collisions may not be relevant to any existing language and thus there might be other cases in which one of the above ways to encode diacritical marks does produce a better kerning. Also, I did not test all possible environments and may have missed something.

Finally, there may be some other reasons (except source-code aesthetics) that make one of the above variants preferrable for hyphenation and other aspects.

My question thus is: Is there any technical reason to prefer some of the above variants over the others?

5

Use 1 or 2. You do not want to add groups around the letter unless you can avoid it (this is a major problem with bibtex's use of groups to control upper and lower casing). fine will typically use an fi ligature in most fonts but f{i}ne will break the ligature (usually). It is the same with letters with diacritics.

If \"{i} is resolving to the use of the \accent primitive to place a \" then there will be no font-specified kerns or ligatures, so all your possibilities are equivalent. (This happens with the default OT1 encoding).

If \"{i} is resolving to the use of a single glyph in the font with a composed character then if there are font-specified kerns or ligatures, these will be prevented if you have a {} group around the construct.

5

Maximum compatibility is impossible because \k is not provided in classical TeX in Computer Modern. Thus \k is undefined control sequence in plain TeX. The \k is defined depending on used macro package and used font encoding. LaTeX with default font encoding doesn't know the \k.

Second problem: \"i gives dotted i and next pair of dots above (i.e. three dotted i) in classical TeX. The usage of \"\i is needed. But the syntax \"i may give desired result depending on used macro package and used internal font encoding.

  • To expand on the compatibility issue: the ogonek package defines \k for OT1 encoding. – Marijn Mar 26 '18 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.