gpt4 book ai didi

r - 在 YAML `in_header:` 中包含多个文件

转载 作者:行者123 更新时间:2023-12-04 09:40:41 25 4
gpt4 key购买 nike

在一个 . rmd用于使用 YAML 行进行干净编译的文档,

output:
pdf_document:
fig_caption: yes
keep_tex: yes
number_sections: yes
includes:
in_header: mystyles.tex spacing.tex
...

我现在收到类似 mystyles.tex spacing.tex cannot be found 的 pandoc 错误
我现在使用 R 3.3.2 和 R Studio 1.0.153。我还尝试了其他几种形式(给出了不同的错误):
        in_header: "mystyles.tex" "spacing.tex"

in_header: mystyles.tex
in_header: spacing.tex

如果我合并到两个文件中的 LateX 代码,它就可以工作,只需使用
        in_header: mystyles.tex
in_header 中多个文件的语法是什么?线?有没有改变?

最佳答案

您必须对向量(数组)使用 YAML 语法。任何一个

includes:
in_header: ["mystyles.tex", "spacing.tex"]

或者
includes:
in_header:
- mystyles.tex
- spacing.tex

应该没事。请记住在 in_header 下正确缩进列表在后一种情况下。

关于r - 在 YAML `in_header:` 中包含多个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45259024/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com