Примечание: эта проблема не возникает в Windows.
Пост Github: https://github.com/rstudio/rmarkdown/issues/1787
TO C из html от Rmarkdown добавляет странная нумерация несмотря на {-}
в Linux
---
title: "Chapter 5 Contents"
output:
html_document:
toc: true
toc_depth: 2
pandoc_args: ["--number-offset=4"]
---
# Chapter
## Section
<!-- references should be seen without number in TOC -->
# References of chapter 5 {-}
(see unwanted number 4 in TOC)
В результате html показывает: 4. References
. Должно быть: References
из-за {-}
Обходной путь (внутри R - bash - linux)
system("sed -z 's/toc-section-number\">4/toc-section-number\">/g' -i path/filename.html")
Сессия
xfun::session_info('rmarkdown')
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 19.10, RStudio 1.2.5033
Locale:
LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
Package version:
base64enc_0.1.3 digest_0.6.25 evaluate_0.14 glue_1.3.2 graphics_3.6.3 grDevices_3.6.3 highr_0.8 htmltools_0.4.0 jsonlite_1.6.1
knitr_1.28 magrittr_1.5 markdown_1.1 methods_3.6.3 mime_0.9 Rcpp_1.0.4 rlang_0.4.5 rmarkdown_2.1.1 stats_3.6.3
stringi_1.4.6 stringr_1.4.0 tinytex_0.20 tools_3.6.3 utils_3.6.3 xfun_0.12 yaml_2.2.1
Pandoc version: 2.9.2