5

The \hyphenation command can be used to list the allowed hyphenated forms of words. For example, \hyphenation{incor-rect-ly} means that these hyphenations of the word incorrectly are allowed.

Is there a complimentary command that allows one to list the disallowed hyphenations of a word? I do not want to list all of the allowed versions. For example, I want to say \nohyphenation{in-correctly} without specifying the allowed versions. I'm lazy/efficient and don't want to think too hard about many-syllable words.

  • 4
    Only the setting for the last word in \hyphenation{incorrectly incor-rectly incorrect-ly} will be taken into account (but only if you set hyphenmins to a smaller value). Use \hyphenation{incor-rect-ly} to describe all the allowed hyphenations. – Ulrike Fischer Jul 28 '15 at 7:33
6

Judging from your answer it seems you don’t really understand what \hyphenation does.

The purpose of \hyphenation{some-word-with-hyphens} is not just to allow TeX to hyphenate the word at the places where the hyphens are: it’s also to forbid it everywhere else. For example, say you want to add a breakpoint to the word “advised” by allowing a break before “ed” at the end (the correct hyphenation is “ad-vised” in any style of English typography). The only way you can do that is by saying \hyphenation{ad-vis-ed}; if you say \hyphenation{advis-ed} you will have forbidden the hyphenation “ad-” which is ... ill-advised.

To address your issue, we would need to introduce two complementary commands, which we could call \allowhyphenation and \forbidhyphenation, for example. I can’t see an easy way to do so with the current implementation of TeX’s hyphenation algorithm; it seems that you would have to add patterns tailored to the word so that it would either allow or forbid a specific breakpoint, which is rather awkward. Alternatively, you could write a function to scan the word for all its hyphenation breakpoints, add or remove some of them as mandated by the command that has just been issued, and feed it to \hyphenation again. None of this is particularly straightforward. You’re far better off using \hyphenation for what it’s be designed to do: to specify all the desired breakpoints in a word. You may find that they're not that bad after all. Obviously, there may be errors too; if you do find any please report it here.

Of course, if you’re using LuaTeX, all bets are off as you can replace the entire hyphenation algorithm by a new one implemented in Lua.

|improve this answer|||||

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.