R natbib似乎无法与pdf_书籍/文章一起正常工作
在我的.Rmd文件中,我将.bib文件中的位置引用如下:“让我引用一篇文章:[@SampleTitle2016]。” 当我“编织当前”时,我希望有.tex文件,其中引用的文章由\cite、\citep或\citet命令提供 我注意到,如果在输出参数中省略“引文包:natbib”一行,引文将作为原始文本提供: 但是,如果添加上述行,.tex文件看起来更好,但由于某些原因,参考书目无法正确显示/(编译?)-我看到的是“?”而不是正确的引用: 我的.Rmd如下所示:R natbib似乎无法与pdf_书籍/文章一起正常工作,r,r-markdown,bookdown,R,R Markdown,Bookdown,在我的.Rmd文件中,我将.bib文件中的位置引用如下:“让我引用一篇文章:[@SampleTitle2016]。” 当我“编织当前”时,我希望有.tex文件,其中引用的文章由\cite、\citep或\citet命令提供 我注意到,如果在输出参数中省略“引文包:natbib”一行,引文将作为原始文本提供: 但是,如果添加上述行,.tex文件看起来更好,但由于某些原因,参考书目无法正确显示/(编译?)-我看到的是“?”而不是正确的引用: 我的.Rmd如下所示: --- title: "Sam
---
title: "Sample document"
abstract: "This is a sample abstract \\newline This is the second line of abstract \\par \\textbf{Keywords:} keywordA, keywordB"
author:
- name: Mateusz Kędzior
email: alice@example.com
affiliation: Some Institute of Technology
footnote: Corresponding Author
bibliography: bibliography_escaped.bib
output:
bookdown::pdf_book:
base_format: rticles::elsevier_article
keep_tex: true
citation_package: natbib
---
## Sample Text
Let me cite an article: [@SampleTitle2016].
Without natbib, in .tex file citep command is not used in output .tex file.
An with natbib, it seems there's problem with bibliography compilation.
## References
@article{SampleTitle2016,
title = "This is sample title only \{\k{A}\} \{\L{}\}",
journal = "Some journal",
volume = "99",
number = "",
pages = "21 - 31",
year = "2018",
note = "This is fake",
url = "http://ImustChangedThatLinkBecauseSOdoNotALLOWletmeG",
author = "Mateusz K\k{e}dzior and \.{Z}\k{a}\'{c}\l{} \'{Z}\k{e}\'{n}",
keywords = "keywordC",
keywords = "Keyword D",
}
@article{OtherTitle2010,
title = "{{This is different \k{A} title only}}",
journal = "Some journal",
volume = "150",
number = "",
pages = "21 - 31",
year = "2020",
note = "This is fake",
url = "http://someLink/",
author = "\.{Z}\k{a}\'{c}\l{} \'{Z}\k{e}\'{n}",
keywords = "keyword\k{A}",
keywords = "Keyword \'{Z}",
}
我的参考书目文件如下所示:
---
title: "Sample document"
abstract: "This is a sample abstract \\newline This is the second line of abstract \\par \\textbf{Keywords:} keywordA, keywordB"
author:
- name: Mateusz Kędzior
email: alice@example.com
affiliation: Some Institute of Technology
footnote: Corresponding Author
bibliography: bibliography_escaped.bib
output:
bookdown::pdf_book:
base_format: rticles::elsevier_article
keep_tex: true
citation_package: natbib
---
## Sample Text
Let me cite an article: [@SampleTitle2016].
Without natbib, in .tex file citep command is not used in output .tex file.
An with natbib, it seems there's problem with bibliography compilation.
## References
@article{SampleTitle2016,
title = "This is sample title only \{\k{A}\} \{\L{}\}",
journal = "Some journal",
volume = "99",
number = "",
pages = "21 - 31",
year = "2018",
note = "This is fake",
url = "http://ImustChangedThatLinkBecauseSOdoNotALLOWletmeG",
author = "Mateusz K\k{e}dzior and \.{Z}\k{a}\'{c}\l{} \'{Z}\k{e}\'{n}",
keywords = "keywordC",
keywords = "Keyword D",
}
@article{OtherTitle2010,
title = "{{This is different \k{A} title only}}",
journal = "Some journal",
volume = "150",
number = "",
pages = "21 - 31",
year = "2020",
note = "This is fake",
url = "http://someLink/",
author = "\.{Z}\k{a}\'{c}\l{} \'{Z}\k{e}\'{n}",
keywords = "keyword\k{A}",
keywords = "Keyword \'{Z}",
}
不使用
articles::elsevier\u article
作为输出的原因是什么?有了YAML标题中的输出,一切正常。因为我需要参考文档中的图\@ref(图:压力)、表和小节\@ref(小节图)。如果我错了,请纠正我,但只有“bookdown”提供了交叉引用的可能性?我问过这个问题,所以:你可以参考一些图,看看这个例子:`{r plot1,fig.height=5,fig.width=5,fig.cap=“Plot 1\\label{fig:plot1}”Plot(1:10,1:10)
例如,请参见figu\ref{fig:plot1}`我认为这是一个比较好的解决办法,因为你把标签放在了标题中。我在下一期中提到了这一点:但无论如何,感谢您的帮助为什么不使用articles::elsevier\u article
作为输出?有了YAML标题中的输出,一切正常。因为我需要参考文档中的图\@ref(图:压力)、表和小节\@ref(小节图)。如果我错了,请纠正我,但只有“bookdown”提供了交叉引用的可能性?我问过这个问题,所以:你可以参考一些图,看看这个例子:`{r plot1,fig.height=5,fig.width=5,fig.cap=“Plot 1\\label{fig:plot1}”Plot(1:10,1:10)
例如,请参见figu\ref{fig:plot1}`我认为这是一个比较好的解决办法,因为你把标签放在了标题中。我在下一期中提到了这一点:但无论如何,谢谢你们的帮助