[Tex/LaTex] “ö ü ä ß” in Latex (Mac, German, TeXShop)

font-encodingsgermaninput-encodingsmactexshop

It sounds simple but I have a really heavy issue with the "ö ü ä ß" in Latex.
I use a template from my university, i have a mac and i use TeXShop if that matters.

Within there is a packages.tex with the following
(…)

\usepackage[T1]{fontenc}            % Standard package for selecting font encodings
\usepackage{lmodern}                    % alternative Computer Modern-fonts for computer screens
\usepackage{textcomp}                   % LaTeX support for the Text Companion fonts
(...)

Also I have a thesis.tex with

(...)
\usepackage[utf8]{inputenc}     % Accept different input encodings
\usepackage{ifthen}                     % Conditional commands in LaTeX documents
(...)

Now I tried to use

\usepackage[ngerman]{babel}

as well as

\usepackage[applemac]{inputenc}

but unfortunately it doesn't work. The best case was another error "hyphenation flashed" or something.

\documentclass[
    fontsize=12pt,
    a4paper,
    portrait,                               
    oneside,                                    
    openright,                              
    final,                                          
    titlepage,                                  
    onecolumn,                                  
    bibliography=totoc,
    numbers=noenddot                    
]{scrbook}
\usepackage[T1]{fontenc}        
\usepackage{lmodern}    
\usepackage[utf8]{inputenc}     
\usepackage{ifthen}         
\begin{document}
öä
\end{document}

Now I replaced

\usepackage[utf8]{inputenc}     

with

\usepackage[applemac]{inputenc}

in the minimal working example above and it worked BUT in the other document it still doesn't work 🙁 There it gives me the error (see picture)

error

editor

Best Answer

Based on this LaTeX website, there are following solutions for your problem.

According the subsection "indirekte Eingabe von Umlauten" you can write \"A, \"O, \"U, \"a, \"o, \"u and \ss{} or {\"A}, {\"O}, {\"U}, {\"a}, {\"o}, {\"u} and {\ss} to get german letters.

If you include the german or ngmerman (ngerman has the new hyphentation rules), you can write "A, "O, "U, "a, "o, "u, "s to get the letters.

This is very usefull, if you need to write one or two german letters. But it's not too funny to write a german essay with that notation.

The subsection "direkte Verwendung der Umlaute" gives another solution (for Mac). Just put following lines in your preamble:

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

OR

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

If you know which encoding your editor uses, you can just use that instead. I think that Texmaker is a good cross-plattform editor.

I've tried to make an example, so you can see how it should work. If this example doesn't work, try to write applemac instead of utf8. That should end your problem.

\documentclass[a4paper]{article}

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

%Unimportant
\usepackage[top=2cm,right=2cm,bottom=2cm,left=2cm]{geometry}
\thispagestyle{empty}
\usepackage{verse}


\begin{document}
\null
\vfill
\null

\poemtitle{Die polyglotte Katze}
\settowidth{\versewidth}{in das die Maus vor kurzem kroch,}
\begin{verse}[\versewidth]
Die polyglotte Katze\\
Die Katze sitzt vorm Mauseloch,\\
in das die Maus vor kurzem kroch,\\
und denkt:'Da wart nicht lang ich,\\
die Maus, die fang ich!'\\!


Die Maus jedoch spricht in dem Bau:\\
'Ich bin zwar klein, doch bin ich schlau!\\
Ich rühr mich nicht von hinnen,\\
ich bleibe drinnen!'\\!


Da plötzlich hört sie - statt'miau' -\\
ein laut vernehmliches'wau-wau'\\
und lacht:'Die arme Katze,\\
der Hund, der hatse!\\
Jetzt muß sie aber schleunigst flitzen,\\
anstatt vor meinem Loch zu sitzen!'\\!


Doch leider - nun, man ahnt’s bereits -\\
war das ein Irrtum ihrerseits,\\
denn als die Maus vors Loch hintritt -\\
es war nur ein ganz kleiner Schritt -\\
wird sie durch Katzenpfotenkraft\\
hinweggerafft! - - -\\!


Danach wäscht sich die Katz die Pfote\\
und spricht mit der ihr eignen Note:\\
'Wie nützlich ist es dann und wann,\\
wenn man ’ne fremde Sprache kann ...!'\\
\end{verse}
\bigskip
\centering {\footnotesize \itshape Heinz Erhardt (1909--1979)}\footnote{Höret dieses Gedicht über Kätzchen, welches nie auf den Straßen in Straßburg gehör fand.}

\bigskip


\null
\vfill
\null
\end{document}

Here an image of how it looks

German letters.

NB! As a "Notfallplan" you can use sharelatex or overleaf (free online editors) untill you have fixed your problem.