虽然officedown
的手册说“ rpptx_document2
还支持基于 bookdown 包的语法的交叉引用”,但实际上没有名为rpptx_document2
的函数,这会停止编织一个有错误的 pptx 文档: Error: 'rpptx_document2' is not an exported object from 'namespace:officedown'
。 由于这个问题,不可能交叉引用图形/表格编号。
---
title: "Week 8"
author: "CLRR"
output:
officedown::rpptx_document2:
keep_md: TRUE
---
## test
Description
sessionInfo()
的结果。R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=Japanese_Japan.932 LC_CTYPE=Japanese_Japan.932 LC_MONETARY=Japanese_Japan.932 LC_NUMERIC=C LC_TIME=Japanese_Japan.932
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] viridis_0.5.1 viridisLite_0.3.0 magrittr_1.5 forcats_0.5.0 stringr_1.4.0 dplyr_1.0.2 purrr_0.3.4 readr_1.4.0 tidyr_1.1.2
[10] tibble_3.0.4 ggplot2_3.3.2 tidyverse_1.3.0
loaded via a namespace (and not attached):
[1] tidyselect_1.1.0 xfun_0.19 haven_2.3.1 colorspace_1.4-1 vctrs_0.3.4 generics_0.1.0 htmltools_0.5.0 yaml_2.2.1
[9] rlang_0.4.8 pillar_1.4.6 withr_2.3.0 glue_1.4.2 DBI_1.1.0 gdtools_0.2.2 dbplyr_2.0.0 modelr_0.1.8
[17] readxl_1.3.1 uuid_0.1-4 lifecycle_0.2.0 munsell_0.5.0 gtable_0.3.0 cellranger_1.1.0 rvest_0.3.6 zip_2.1.1
[25] memoise_1.1.0 evaluate_0.14 labeling_0.4.2 knitr_1.30 fansi_0.4.1 broom_0.7.2 Rcpp_1.0.5 backports_1.2.0
[33] scales_1.1.1 jsonlite_1.7.1 farver_2.0.3 systemfonts_0.3.2 fs_1.5.0 gridExtra_2.3 hms_0.5.3 digest_0.6.27
[41] stringi_1.5.3 officedown_0.2.0.002 grid_4.0.2 cli_2.1.0 tools_4.0.2 crayon_1.3.4 pkgconfig_2.0.3 ellipsis_0.3.1
[49] xml2_1.3.2 rvg_0.2.5 reprex_0.3.0 lubridate_1.7.9 assertthat_0.2.1 rmarkdown_2.5 officer_0.3.15 httr_1.4.2
[57] rstudioapi_0.11 R6_2.5.0 compiler_4.0.2
我的环境中可用的 Pandoc 版本足以生成 pptx 输出。
rmarkdown::pandoc_version()
[1] ‘2.10.1’
packageVersion("officedown")
[1] ‘0.2.0.2’
谢谢,这是一个错误,该文本不应该存在。 现在已经修好了
好的,但是你不支持rpptx_document
中的交叉引用功能,还是已经有这样的补充功能?
不,这不是一项功能,因为它不是 PowerPoint 的一项可能功能 - 您仍然可以使用 bookdown 交叉引用...
你的意思是\@ref(...)
吗?
实际上,以下示例无法交叉引用图形编号。
---
date: "`r Sys.Date()`"
author: "Your Name"
title: "Untitled"
output:
officedown::rpptx_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.cap = TRUE)
library(officedown)
library(ggplot2)
library(rvg)
```
## Slide with Plot
::: columns
:::: column
```{r plot1, fig.cap='pressure'}
plot(pressure)
```
::::
:::: column
\@ref(fig:plot1)
::::
:::
实际上,以下示例无法交叉引用图形编号。
这不是一项功能,因为它不是 PowerPoint 的一项可能功能 - 您仍然可以使用 bookdown 交叉引用。
日期:“ r Sys.Date()
”
作者:《你的名字》
标题:《无题》
输出:
officedown::rpptx_document:
```{r 设置,包括=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.cap = TRUE)
图书馆(officedown)
## Slide with Plot
::: columns
:::: column
```{r plot1, fig.cap='pressure'}
plot(pressure)
::::
:::: 柱子
\@ref(图:情节1)
::::
:::
`````
这是为 PPT 实现的:
该软件包还通过提供一个 R Markdown 增强了 PowerPoint 制作
根据幻灯片中包含的幻灯片模板放置结果的机制
用作“reference_doc”的 PowerPoint 文档。 添加几个变得容易
同一张幻灯片中的内容。
该软件包还提供了转换您的图形说明的可能性
只需将您的
调用函数dml
。
谢谢你给我一个很好的例子。 base_format: bookdown::powerpoint_presentation2
可以解决问题...