德国引号在tinytex / rmarkdown中被破坏-即使使用软件包`csquotes`

问题描述 投票:3回答:1

我想要的:

我想在MacOS(Catalina)上通过rmarkdown和tinytex在TeX-PDF中加德国引号。参见例如:

enter image description here

问题:

它过去一直遵循准则as proposed here。但是现在,它停止工作了。我只得到英文引号,但not德语的引号:

enter image description here

我尝试过的事,没有成功

  • 我更新了我的R包
  • 我更新了TeX软件包
  • 我检查是否已安装TeX软件包“ csquotes”
  • 我将语言从“ de”更改为“ de-De”

R代码

---
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:

  • R版本3.6.0(2019-04-26)
  • 平台:x86_64-apple-darwin15.6.0(64位)
  • 在以下环境下运行:macOS 10.15.2
  • tinytex v0.18
  • TeX 3.14159265(TeX Live 2019)
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  

编辑

根据下面的@RalfStubner的建议,这是由上面的代码编译的TeX-File的最小可复制版本:

\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}

代码确实可以编译-但问题仍然存在(没有德语引号,只有英语引号:

enter image description here

r localization r-markdown quotes tinytex
1个回答
0
投票

感谢@NMarkgraf,我才知道此解决方案确实有效:

---
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. 

所以,重点是添加一个值csquotes的YAML变量yes

© www.soinside.com 2019 - 2024. All rights reserved.