5

I have just encountered a strange behavior with a long german word:

\documentclass[ngerman]{article} 
\usepackage{babel}
\begin{document}

Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumm 
\textbf{"Aquivalenzumformungen} Lorem ipsum 

Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumm  
\textbf{"Aquivalenz\-umformungen} Lorem ipsum 

\end{document}

In the first case, the word is hyphenated as Äquivalenzum-formungen, which is grammatically correct, but not beautiful, as the word is composed (Äquivalenz + Umformungen).

To avoid this, I indicated the desired break-point with a \-, but now LaTeX prefers to leave the word in one piece and generates an Overfull \hbox.

Why does this happen? And what can I do to have correct hyphenation? (I could, of course, reformulate the sentence where the word occurs, but I dont find this a good idea.)

Thank you![enter image description here]1

1 Answers1

2

With \textbf{"Aquivalenz\-umformungen} you define only one possible hyphenation. But the interword space will be too big if TeX tries to hyphenate at this point. Use

\begin{sloppypar}
Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumm  
\textbf{"Aquivalenz\-umformungen} Lorem ipsum 
\end{sloppypar}

The possible stretching of the interwordspace is saved in \fontdimen3\font:

\documentclass[ngerman]{article} 
\usepackage{babel}
\begin{document}

Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumm 
\textbf{"Aquivalenzumformungen} Lorem ipsum 

The default: \the\fontdimen3\font

the new one: \fontdimen3\font=10pt

Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumm  
\textbf{"Aquivalenz\-umformungen} Lorem ipsum 

\end{document}

However, you should always use \emergencystetch or the sloppypar environment!

  • Or, if the paragraph is longish, it is possible that there are other long words with few hyphenation points known to TeX. If you provide more hyphenation possibilities for those, there is a chance – admittedly a small one – that the extra flexibility will allow TeX to typeset the paragraph with the hyphenation you want. This will require quite a bit of experimentation for a small chance of success, though. – Harald Hanche-Olsen Jul 31 '15 at 10:47
  • Thank you for your answer. When typesetting the paragraph like this, I notice the larger interword space. According to \widthof, the characters UM take up approximately 16pt. So, what makes LaTeX think that an overfull box of 37pt is a better solution? – Philipp Imhof Jul 31 '15 at 10:49
  • 1
    @PhilippImhof It doesn't think it better, it thinks there is no feasible solution within the allowed parameters for stretching space so it just dumps that one line overfull and complains in the log that the box is over full. – David Carlisle Jul 31 '15 at 10:54
  • OK, I think I understand: The fact of not hyphenating the word is not the solution LaTeX suggests, it's the result of LaTeX "giving up" on that paragraph (or line). Right? – Philipp Imhof Jul 31 '15 at 11:02
  • @PhilippImhof more or less yes, some more details of what exactly tex uses to decide what to do are in an answer here: http://tex.stackexchange.com/questions/50830/do-i-have-to-care-about-bad-boxes/50850#50850 – David Carlisle Jul 31 '15 at 11:42