I use the following three packages to get correct German umlauts in the generated PDF:
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
Today, I have seen this:
\usepackage[german]{babel}
What's the difference between ngerman
and german
? I think n
could probably mean new, but which one should I use? Do you have an example where it matters?
inputenc
makes sure the umlauts etc. in the source are read correctly;babel
makes sure the correct hyphenation patterns are used and changes the language of text strings like Table of Contents;fontenc
changes the font encoding in the PDF, otherwise anä
would be created as a combination ofa
and¨
, which looks worse and makes copy-paste harder. For my "German" setup, I usually also uselmodern
(Latin Modern) as a font (the alternative is installing thecm-super
package, which is then automatically used byfontenc
), cf. tex.stackexchange.com/a/65103.