为一篇新的会议文章做准备,我想使用rticle并利用bookdown的交叉引用功能。这最初在使用标准方程和交叉引用示例(例如,https://bookdown.org/yihui/bookdown/cross-references.html的比较)时失败。
原始错误消息为:
! Undefined control sequence.
l.430 See equation \eqref
{eq:linear} for more insights. 消除了交叉引用指针\@ref(eq:linear)使编织完成。然而,我-显然-失去了方程的交叉引用。
在更新所有R包之后,Rmd被编织而不会抛出错误。但是,交叉引用不会自动插入,而是打印\@ref(eq:linear)。
我假设这个问题与针织过程中如何处理这些引用(又称控制序列)有关。:(我不知道如何处理这件事。
这个SO- which Cross-referencing in rticles提供了指向官方文档的指针,示例就是从这些文档中继承过来的。
感谢您向我介绍了如何格式化公式引用。
---
title: "rticles fails knitting equation references"
keywords: ["keyword 1", "keyword 2"]
abstract: |
The abstract goes here.
On multiple lines eventually.
## hook up rticles as base format with bookdown for referencing, etc
output:
bookdown::pdf_book:
base_format: rticles::ieee_article
---
Introduction
=============
To add math, I do the following
See equation \@ref(eq:linear) for more insights.
\begin{equation}
a + bx = c (\#eq:linear)
\end{equation}
More cool text.发布于 2020-08-11 18:49:18
使用\eqref引用公式需要amsmath Tex软件包。
对于这种特定格式的ieee_article,amsmath的使用是以pandoc变量为条件的。您需要在yaml标头中添加以下内容
with_amsmath: true您可以在格式输出中使用extra_dependencies参数为任何rmarkdown格式添加任何Tex包。
在这里它也可以像这样工作
output:
bookdown::pdf_book:
base_format: rticles::ieee_article
extra_dependencies: amsmath(但这里不建议遵循IEEE的要求,因为模板包含了amsmath的配置)
https://stackoverflow.com/questions/61247849
复制相似问题