【发布时间】:2021-10-16 01:14:19
【问题描述】:
此问题与Is there a way to keep LaTeX citation keys in .tex file when knitting r-markdown to PDF 有关。使用 natbib 和 xelatex 导致文本引用带有方括号,例如 [First et al., 2020] 但我需要圆括号:(First et al., 2020)。切换不同的乳胶引擎或pdf_document 或pdf_document2 不会改变这种行为。
比起pdf_document,我更喜欢pdf_document2 来容纳我的一些桌子。这是我的yaml
title: "abc"
output:
bookdown::pdf_document2:
keep_tex: true
toc: false
latex_engine: lualatex
citation_package: natbib
bibliography: ref.bib
csl: apa-no-ampersand.csl
正如https://tex.stackexchange.com/questions/466819/use-round-brackets-instead-of-square-brackets-in-natbib-citations 所说,我可以编辑我的 .tex 文件以设置括号样式,将其上传到 tex 处理程序,然后下载 pdf,但效率很低。
非常感谢任何直接从 R 中直接在圆括号中呈现文本引用的线索。
【问题讨论】:
-
你能制作一个可编译的minimal reproducible example,它实际上包含要测试的引用吗?
-
您可能想在标题中添加类似
\renewcommand\NAT@open{(} \renewcommand\NAT@close{)}的内容,但没有minimal reproducible example 进行测试,这只是猜测...
标签: latex r-markdown bookdown tex citations