gpt4 book ai didi

latex - 在编译为 PDF 和 HTML 的 R Markdown 文件中使用高级引用命令(例如,来自 biblatex/natbib 的 citetitle、citeauthor、footcite)

转载 作者:行者123 更新时间:2023-12-04 11:29:01 24 4
gpt4 key购买 nike

两者 natbibbiblatex提供多种命令来插入引文。
但是,在 R markdown 中似乎只有少数可用。 :


描述
R Markdown
natbib 命令
biblatex 命令


经典引文:作者、年份和括号(根据引文风格使用圆括号或方括号)[@key]\citep{key}\parencite[Prefix][Suffix]{key}
文本内引用:作者(年份)(不带方括号或带括号,具体取决于引用样式)@key\citet{key}\cite[Prefix][Suffix]{key}
仅年份/抑制作者:(年份)[-@key]\citeyear{key}\citeyear[Prefix][Suffix]{key}
在引用书目中包含项目而不在文档中引用它
Unused References (nocite)\nocite{key}\nocite{key}

通常人们想使用更高级的命令,例如只引用作者并压制年份。
有没有办法在 R markdown 文档中添加和使用以下 cite 命令以多种输出格式编译,特别是 PDF 和 HTML?

\citetitle{key} Returns the title of the source.
\citeauthor{key} Returns the author(s) of the cited source.
\footcite{key} Creates a footnote within the document.
\fullcite{key} Creates a complete quote like in the bibliography
\footfullcite{key} Creates a complete citation, as in the bibliography, in a footnote.
相关 SO Q: author only & add possessive 's to in-text citation ; More flexible citation formats

最佳答案

要看。如果你只制作PDF文档,那么你可以使用natbib或biblatex directly并使用原始的 LaTeX 命令。

---
output:
pdf_document:
citation_package: biblatex
---

Show just the author of citation with ID "rick": \citeauthor{rick}
但这适用于 PDF 输出 只有 .

其他格式很棘手。 R Markdown 使用 citeproc基于 Citation Style Language (CSL) 中编写的定义处理和样式引用的处理器.有些事情可以通过这种方式控制,例如一致地使用脚注作为引用。 CSL 不支持其他选项,例如仅作者引用。
理论上,您可以使用 pandocfiltersLua filters破解你自己的插件,扩展引用语法。但这可能比它的值(value)更麻烦。

关于latex - 在编译为 PDF 和 HTML 的 R Markdown 文件中使用高级引用命令(例如,来自 biblatex/natbib 的 citetitle、citeauthor、footcite),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63575070/

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