Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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


or followed by


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


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?

share|improve this question
The standard babel way to proceed would be to activate " 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
@Caio: Interesting, I was unaware of that specific rule, thanks for bringing this up. Sadly, we have to adapt (I think the transition period ends this year), but I'll resist until the very last minute. =) – Paulo Cereda Jul 16 '11 at 20:32

3 Answers 3

up vote 9 down vote accepted

One approach without requiring LuaTeX would be to take a similar tack to the way hyphenation is/used to be handled in German. Something like

Some filler text. 
Some filler text.
Some filler text.
Some filler text.
Some"-hyphenated word.

Of course, this requires the use of one additional character, which may not be desirable. On the other hand, I don't think that there is a hook in the TeX engine to alter things, so the only 'no input change' way to alter things is I guess to use LuaTeX.

share|improve this answer
Hyphenated words are badly common in Portuguese, using this method would make the manuscript too messy. Thanks for the advice, I'll research LuaTeX for an answer and give a feedback to this forum. – Caio Lopes Jul 16 '11 at 3:32

The alternative I commonly use is the redefinition of the underscore to provide this doubled-when-broken hyphen:


This keeps the meaning of _ in mathematical mode, which is essential!! Also, take care not to use _ in your labels, as they will not work. I usually write \label{my-section} anyway, so this is not a problem for me.

Now, you just need to write Terão que adaptar_se ou perecer!, which I think is still very readable and has the advantage of using a single character as well.

I usually place code similar to that in a separate .sty file which I import whenever I need it. This package helps me write small portions of Portuguese text inside documents with English as main language, which changes hyphenation rules (provided babel is loaded with Portuguese language) and also emits a \frenchspacing that disables the "double space" at the end of sentences that is traditional in English typography but not in Portuguese.

share|improve this answer

A more elegant approach would be to use babel command shorthand \babelhyphen{repeat} (section 1.5) to define a new character (or in this case two) for a repeatable hyphen. It's designed specifically for that (see this question):

hard hyphen inside compound words are repeated at the beginning of the next line.

Something like this:

    \textwidth=5cm % just making easier to spot with less text
    \defineshorthand{"-}{\babelhyphen{repeat}} % generates a hyphen that will repeat on a new line
Text Text Text Text sabendo-se % without repeated hyphen

Text sabendo-se                % won't repeat anyway    

Text Text Text Text sabendo"-se % with repeated hyphen

Text sabendo"-se                % won't repeat anyway

screenshot showing the repeated hyphen

Yes, it sill makes the the code look weird and demands author to type an extra character every time, but it works and it's simple.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.