You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Supporting short figure/table captions for list of figures/tables #543
The captions of figures or tables often need to be long in order to provide the reader with an accurate explanation about what is being shown.
To prevent the list of figures from becoming too difficult to read, LaTeX is offering an optional argument in the \caption[short description for list of figures/tables]{Here comes the full explanation, which can consist of multiple sentences. This is particularly useful when having multiple subfigures.}.
As far as I can see, there is no way to map a figure caption written in R Markdown/knitr to this macro.
However, I think this would be both, helpful and technically feasible.
Please note that there is already some discussion in the development of pandoc to implement such a feature (jgm/pandoc#2417).
Hi Yihui,
Thanks a lot for your quick supply. This is awesome.
I hadn't found any documentation on the fig.scap option and thought this would be needed to be implemented first.
Hello, sorry for re-opening this issue.
For figures, short captions work very well.
For tables, I can't see such an option. Is there a way to get short captions for tables?
Thanks a lot for your quick answer.
Doesn't kable() have an argument caption.short() (see yihui/knitr#1199 for details)?
The issue rather is with Markdown tables in bookdown. For them, I would use something like Table: and don't see a simple way how to add a short caption.
WAT? I had implemented it two years ago? I totally forgot it!
You are right that there is no way to specify short captions with Markdown tables. Your only options are: (1) file a feature request to Pandoc; or (2) use knitr::kable(..., caption.short = ...).
Activity
yihui commentedon Mar 8, 2018
I believe this should work:
out.extra=''is just a token to let knitr render LaTeX code for your figure; it is not required when you have specifiedout.widthorfig.align.Of course, this will only work for LaTeX/PDF output.
yihui commentedon Mar 8, 2018
BTW, next time please try to ask questions on StackOverflow instead. You may also try the RStudio Community. Thanks!
wuffi commentedon Mar 8, 2018
Hi Yihui,
Thanks a lot for your quick supply. This is awesome.
I hadn't found any documentation on the
fig.scapoption and thought this would be needed to be implemented first.yihui commentedon Mar 8, 2018
It is not easy to discover all knitr features. I want to bring happy surprises to users for decades. Just kidding. 😀
wuffi commentedon Apr 24, 2018
Hello, sorry for re-opening this issue.
For figures, short captions work very well.
For tables, I can't see such an option. Is there a way to get short captions for tables?
yihui commentedon Apr 24, 2018
Not for now, e.g.,
knitr::kable()does not have an argument for short captions.wuffi commentedon Apr 24, 2018
Thanks a lot for your quick answer.
Doesn't
kable()have an argumentcaption.short()(see yihui/knitr#1199 for details)?The issue rather is with Markdown tables in bookdown. For them, I would use something like
Table:and don't see a simple way how to add a short caption.yihui commentedon Apr 24, 2018
WAT? I had implemented it two years ago? I totally forgot it!
You are right that there is no way to specify short captions with Markdown tables. Your only options are: (1) file a feature request to Pandoc; or (2) use
knitr::kable(..., caption.short = ...).wuffi commentedon Apr 24, 2018
Thanks for your reply and having implemented it in
kable.I think this is what I will use.
github-actions commentedon Nov 6, 2020
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.