5

I write a presentation in German language, so I use

\usepackage[ngerman]{babel}

Now, I want to write "UTF-8" but the output looks like that:

scrrenshot

How can I fix it?

Thank you for your help!

MWE:

\documentclass{beamer}

\usetheme{Boadilla}

\usepackage[ngerman]{babel}

\begin{document}

    \begin{frame}
        \texttt{"UTF-8"}
    \end{frame}

\end{document}
  • 5
    "{}UTF-8" if you want to keep using shorthands in the rest of your document. – user36296 Jan 9 at 15:07
  • \verb|"UTF-8"| would work as well but might require fragile setting on the frame. – Martin Scharrer Jan 12 at 13:31
7

The " character is defined as a shorthand for \" which is why you get the umlaut on the U. Assuming you are writing umlauts directly in your source anyway, you likely don't need the shorthand, so the easiest solution is to turn it off. You can do this by adding the shorthands = off option to babel:

\documentclass{beamer}

\usetheme{Boadilla}

\usepackage[ngerman,shorthands=off]{babel}

\begin{document}

    \begin{frame}
        \texttt{"UTF-8"}
    \end{frame}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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