| Feature | Pandoc to HTML | Pandoc to PDF | MMD to HMTL | MMD to PDF |
|---|---|---|---|---|
| BibTeX Citations | yes [1] | yes [2] | no [3] | yes [4] |
| Cross-reference on sections | yes [5] | yes [6] | yes [7] | yes [8] |
| Cross-reference on figures | ? [9] | ? [9] | yes [10] | yes [10] |
| Cross-reference on tables | ? [9] | ? [9] | yes [11] | yes [11] |
With citeproc – http://johnmacfarlane.net/pandoc/demo/example19/Citations.html
It is recommended to first compile to LaTeX and run a separate pdflatex/bibtex build. Else the citations are processed by citeproc and printed as plain text to the document. If you inspect the interim .tex file, it looks like this:
Reference: {[}1{]}
{[}1{]} L. Lamport, ``Time, clocks, and the ordering of events in a distributed system,'' \emph{Commun. ACM}, vol. 21, Jul. 1978, pp. 558--565.
``
This of course implies that the reference number will not works as a hyperlink in the PDF document.
Related discussion: https://groups.google.com/forum/#!topic/pandoc-discuss/dfVDdQfYAFc
“BibTeX is a LaTeX tool, not HTML. There may be other tools to convert BibTeX into HTML, but MMD doesn’t support that.” http://support.fletcherpenney.net/discussions/questions/62-bibtex-refs-to-html
“MMD has much more rudimentary citation support. […] There is no automatic citation/bibliography formatting, unless LaTeX output is used (in which case natbib and bibtex are used).” – https://github.com/jgm/pandoc/wiki/Pandoc-vs-Multimarkdown
In my opinion, templating is a bit more complicated than pandoc’s approach.
This works with the See [the introduction](#introduction) syntax. See http://johnmacfarlane.net/pandoc/try/?text=Introduction%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0ASome+introduction.%0A%0AOverview%0A%3D%3D%3D%3D%3D%3D%3D%3D%0A%0ALorem+ipsum%2C+...+See+%5Bthe+introduction%5D(%23introduction)&from=markdown&to=html
The solution used in [5] produces a hyperlink: http://johnmacfarlane.net/pandoc/try/?text=Introduction%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0ASome+introduction.%0A%0AOverview%0A%3D%3D%3D%3D%3D%3D%3D%3D%0A%0ALorem+ipsum%2C+...+See+%5Bthe+introduction%5D(%23introduction)&from=markdown&to=latex
Of course, for the printed version, a hyperlink is not sufficient. Instead, we want the reference to be printed like “See Section 1.2”. To achieve this, we must override the hyperref command in the LaTeX template:
\renewcommand*{\hyperref}[2][\ar]{%
\def\ar{#2}
#2 (\autoref{#1})}
``
See https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide#automatic-cross-references
I haven’t researched this in detail, but as a last resort, the solution described in [6] should work here as well.
Pandoc does not offer a general solution for handling cross-references to tables and figures. This issue and the related ones discusse the problem in detail https://github.com/jgm/pandoc/issues/813.
“How do I make a reference to a figure in markdown using pandoc? […] When it comes to pandoc, the only solution to make cross references is using directly latex keywords” – http://stackoverflow.com/questions/9434536/how-do-i-make-a-reference-to-a-figure-in-markdown-using-pandoc
There are various hacks available to workaround this problem:
Using numbered lists: https://github.com/jgm/pandoc/issues/904#issuecomment-28574427. This approach works but is complicated and error-prone.
Using LaTeX keywords: http://stackoverflow.com/a/10253949. Of course, this only works for LaTeX output.
Using my workaround: https://github.com/jgm/pandoc/issues/813#issuecomment-51726484
The following syntax works for referencing figures in both HTML and PDF:
[label]: image.png
![Image Caption][label]
A reference to the [image](#label).
The solution presented in [10] should work for tables as well.