Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The Guide to LaTeX (4th ed.) states that \/ is used to break up ligatures (p. 30 and p. 469), which I thought was standardly done with {}. As \/ is normally known to insert an italic correction (see "How does italic correction work?"), and {} and \/ yield demonstrably different output, which of the two options is considered best practice? Are there subtleties to be aware of, for choosing one vs the other?

In the following code

\documentclass{article}

\begin{document}

shelfful   % (1) ligature

shelf{}ful % (2) no ligature

shelf\/ful % (3) no ligature, wider than in the line above

\end{document}

the spacing between the two "f" letters is wider in line 3 than in line 2, which is not surprising, but if a hair space is meant, the question is whether one is justified and also whether an italic correction makes sense for this purpose (as this is not actually a situation with italics).


Additional options: The question linked to by David Carlisle lists other (creative but hacky) options: {shelf}ful (identical to shelf{}ful, according to that source), shelf{\kern0pt}ful, shelf\-ful, and shelf\discretionary{-}{}{\kern.033333em}ful (the babel solution "| essentially combines this approach with some fine-tuning). This question was meant to differentiate just between the two recommendations which one is likely to encounter (namely {} and \/), to help unconfuse the learner. In any case, it seems like neither is optimal, with the best solution being babel's "|. This question-answer set serves as documentation for this whole situation.

share|improve this question
add comment

2 Answers

up vote 13 down vote accepted

As you point out, \/ is not for breaking ligatures, it is the command for the italic correction and the reason for why you get the additional space. For ligature breaking, the best option is the babel shorthand "|, which is defined as

 \declare@shorthand{...}{"|}{%
  \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
              \allowhyphens}{}}

and also allows hyphenation, which \/ doesn't:

enter image description here

(Each of the above two groups of three instances of "shelfful" was generated with ff, f{}f, and f\/f (in that order) - that is, not with "|.)

share|improve this answer
add comment

See also

Ligature suppression with proper hyphenation and comprehensive word list?

which asks a more comprehensive question and has various relevant information.

Using {} has the disadvantage (as pointed out in TeX3 editions of the TeXBook) that it doesn't work in general. If the word is hyphenated then TeX will re-insert the ligature if f{}f falls in one of the constituent parts. This doesn't affect shelfful as the only hyphenation point there is between the two f.

share|improve this answer
    
Hmm, the (well-researched) linked-to question still leaves open the question about the best way to suppress ligation, if I read everything correctly. Do you have any opinion on that? Is babel's "| best? –  Lover of Structure Apr 2 '13 at 9:09
3  
Yes probably babel way is best although obviously the horizontal skip added is fairly arbitrary and could in theory be tuned for each font choice, and in fact between each pair of letters, in practice just a fixed arbitrary small skip is probably OK. (I don't think I've ever suppressed a ligature in a real document though:-) –  David Carlisle Apr 2 '13 at 9:18
    
Don't kerning tables of fonts also contain values for those letter combinations? After all, font designers should know that such combinations are not always ligated. –  Lover of Structure Apr 2 '13 at 13:16
1  
@LoverofStructure to be honest I don't know if they do or not but either way you can't access that kern value from standard tex (not sure about luatex) If the font specifies a ligature that will be used. (With fontspec and lua/xe tex you have control over whether the font ligatures are used but again that is at the document font level not per word. –  David Carlisle Apr 2 '13 at 13:28
1  
@LoverofStructure It depends. In OT1 encoding it is \kern0pt so it stops hyphenation and ligatures but in T1 it is a(n invisible) character in the font so you can use it as an entry in hyphenation tables and specify how letter combinations with that character should hyphenate. –  David Carlisle May 18 '13 at 7:53
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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