gpt4 book ai didi

knitr - 将 rmarkdown 文档编织到投影仪演示文稿时如何使用不同目录中的引用书目?

转载 作者:行者123 更新时间:2023-12-04 16:11:05 26 4
gpt4 key购买 nike

我正在 Windows 7 PC 上的 Rstudio 中的 RMarkdown 脚本中编织一些投影仪幻灯片。幻灯片在目录中

C:/me/slides/myslides.Rmd

我有一本主要引用书目
C:/me/bib/masterbib.bib

我无法弄清楚如何从 RMarkdown 文档链接到引用书目文件。这是我尝试的 YAML:
---
title: "Slides"
author: "me"
date: "2016-12-20"
bibliography: C:/me/bib/masterbib.bib
biblio-style: "apalike"
output:
beamer_presentation:
citation_package: natbib
---

这是错误:
! Undefined control sequence.
<write> \string \bibdata {C:\me\bib\masterbib}
l.174 \end{frame}

Error: Failed to compile Slides.tex. See Slides.log for more info.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "Slides.tex"' had status 1
Execution halted

我尝试了其他几种方法来指定 masterbib.bib 的目录,但都没有奏效。我宁愿保留 masterbib.bib文件所在的位置,而不是在 C:/me/slides/ 中制作额外的副本目录。谢谢你的帮助!

编辑

尝试将以下内容传递到 YAML 时(用正斜杠引用):
bibliography: "C:/LaTeXstuff/BibTexLibrary/BrianBib.bib"
我收到日志输出的 fatal error :
! Undefined control sequence.
<write> \string \bibdata {C:\me
\bib\masterbib}
l.174 \end{frame}

Here is how much of TeX's memory you used:
18047 strings out of 494045
334241 string characters out of 3145937
424206 words of memory out of 3000000
20891 multiletter control sequences out of 15000+200000
31808 words of font info for 44 fonts, out of 3000000 for 9000
715 hyphenation exceptions out of 8191
56i,11n,55p,434b,376s stack positions out of 5000i,500n,10000p,200000b,50000s

! ==> Fatal error occurred, no output PDF file produced!

将以下内容传递到 YAML 时(用反斜杠引用)
bibliography: "C:\me\bib\masterbib.bib"
我在 Rstudio 控制台中收到以下错误
Error in yaml::yaml.load(enc2utf8(string), ...) : 
Scanner error: while parsing a quoted scalar at line 4, column 15found unknown escape character at line 4, column 29
Calls: <Anonymous> ... yaml_load_utf8 -> mark_utf8 -> <Anonymous> -> .Call
Execution halted

将以下内容传递到 YAML 时(不带反斜杠引号)
bibliography: C:\me\bib\masterbib.bib
我在 Rstudio 控制台中收到以下错误
! Undefined control sequence.
<write> \string \bibdata {C:\me
\bib\masterbib}
l.174 \end{frame}

Error: Failed to compile BibTest.tex. See BibTest.log for more info.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "BibTest.tex"' had status 1
Execution halted

最佳答案

尝试用两个反斜杠不加引号:

...    
bibliography: C:\\me\\bib\\masterbib.bib
...

关于knitr - 将 rmarkdown 文档编织到投影仪演示文稿时如何使用不同目录中的引用书目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41250648/

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