簡體   English   中英

tufte_html 中的交叉引用數字

[英]Cross referencing figures in tufte_html

我正在構建一個tufte::tufte_html ,它應該包含對圖形的交叉引用。 真倒霉,我試了一天都沒有用。

下面,我還嘗試了對bookdown版本的pdf_document2 任何提供的建議在這里都是寶貴的。

---
title: "Repro cross-referencing"
subtitle: "A how to guide"
author: "Deependra Dhakal"
date: "`r Sys.Date()`"
output:
  tufte::tufte_html: default
link-citations: yes
---

```{r setup, include=FALSE}
library(tufte)
# invalidate cache when the tufte version changes
knitr::opts_chunk$set(tidy = FALSE, cache.extra = packageVersion('tufte'))
options(htmltools.dir.version = FALSE)
```

# Introduction

This is just an example

```{r examp-fig, fig.width=10, fig.cap="\\label{fig:examp-fig}Not a good caption"}

plot(2:5, 5:8)
```


## Try referencing here

Through the figure [@fig:examp-fig], I am trying to demonstrate how cross referencing works. But apparently this doesn't work.

Is this any better? The figure \@ref(fig:examp-fig) is being referenced here. Naaah!

您可以使用 bookdown 包。 在這種情況下,您必須在 yaml 序言中添加以下“輸出”選項:

output:
  bookdown::tufte_html2: default

我認為這應該有效!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM