What I want:
I'd like to have German quotation marks in my TeX-PDF via rmarkdown and tinytex on MacOS (Catalina). See for example:
The problem:
It used to work following the guidelines as proposed here. But now, it stopped working. I only get English quotation marks, but not German ones:
What I tried, without success:
R-Code:
---
title: "German quotation marks"
output:
pdf_document:
keep_tex: yes
lang: de-DE
header-includes:
- \usepackage{csquotes}
---
"Das ist sehr schön", sagte sie.
sessionInfo:
loaded via a namespace (and not attached):
[1] compiler_3.6.0 htmltools_0.4.0 tools_3.6.0 yaml_2.2.0 Rcpp_1.0.3
[6] rmarkdown_2.0 knitr_1.26 xfun_0.11 digest_0.6.23 packrat_0.5.0
[11] rlang_0.4.2 evaluate_0.14
EDIT
Based on the @RalfStubner's suggestion below, here's the minimal reproducible version of the TeX-File that was compiled by the code above:
\documentclass[
ngerman,
]{article}
\usepackage[shorthands=off,main=ngerman]{babel}
\title{German quotation marks}
\author{}
\date{\vspace{-2.5em}}
\begin{document}
\maketitle
``Das ist sehr schön'', sagte sie.
\end{document}
The code did compile - but the problem remained (no German quotes, only English quotes):
Thanks to @NMarkgraf I just learned that this solution does work:
---
title: "German quotation marks"
output:
pdf_document:
keep_tex: yes
lang: de-DE
csquotes: true # THIS IS THE IMPORTANT LINE
header-includes:
- \usepackage{csquotes}
---
"Das ist sehr schön", sagte sie.
So, the point was to add a YAML-variable csquotes
with value yes
.