8

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?

5

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).

enter image description here

See also https://tex.stackexchange.com/a/63234/4427

  • "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 at 2:10
  • I wonder why \discretionary{-}{}{-} does not work here. – Igor Liferenko Aug 29 at 0:48

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.