【问题标题】:Formatting bookdown theorem environment titles (e.g, example) using (ref:foo)使用 (ref:foo) 格式化 bookdown 定理环境标题(例如,示例)
【发布时间】:2020-05-09 02:59:31
【问题描述】:

advice in bookdown for formatting long figure captions and other text is to create a reference

(ref:foo) Title with _formatting_.

上下各空一行,然后在图题中引用这个。

但是,在编织到 pdf 时,我无法像 example 那样为 theorem environments 工作。

可重现的例子:

---
title: "Table test"
output:
  bookdown::pdf_document2:
    keep_tex: true
---

# Test

(ref:foo) This is a test.

```{exercise revision1, echo = T, name="(ref:foo)"}
Some exercise description. 
```

编成 pdf 格式时:

rmarkdown::render("test.rmd")

结果,

Exercise 1.1 ((ref:foo)). Some exercise description.

【问题讨论】:

  • 您能告诉我们您文件的 YAML 部分吗?我认为您需要设置output: bookdown::pdf_document2

标签: r r-markdown knitr bookdown


【解决方案1】:

This is a bug in bookdown 我在 Github 上 just fixed。现在,你可以试试bookdown的开发版:

remotes::install_github(c('yihui/knitr', 'rstudio/bookdown'))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-30
    • 1970-01-01
    • 2018-08-28
    • 2023-03-22
    • 2021-01-30
    • 2022-11-10
    相关资源
    最近更新 更多