Closed BAMIP closed 2 years ago
shorthands like "
are only activated at the begin of the document. Either move your definitions behind \begin{document}
or activate them:
\documentclass[a4paper,12pt]{article}
\usepackage[german]{babel}
\shorthandon{"} %<-------
\newcommand{\damals}{5. M"arz 2018}
\newcommand{\betr}{Zahlungs"ubersicht}
\begin{document}
{\damals}
{\betr}
\end{document}
But I would type the umlauts directly (assuming a current latex and a file encoded in utf8)
\newcommand{\damals}{5. März 2018}
\newcommand{\betr}{Zahlungsübersicht}
Another alternative is:
\newcommand{\damals}{5. M\babelshorthand{"a}rz 2018}
\newcommand{\betr}{Zahlungs\babelshorthand{"u}bersicht}
Useful with shorthands like "-
(see the example in section 1.10 of the babel
manual), but definitely clumsy with letters. The best option, by far, is the one proposed by @u-fischer, namely, type directly ä
and ü
.
Sir,
\documentclass[a4paper,12pt]{article} \usepackage[german]{babel} \newcommand{\damals}{5. M"arz 2018} \newcommand{\betr}{Zahlungs"ubersicht} \begin{document} {\damals} {\betr} \end{document}
will produce
The correct compilation should produce
Is this a babel bug or an issue in my latex-file?
Thank you,
Michael