简体   繁体   English

使用 R Markdown 在文档内交叉引用

[英]Cross-referencing within documents with R Markdown

I have a very simple document in R Markdown.我在 R Markdown 中有一个非常简单的文档。 Here is the code:这是代码:

---
title: "Untitled"
output: html_document
---

# R Markdown {#r-mkdw}


This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. I want to cross-reference the Header of this text with \@ref(r-mkdw).

But the cross-reference as the manual specifies doesn't work.但是手册指定的交叉引用不起作用。

The "standard" rmarkdown package with html_output does not support cross referencing.带有 html_output 的“标准”rmarkdown html_output不支持交叉引用。 You have to use, eg the package bookdown which provides the format html_document2 .您必须使用,例如提供格式html_document2 bookdown

---
title: "Untitled"
output: 
  bookdown::html_document2
---

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM