5

I have a figure declared like this:

#+CAPTION: Google NGrams Viewer Search
#+NAME: fig:ngrams
[[file:ngrams.png]]

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.

  • 1
    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
4

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
[[file:ngrams.png]]

Then:

Please refer to [@fig:ngrams].

3

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.

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.