Is the discretionary of the word difficult di\discretionary{f-}{fi}{ffi}cult
equivalent to dif\-ficult
(or dif\discretionary{-}{}{}
)?
1 Answer
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
-
1Thanks. 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).– yanpenglCommented May 14, 2022 at 3:15
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).