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?

Igor Liferenko
  • 7,063
  • 2
  • 14
  • 47
  • 1
    See https://tex.stackexchange.com/q/63232/4427 – egreg Aug 22 '19 at 08:29
  • Side note, the behavior of LuaTeX regarding hyphenation is different. There are \exhyphenchar (explicitly specified hyphen char) and \prehyphenchar, \preexhyphenchar etc., so setting \hyphenchar is almost no-op in LuaTeX. – user202729 Jul 02 '22 at 15:04

1 Answers1

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

egreg
  • 1,121,712