【发布时间】:2020-04-26 17:53:14
【问题描述】:
我想要什么:
我想在 MacOS (Catalina) 上通过 rmarkdown 和 tinytex 在我的 TeX-PDF 中添加德语引号。例如:
问题:
它曾经按照as proposed 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.
会话信息:
- 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 文件的最小可复制版本:
\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}
代码确实编译了 - 但问题仍然存在(没有德文引号,只有英文引号):
【问题讨论】:
-
使用
keep-tex: yes,您将获得一个可以独立检查的.tex文件: 1. 验证编译.tex是否会重现该问题。 2. 通过从.tex文件中删除不需要重现问题的任何内容来生成minimal reproducible example。 3.Edit你的问题包括最小的.tex。 -
顺便说一句,只有当
.tex文件中存在工作解决方案的最低限度时,这种减少才有意义:包babel和csquotes以及选项ngerman。跨度>
标签: r localization r-markdown quotes tinytex