Search code examples
localizationr-markdowntextinytex

Germany quotation marks broken in tinytex/rmarkdown


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:

enter image description here

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:

enter image description here

What I tried, without success:

  • I updated my R packages
  • I updated TeX packages
  • I checked that the TeX package "csquotes" is installed
  • I changed the language from "de" to "de-De"

R-Code:

---
title: "German quotation marks"
output: pdf_document
---

"Das ist sehr schön", sagte sie. 


Solution

  • The R Markdown package used to provide its own template, which used csquotes.sty. Nowadays the default pandoc template is used, which does not seem to use csquotes. You can call for it manually, though:

    ---
    title: "German quotation marks"
    output: 
        pdf_document:
            keep_tex: yes
    lang: de-DE
    header-includes:
        - \usepackage{csquotes}
    ---
    
    "Das ist sehr schön", sagte sie. 
    

    Result:

    enter image description here