5

Is the discretionary of the word difficult di\discretionary{f-}{fi}{ffi}cult equivalent to dif\-ficult (or dif\discretionary{-}{}{})?

1
  • 3
    Instead of dif\-ficult it's better to use \hyphenation{dif-ficult}. Putting the discretionary by hand will break the ffi ligature (which is probably why you are asking this question). Commented May 13, 2022 at 16:45

1 Answer 1

8

The TeXbook, p. 95

The most common case of a discretionary break is a simple discretionary hyphen

\discretionary{-}{}{}

for which TeX accepts the abbreviation \-.

Hence dif\-ficult is equivalent to dif\discretionary{-}{}{}ficult.


You can also see this in the output log:

\showboxbreadth=\maxdimen
\showboxdepth=\maxdimen
\setbox0\hbox{dif\-ficult}
\showbox0
\bye
> \box0=
\hbox(6.94444+0.0)x33.6112
.\tenrm d
.\tenrm i
.\tenrm f
.\discretionary
..\tenrm -
.\tenrm ^^L (ligature fi)
.\tenrm c
.\tenrm u
.\tenrm l
.\tenrm t

The other variant with di\discretionary{f-}{fi}{ffi}cult produces

> \box0=
\hbox(6.94444+0.0)x33.33342
.\tenrm d
.\tenrm i
.\discretionary replacing 1
..\tenrm f
..\tenrm -
.|\tenrm ^^L (ligature fi)
.\tenrm ^^N (ligature ffi)
.\tenrm c
.\tenrm u
.\tenrm l
.\tenrm t
1
  • 1
    Thanks. I misunderstood \discretionary. They are different, the positions of line breaks in these two cases are also different (if the line breaks at the position \discretionary appears).
    – yanpengl
    Commented May 14, 2022 at 3:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .