pandoc-shortcaption
is a pandoc filter for adding short captions to images in LaTeX output, i.e. \caption[Short caption]{Long caption}
. For images, the alternate text is used to generate the short caption, but for tables the first sentence is used.
pip install pandoc-shortcaption
or
python setup.py install
![This is a long image caption](img.png "Image Short Caption")
Compile with
pandoc -f markdown -t latex --filter pandoc-shortcaption test.md
If you would like to use with pandoc-crossref, then add that filter afterwards.
![long caption again](img.png "short caption"){#fig:myfig2}
Here is a reference to @fig:myfig2.
You can also add a width in percent (no other units supported as of now).
![long caption again](img.png "short caption"){#fig:myfig2 width=60%}
Compile with
pandoc -f markdown -t latex --filter pandoc-shortcaption --filter pandoc-crossref test.md
Inspired by Template for writing a PhD thesis in Markdown.