Skip to content

Instantly share code, notes, and snippets.

@humburg
Created August 28, 2015 14:51
Show Gist options
  • Save humburg/f39efe7597d4004a92a3 to your computer and use it in GitHub Desktop.
Save humburg/f39efe7597d4004a92a3 to your computer and use it in GitHub Desktop.
A simple markdown file to test the behaviour of figure captions with knitrBootstrap and rmarkdown.
---
title: Caption test
output:
knitrBootstrap::bootstrap_document:
fig_caption: true
keep_md: true
rmarkdown::html_document:
fig_caption: true
keep_md: true
self_contained: false
---
Figure 1 is a figure without thumbnail.
```{r fig, fig.cap="**Figure 1:** caption", bootstrap.thumbnail=FALSE}
plot(1:10)
```
Figure 2 uses thumbnailing.
```{r fig2, fig.cap="**Figure 2:** caption", bootstrap.thumbnail=TRUE}
plot(10:1)
```
The third chunk generates two plots and prints them at the end.
```{r fig3, fig.cap="**Figure 3:** caption", bootstrap.thumbnail=TRUE, fig.show="hold"}
plot(10:1)
plot(1:10)
```
The final code chunk also produces two plots but prints them as they are generated.
```{r fig4, fig.cap="**Figure 4:** caption", bootstrap.thumbnail=TRUE}
plot(10:1)
plot(1:10)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment