My language, Portuguese, have undergone another orthography reform (those committees simply can't avoid themselves from doing this mess from time to time.) Now we have to adapt, which brings us to my problem.
By the new rule, when a line break occurs at one word's literal hyphen, it should be doubled, appearing at the end of the first line and at the beginning of the second one.
A phrase like “Terão que adaptar-se ou perecer!”, broken at the hyphen, should look like this:
Terão que adaptar-
-se ou perecer!
In TeX terms, each literal hyphen should be replaced by
\discretionary{-}{-}{-}
or followed by
\discretionary{}{-}{}
But TeX's (apparently) hard coded discretionary for literal hyphen is \discretionary{}{}{} (called “empty discretionary”), inserted after every “-” [The TeXBook, p. 95].
The obvious solution
\chardef\hyphen=`\-
\catcode`\-=13
\def-{\penalty\exhyphenpenalty
\discretionary{\hyphen}{\hyphen}{\hyphen}}
is hardly usable because you cannot redefine a character like “-”, heavy used by TeX assignments, without getting too much trouble.
Is there a right way to get this effect? Or only by diving into TeX's source code or waiting for LuaTeX?
"and define a shortcut"-. The activation of-can be done, either, but one has to remember to say\string-when the hyphen is needed in the context of a numeric assignment. – egreg Jul 15 '11 at 7:54=)– Paulo Cereda Jul 16 '11 at 20:32