4

I recently had to switch from OS X to Ubuntu and am having trouble with babel's German hyphenation since.

I am running texlive 2015 on Ubuntu 15.10. I installed both TeX and the German language package from the Ubuntu software center. I do not get any error messages but the hyphenation of very many simple German words is simply wrong. In a long document such as a thesis I cannot fix this manually for each occurence.

On an old Macbook (running Snow Leopard and the latest MacTex) I do not have these problems when I compile the same documents that look so terrible now.

I can see why babel may not be able to hyphenate the long noun I entered the \hyphenation command for in the MWE below but I see no excuses for the shorter words.

\documentclass[11pt,a4paper]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\begin{document}
\hyphenation{Ge-brauchs-an-lei-tung}
Some text. bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung soso weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige enthält Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung enthält weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte enthält richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche enthält enthält bestimmte richtige Gebrauchsanleitung weiche bestimmte richtige Gebrauchsanleitung weiche 
\end{document}

This is what the PDF looks like:

wrong hyphenation

However, we-iche should be wei-che, en-thält should be ent-hält, bes-timmte should be be-stimmte. I know that babel can deal with such simple words because it works just fine on a different computer.

I usually use LyX. However, I created this example in Texmaker - to rule out that LyX settings are the problem - and it still does not work.

What could be the problem? It seems like babel simply ignores the ngerman option and just uses English hyphenation patterns. What am I doing wrong here? I am desperate and groping in the dark as I don't get any error messages that could point to my mistake. The TeX installation on Ubuntu must differ from the one on my old OS X machine, I guess. But how can I fix this?

9
  • Welcome to TeX.SX! Your example works for me. No hyphenation errors in German (TeXLive 2015, daily updated, pdflatex on Linux)
    – user31729
    Mar 4, 2016 at 17:29
  • Thanks for testing it so quickly! This is what I suspected... because it works on a different computer of mine:( I don't know where to start searching for the problem...
    – ernie
    Mar 4, 2016 at 17:31
  • 3
    Are you sure that you have the latest packages of TeXLive? I've heard that there's a 'huge' time lag between publishing of packages and updating in Ubuntu. I suggest to use the net installer for TeXLive rather
    – user31729
    Mar 4, 2016 at 17:33
  • 4
    Load babel with the showlanguages option, ie, \usepackage[ngerman,showlanguages]{babel}. This will write to the log file a list of the languages in the format. Search also that file for other babel related messages. This could provide hints of what's happening. Mar 4, 2016 at 17:38
  • 2
    @ernie: You can either provide a self-answer or ask Javier Bezos to turn his comment into an answer.
    – user31729
    Mar 4, 2016 at 19:09

1 Answer 1

1

It seems, my TeX installation from the Ubuntu Software Center was simply not complete. Babel could not find German hyphenation patterns and used English patterns instead.

Compiling the document with \usepackage[ngerman,showlanguages]{babel} resulted in the following information in its log file:

Package babel Warning: No hyphenation patterns were preloaded for
(babel)                the language `ngerman' into the format.
(babel)                Please, configure your TeX system to add them and
(babel)                rebuild the format. Now I will use the patterns
(babel)                preloaded for english instead on input line 43.

I added whatever was missing by installing the texlive-full package through Synaptic. The package basically installs all TeX-related packages that have not been installed before and thus makes the incomplete Ubuntu install a full install. Then I ran sudo texhash and fmtutil --all and the hyphenation worked.

Apparently, the TeXLive 2015 package that is available from Ubuntu's Software Center does not include German hyphenation patterns for Babel.

I am aware that this is not a perfect solution. Simply installing everything adds a lot of unnecessary data on the harddrive. However, it is a quick fix to the problem without having to go through the trouble of figuring out which particular files are missing, where to get them and where to put them.

Note: This may be a way to make an incomplete install a full install. It does not guarantee that the full install is up to date. As was pointed out to me, there may be a gap between the latest TeX releases and what's available from Ubuntu's servers through Synaptic.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .