-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Text references don't seem to work if the text is split in multiple lines.
Example: Create a new bookdown project and go to 02-cross-refs.Rmd
in the sample book and change the first figure to this:
(ref:caption) Here is a nice figure!
```{r nice-fig, fig.cap='(ref:caption)', out.width='80%', fig.asp=.75, fig.align='center', fig.alt='Plot with connected points showing that vapor pressure of mercury increases exponentially as temperature increases.'}
par(mar = c(4, 4, .1, .1))
plot(pressure, type = 'b', pch = 19)
```
As expected, text reference works and the caption is rendered where it should be:
Now add a new line:
(ref:caption) Here is a nice figure!
And this is a second sentence.
```{r nice-fig, fig.cap='(ref:caption)', out.width='80%', fig.asp=.75, fig.align='center', fig.alt='Plot with connected points showing that vapor pressure of mercury increases exponentially as temperature increases.'}
par(mar = c(4, 4, .1, .1))
plot(pressure, type = 'b', pch = 19)
```
The text reference is still a single paragraph so, according to the documentation, it should still work. However, the ouput doesn't show the correct caption:
This seems to be an issue for HTML (gitbook and epub) and word formats. PDF renders correctly.
Metadata
Metadata
Assignees
Labels
No labels