Exporting to docx or PDF with figure referencing using pandoc-crossref

I’m trying to do something similar to what has been asked here.

I’m following this article and I got stuck at the section about Figures and Section referencing using Pandoc-crossref.

  • I’m using windows.
  • I’ve installed pandoc, added it to the PATH and placed the pandoc-crossref.exe in the same folder as pandoc.
  • I’ve installed the obsidian plugin- Enhancing Export
  • I’ve added –filter pandoc-crossref in the extra arguments field in the export to word setting of that plugin. Everything else is set to default (no bibliography or anything else).
  • For testing, I’m using the example markdown file provided here

Now, all you need is to write {#fig:your_fig_name} next to your figures as such:

![your nice caption](your_img_path.png){#fig:your_fig_name}

And in-text, reference the figure with: @fig:your_fig_name

When I try to export as word, I get the following error- Undefined cross reference

The word file is created but the reference and tag are in plain text just as they were in markdown.
Anyone have any ideas what I could try?

It turns out that I was using a markdown link in the file instead of a wikilink.
Pandoc seems to need wikilinks to work its magic.

Got myself the link-converter plugin for obsidian that can convert all links in a file. And the problem was solved.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.