markdownpandocrestructuredtextcross-reference

Reference to figure and table numbers with Pandoc


I'm trying to make a document with Markdown/restructuredText which will be converted with pandoc to PDF using xelatex.

I would like to return reference to figure and tables numbers in the text body.

In both Markdown and reSt markup languages, the cross reference return a link to the figure but not the figure number.

for example [the figure](#myfig) with markdown or myfig_ with reST links to the figure but don't automaticly update the figure number.

Is it possible with Markdown or ReST markup languages to refer to figure and tables number?


Solution

  • I suggest using the pandoc-crossref filter with pandoc. The demo gives you a good idea of the syntax. You invoke it by calling pandoc with --filter pandoc-crossref.