我想要的:
我想在MacOS(Catalina)上通过rmarkdown和tinytex在TeX-PDF中加德国引号。参见例如:
问题:
它过去一直遵循准则as proposed here。但是现在,它停止工作了。我只得到英文引号,但not德语的引号:
我尝试过的事,没有成功:
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:
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}
代码确实可以编译-但问题仍然存在(没有德语引号,只有英语引号:
感谢@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
。