Take the 2-minute tour ×
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.

According to the accepted answer of this question TeX never hyphenates words that already contain a hyphen. Nevertheless in a document here I find that the word “Modula-2” is hyphenated, as the following image shows (generated with this file using XeLaTeX, version 3.1415926-2.4-0.9998 (MiKTeX 2.9 64-bit)).

\documentclass[10pt]{article}
\begin{document}
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum Modula-2
  nisi urna, congue sed congue id, iaculis et lacus.
\end{document}

Unwanted hyphenation

Apparently I can’t use \hyphenation to prevent this; but the word appears several times so I don’t want to use \mbox either. Is there a better solution?

share|improve this question
3  
TeX never hyphenates words that are explicitly hyphenated, so if that instance is hyphenated presumably the markup used is hiding the hyphen. Please always provide a small complete document that demonstrates the problem, so people can reproduce it. –  David Carlisle Nov 12 '12 at 13:14
    
I just added a screenshot and its source file. –  JC Chu Nov 12 '12 at 13:49

1 Answer 1

up vote 9 down vote accepted

By not hyphenating hyphenated words, what is meant is not adding more hyphens. What you want to prevent is line breaking at an existing hyphen for which you just need

   \exhyphenpenalty=10000

in the preamble to give an infinite penalty for breaking at an explicit hyphen

enter image description here

share|improve this answer

Your Answer

 
discard

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.