1

When I create a figure caption with the below method, the whole figure caption is included in the figure list, which is annoying as some figures have a lot in the caption. The figure list is created automatically by bookdown. Is there a way of separating this into something like "figure title" and "figure text", where only the figure title is included in the list?

```{r, fig.cap="\\label{fig:figureOne}Figure caption goes here. This caption is sort of long, but is informative for the figure", echo=FALSE, message=FALSE, fig.align='center'}
knitr::include_graphics("images/figure1.png")
```

This looks like this in the knitted pdf: test Figure 1.1: Figure caption goes here. This caption is sort of long, but is informative for the figure

List of figures then looks like this:

1.1 Figure caption goes here. This caption is sort of long, but is informative for the figure

Is it possible to make it look like this instead:

1.1 Figure caption goes here.

I couldn't find any documentation on subcaptions or figure text other than figure captions.

Haakonkas
  • 961
  • 9
  • 26
  • There are ways but I have to wonder: If you don’t want to include the text then why not just leave it out? – Konrad Rudolph Jul 02 '19 at 14:14
  • I need to have text on the figures for explanation, but I don't want the full text in the figure list, kind of just the name of the figure, not the explanation – Haakonkas Jul 02 '19 at 16:20
  • I understood that. So just add the name, not the explanation, in the RMarkdown code. – Konrad Rudolph Jul 02 '19 at 16:26
  • How would I then add other text to the figure, if not in the caption? – Haakonkas Jul 02 '19 at 16:30
  • @KonradRudolph the figure list is automatically generated since I use bookdown, so I can't manually change what is used as the figure name – Haakonkas Jul 03 '19 at 06:28
  • I like to take charge of the construction of short (for table of figures) and long figure captions, as shown in examples using the `putHcap` function [here](http://hbiostat.org/R/Hmisc/examples.html). – Frank Harrell Jul 03 '19 at 11:46
  • 1
    The solution to [this question](https://stackoverflow.com/questions/69094228/give-a-single-figure-multiple-captions-in-rmarkdown-pdf-book-output) should help with this. – blongworth Mar 24 '22 at 18:58

0 Answers0