-
-
Notifications
You must be signed in to change notification settings - Fork 879
Open
Labels
featureFeature requestsFeature requests
Description
When printing multiple figures per chunk (and maybe in other scenarios with multiple outputs per chunk), figure captions do not show up unless extra line breaks are inserted between them. In the example below, the first and third chunks caption as expected, but the second does not. (This is similar to #820, but it still appears to be an issue.)
---
title: "Test2"
author: "William Denney"
date: "March 14, 2018"
output:
pdf_document:
keep_tex: yes
fig_caption: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
cap_vec <- c("howdy", "foo")
```
# With echo=TRUE
When `echo = TRUE`, the captions print as expected.
```{r fig.cap=cap_vec, echo=TRUE}
plot(pressure)
plot(temperature~1/pressure, data=pressure)
```
\clearpage
# With echo=FALSE
When `echo = FALSE`, the captions do not print.
```{r fig.cap=cap_vec, echo=FALSE}
plot(pressure)
plot(temperature~1/pressure, data=pressure)
```
\clearpage
# With echo=FALSE and new lines
When `echo= FALSE` and new lines are added between figures via cat, it works.
```{r fig.cap=cap_vec, echo=FALSE}
cat("\n\n")
plot(pressure)
cat("\n\n")
plot(temperature~1/pressure, data=pressure)
cat("\n\n")
```
Metadata
Metadata
Assignees
Labels
featureFeature requestsFeature requests