Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have included the ngerman package and I write

\hyphenation{An-fangs-n"a-he-rung}

into the preamble of my document. However, latex complains with

!Improper \hyphenation will be flushed.
\grmn@OTumplayt ->\protect
                           \newumlaut
l.3 \hyphenation{An-fangs-n"a
                             -he-rung}
?

How can I fix this? By the way: I'm using the document class scrartcl.

EDIT: The following minimal not-working example leads to this error message:

\documentclass{scrartcl}
\usepackage{ngerman}
\hyphenation{An-fangs-n"a-he-rung}
\begin{document}
Es soll das Wort names Anfangsn"aherung richtig getrennt werden. 
\end{document}
share|improve this question
1  
Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Kurt Jun 17 '13 at 10:33
    
I will do that. –  Ralph Tandetzky Jun 17 '13 at 10:41
    
As far as I know, there is no solution. Have a look for example here: forkosh.com/latex/ltx-244.html –  bene Jun 17 '13 at 10:57
    
@bene hyphenation should just work, see the answers posted. –  David Carlisle Jun 17 '13 at 11:46
2  
Instead of the obsolete ngerman package it's better to load \usepackage[ngerman]{babel} –  egreg Jun 17 '13 at 12:23
show 1 more comment

2 Answers

up vote 7 down vote accepted

You need to enable an encoding that has the accented letters, then that word appears to be hyphenated as you wish already using the default hyphenation patterns.

enter image description here

\documentclass[a5paper]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{ngerman}

%\hyphenation{An-fangs-n"a-he-rung}

\begin{document}


\parbox{2pt}{\hspace*{1pt}Anfangsn"aherung richtig}
\end{document}
share|improve this answer
    
What does \usepackage[T1]{fontenc} exactly do? In my viewer the text look just slightly different now. But that might just be a rendering thing. –  Ralph Tandetzky Jun 17 '13 at 11:23
    
@RalphTandetzky It tells LaTeX to use an 8-bit "T1" encoded font family (these are in fact different fonts) in the classic Computer Modern fonts by Knuth there were only base letters and all accents are constructed using the \accent primitive you can not use such constructs in hyphenation patterns. there are several implementations now of "larger" computer modern fonts, you could add \usepackage{lmodern} for example to try the lmodern set. –  David Carlisle Jun 17 '13 at 11:44
add comment

With the following MWE it should work. On my current MikTeX 2.9 it compiles without an error.

I used package babel with option ngerman and added the font encryption and input encryption. As you can see can you now write umlauts in the LaTeX document without shortcuts like \"a or "a.

\documentclass[ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\hyphenation{An-fangs-nä-he-rung}
\begin{document}
Es soll das Wort names Anfangsnäherung richtig getrennt werden. 
\end{document}

Because package ngerman is rather old (1998, see documentation on CTAN) you should better use the maintained package babel with option ngerman (latest document version 2012).

Please have a look on english l2tabu.pdf or german l2tabu.pdf (the german version is newer) for outdated and obsolet packages you should not use longer (but you will still find them in older LaTeX documents ...).

share|improve this answer
    
Oh you just beat me to it:-) In fact \hyphenation appears not to be needed in this case, the default hyphenation pattern gives the same hyphenation points. –  David Carlisle Jun 17 '13 at 11:07
    
@DavidCarlisle I will mark this day red in my calendar ;-) –  Kurt Jun 17 '13 at 11:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.