# Why is it useful to change \hyphenchar?

In il2code.tex there is such text:

%% Alternative \hyphenchar ("je-li" is no "je\hyphenchar li").
\chardef\extrahyphenchar=156
\def\extrahyphens{%
\hyphenchar\tenrm=\extrahyphenchar
\hyphenchar\tenbf=\extrahyphenchar
\hyphenchar\tentt=\extrahyphenchar
\hyphenchar\tensl=\extrahyphenchar
\hyphenchar\tenit=\extrahyphenchar
\defaulthyphenchar=\extrahyphenchar}


What is the benefit of this?

• – egreg Aug 22 '19 at 8:29

## 1 Answer

Compile with pdfcsplain:

\hsize=0pt \parindent=0pt

\hskip0pt supercalifragilistic-expialidocious

\extrahyphens
\lccode-=- % so - does not block hyphenation

\hskip0pt supercalifragilistic-expialidocious

\bye


In the first case, the hyphen coincides with the \hyphenchar, so the word is only split at the hyphen. In the second case, the hyphen doesn't block hyphenation (in the word part preceding it). With \lccode-=- we allow hyphenation also after the explicit hyphen (well, this is not really the best thing to do, as you see).

• "this is not really the best thing to do" - this can be solved with the help of ligature "〈hyphen〉〈hyphenchar〉 ⟶ 〈hyphenchar〉". – Igor Liferenko Aug 28 '19 at 2:10
• I wonder why \discretionary{-}{}{-} does not work here. – Igor Liferenko Aug 29 '19 at 0:48