I have a figure declared like this:

#+CAPTION: Google NGrams Viewer Search
#+NAME: fig:ngrams

And I'd like to reference it, so that I can write, e.g. Please refer to Figure [[some magic thing here]] and have it output Please refer to Figure 1. I'm using pandoc to convert from .org to .pdf.

I've been trying writing [[fig:ngrams]], as in Please refer to Figure [[fig:ngrams]], but neither Pandoc nor pandoc-citeproc seem to understand that kind of link, and they transform it to Please refer to Figure fig:ngrams.

  • 2
    In Org, one refers to a figure like you suggested, e.g. Figure [[fig:ngrams]]. This works with ox.el, e.g. ox-latex.el. If you must use pandoc instead of ox-latex.el for your PDFs needs, perhaps the right approach would be to file a bug to the Pandoc org-parser maintainers to let them know that it does not support the links syntax fully. – rasmus May 8 '17 at 14:38

Figured it out myself. Turns out with the latest pandoc and pandoc-crossref you can do this:

#+CAPTION: Google NGrams Viewer Searches
#+LABEL: fig:ngrams


Please refer to [@fig:ngrams].

  • 1
    No longer working in my installation : Emacs version: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) : of 2020-08-25 : org version: 9.3.7 – Reb.Cabin Oct 26 '20 at 0:59

You can also use org-ref. Then you can use ref:ngrams to reference a figure. This works well with LaTeX export. It probably works with pandoc too.


There is another way to reference figures, by using #+NAME: before the figure. For example:

#+CAPTION: Example of the process
#+NAME: fig:theprocess

And later in the place where you need the reference, you add an internal link:

And as can be seen in figure [[fig:theprocess]], the process...

This works nicely with latex export.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.