小编tel*_*lis的帖子

如果横向太长,Bookdown 图标题会失败?

我有一个足够大的图,需要在 RStudio 中使用 (PDF) bookdown 在纵向文档中绘制横向图。该图发生了很多事情,因此图标题很长,我无法进一步减少文本。

这是我一直在使用的示例代码:

```{r qtl-pleiotropy, out.extra='angle=90', fig.width=25/2.54, fig.height=16.9/2.54, 
     fig.cap="QTL for fruit number per reproductive plant (Fruits/RP), seed number per fruit (Seeds/fr), seed number per reproductive plant (Seeds/RP), seed mass (Sd mass) and survival (Surv). Arrows indicate most-likely QTL position with the 95% Bayesian credible intervals, and the effect of the Swedish genotype (upward: increased phenotype; downward: decreased phenotype) in Italy (red) and Sweden (blue). Open arrows show QTL with credible intervals >15.2cM. Labels on the right …
Run Code Online (Sandbox Code Playgroud)

r knitr r-markdown reproducible-research bookdown

5
推荐指数
1
解决办法
681
查看次数

Bookdown:另一个文件中的交叉参考图

我已经冒险尝试并准备使用 bookdown 完全在 RStudio 中出版的手稿。在正文中,我想在单独的支持信息 .Rmd 文件中交叉引用数字。

假设这是我的主要文本文件,名为main.Rmd

---
title: "Main text"
output:
  bookdown::pdf_book:
    toc: no
---
Here is the main text file. I would like to refer to \@ref(fig:supporting-figure).
Run Code Online (Sandbox Code Playgroud)

这是名为 的支持文本supporting.Rmd和要参考的图,保存在同一文件夹中:

---
title: "Supporting info"
output:
  bookdown::pdf_book:
    toc: no
---

Here is the supporting text.

```{r supporting-figure}
plot(cars)
```
Run Code Online (Sandbox Code Playgroud)

如何supporting-figure在正文中交叉引用?

我已经检查了 Yihui's bookdown manual 中有关交叉引用的部分,但我看不出如何将其扩展到文件之间的交叉引用。

我还发现了这个问题: Cross-reference figure in a separate Rmarkdown (PDF) file 但接受的答案对我不起作用(也许是因为我使用的是 bookdown 而不是 base Rmarkdown?)

r literate-programming cross-reference r-markdown bookdown

0
推荐指数
1
解决办法
842
查看次数