title | lof |
---|---|
short-captions.lua |
true |
For latex output, this filter uses the attribute short-caption
for
figures so that the attribute value appears in the List of Figures, if
one is desired.
Where you would have a figure in, say, markdown as

You can now specify the figure as
{short-caption="a short caption"}
If the document metadata includes lof:true
, then the List of Figures
will use the short caption. This is particularly useful for students
writing dissertations, who often have to include a List of Figures in
the front matter, but where figure captions themselves can be quite
lengthy.
pandoc --lua-filter=short-captions.lua article.md -o article.tex
pandoc --lua-filter=short-captions.lua article.md -o article.pdf
@Fig:shortcap is an interesting figure with a long caption, but a short caption in the List of Figures.
{#fig:shortcap short-caption="A short caption with
math
- The filter will process the
short-caption
attribute value as pandoc markdown, regardless of the input format. - It does not work for tables and listings yet.
- But it works with pandoc-crossref, regardless of the order of application.