4

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

  • There is no way for staying below the tolerance when the only feasible hyphenation point is between ‘z’ and ‘u’. – egreg Jul 31 '15 at 10:41
  • @egreg: Sorry, I do not quite understand what you mean... – Philipp Imhof Jul 31 '15 at 10:49
  • TeX would have to stretch spaces too much in order to hyphenate at the only available point, so exceeding the tolerance (a measure of how much bad we allow lines to be, granted that stretching spaces is bad). – egreg Jul 31 '15 at 10:58
  • Thanks. So no connection to the actual letters. :) – Philipp Imhof Jul 31 '15 at 11:03
  • You can use "Aquivalenz\-umfor\-mun\-gen – egreg Jul 31 '15 at 11:22
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: tex.stackexchange.com/questions/50830/… – David Carlisle Jul 31 '15 at 11:42

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.