mparker2 / pandoc-shortcaption

Adds pandoc filter for short LaTeX captions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pandoc-shortcaption filter

Build Status PyPI version

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.

Installation

pip install pandoc-shortcaption

or

python setup.py install

Basic usage

![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

Acknowledgments and references

Inspired by Template for writing a PhD thesis in Markdown.

About

Adds pandoc filter for short LaTeX captions.

License:GNU General Public License v3.0


Languages

Language:Python 97.3%Language:Makefile 2.7%