LyXProblem with German Hyphenation

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
amplifier
Posts: 10
Joined: Fri Mar 11, 2011 1:51 pm

Problem with German Hyphenation

Post by amplifier »

Hi everyone,

LyX is doing some strange hyphenation of German words... how can I fix that? I just found some non-working suggestions in google :?

Thanks a lot for your help!
Amp
Last edited by amplifier on Wed Aug 17, 2011 12:12 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Problem with German Hyphenation

Post by Stefan Kottwitz »

Hi Amp,

perhaps tell us some more information, such as
  • what you're actually doing, code example,
  • which packages do you use - the multilingual babel package for example?
  • which hyphenation is strange: which word is hyphenated how
  • what google suggestions do you refer to
  • what does it mean they don't work (errors, warnings, effects, changed hyphenation or not)
For now, I would suggest, add to your preamble

Code: Select all

\usepackage[ngerman]{babel}
or choose babel with ngerman (Neue Deutsche Rechtschreibung) in a LyX menu or setting, respectively, and have a look at the babel manual regarding german hyphenation tools (Trennhilfen).

Stefan
LaTeX.org admin
amplifier
Posts: 10
Joined: Fri Mar 11, 2011 1:51 pm

Problem with German Hyphenation

Post by amplifier »

Hi Stefan,

thanks for your help!

My preamble is:

Code: Select all

\usepackage{lmodern}
\usepackage[headsepline, ilines]{scrpage2}
\pagestyle{scrheadings}
\ihead{}
\ohead{\pagemark}
\chead{}
\cfoot{}
Adding your suggestion isn't working.. unfortunately. Words like "einer" are hyphenated as "ein-er" (what is wrong).

Google suggested:

Code: Select all

\usepackage[french,ngerman]{babel}
Funnily the hyphenation works perfectly after that, but all my figures and tables appear in french. Using:

Code: Select all

\selectlanguage{ngerman}
on the first page of my document, brings back the german names for tabels and figures, but the hyphenation is messed up again :(

cheers,
Amp

PS

Code: Select all

\usepackage[german,ngerman]{babel}
isn't working either
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Problem with German Hyphenation

Post by Stefan Kottwitz »

You could use \showhyphens to check hyphenation:

Code: Select all

\showhyphens{einer}
This works fine and wraps ist ei-ner:

Code: Select all

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{lmodern}
\begin{document}
\parbox{0.5cm}{ist einer}
\end{document}
I recommend also to add T1 font encoding:

Code: Select all

\usepackage[T1]{fontenc}
This supports hyphenation in words with umlauts, for example.

Stefan
LaTeX.org admin
amplifier
Posts: 10
Joined: Fri Mar 11, 2011 1:51 pm

Re: Problem with German Hyphenation

Post by amplifier »

Hi Stefan,

thanks for your quick reply!

The hyphenation is working better after I added both of your suggestions. I will teach Lyx all other words with the /hyphenation{} command :)

Have a good night!
Amp
Post Reply