【发布时间】:2020-03-23 17:57:07
【问题描述】:
我觉得这是一件直截了当的事情,但我发现的一切并不能完全满足我的需求。我正在使用rmarkdown 并编织到latex .pdf。我想让我的文本引用有round () 括号而不是块括号。下面的yaml 使用references.bib 文件来正确导入引用。有什么办法可以轻松地将括号更改为圆吗?
---
title: "Title"
author: "Author"
date: "16/03/2020"
output:
pdf_document:
fig_caption: yes
citation_package: natbib
bibliography: references.bib
editor_options:
chunk_output_type: console
---
我使用了here的方法,但是它返回一个错误:
Error in yaml::yaml.load(..., eval.expr = TRUE) : Parser error: while parsing a block mapping at line 6, column 5 did not find expected key at line 7, column 30` --- title: "Title" author: "Author" date: "16/03/2020" output: pdf_document: fig_caption: yes bibliography: references.bib editor_options: chunk_output_type: console \usepackage[round]{natbib} ---
有什么想法吗?感谢您的建议/想法...
【问题讨论】:
-
您不能在 rmarkdown 标头中使用方括号。一种解决方法是将命令“隐藏”在头文件中。参见例如stackoverflow.com/a/58673002
-
对不起,我没有关注你的其他答案。
-
如果你将
\usepackage[round]{natbib}保存在一个名为preamble.tex的文件中,你可以将includes: in_header: preamble.tex添加到你的markdown文档中 -
如果您可以创建一个 minimal reproducible example 来实际引用某些内容并包含运行它所需的围兜条目,我可以尝试制作一些工作代码示例
标签: rmarkdown latex yaml r latex r-markdown citations