【发布时间】:2020-04-27 06:20:23
【问题描述】:
标题说明了一切。请参阅下面的最小(非)工作示例。
---
title: "Untitled"
author: "Anonymous"
date: "09/01/2020"
output: bookdown::word_document2
---
# First Section {#sec1}
Etc.
# Second Section
See section \@ref(sec1).
当我编织上述内容时,我收到以下警告:
Output created: mre.docx
Warning message:
The label(s) sec1 not found
输出中的引用替换为两个问号 (??)。当我将 YAML 标头中的输出选项替换为 pdf_document2 时,没有错误。我的template.docx 为所有标题样式启用了部分编号,并且部分编号正确(只是参考文献不正确)。
> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux
Matrix products: default
BLAS: /usr/lib/libblas.so.3.9.0
LAPACK: /usr/lib/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 LC_PAPER=en_GB.UTF-8
[8] LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.2 Matrix_1.2-18 bookdown_0.16 htmltools_0.4.0 tools_3.6.2 yaml_2.2.0 reticulate_1.13 Rcpp_1.0.3 rmarkdown_1.17 grid_3.6.2 knitr_1.26 jsonlite_1.6
[13] digest_0.6.22 xfun_0.11 rlang_0.4.1 lattice_0.20-38 evaluate_0.14
> pandoc --version
pandoc 2.8
Compiled with pandoc-types 1.20, texmath 0.12, skylighting 0.8.3
【问题讨论】:
标签: r rstudio r-markdown pandoc bookdown