【问题标题】:Cross referencing figures in tufte_htmltufte_html 中的交叉引用数字
【发布时间】:2018-02-05 01:55:15
【问题描述】:

我正在构建一个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!

【问题讨论】:

    标签: html r knitr bookdown tufte


    【解决方案1】:

    您可以使用 bookdown 包。在这种情况下,您必须在 yaml 序言中添加以下“输出”选项:

    output:
      bookdown::tufte_html2: default
    

    我认为这应该可行!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-14
      • 2018-05-02
      • 2011-11-24
      • 2012-01-12
      • 1970-01-01
      • 2018-08-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多