'LaTeX text doesn't break at line end
I have this code:
\documentclass{article}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusm überwachen tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}
If I compile the document, all lines get broken at the same point, with exception of the first one. The word "überwachen" always goes over the boundary. It doesn't seem to happen with all words, that's why used this one. How can I prevent this from happening?
Solution 1:[1]
You need to specify the input encoding for the umlaut, and tell LaTeX which language this is so that it knows how to hyphenate.
With these I get "überwachen" hyphenated:
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
Solution 2:[2]
There are several options to solve a problem like this:
In this instance
\usepackage{ngerman}
was a solution, because "überwachen" is a German word.In other instances where this would not work, it is possible to use
\hyphenation{über-wachen}
, in this instance together with\usepackage[T1]{fontenc}
to be able to use German Umlaute.For other (German) words
\usepackage[ngerman]{babel}
worked.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Robert |
Solution 2 |