I'm trying to create a glossary using Pandoc with Markdown in, PDF (/LaTeX) out. I've followed the documentation here which uses the glossaries
library. Everything seems to be working, except actually printing out the glossary! And yes, I have \printglossaries
in my template.
The documentation there mentions
File processing must now include a call to
makeglossaries
followed by at least one further invocation oflatex
orpdflatex
.
which...I haven't done, because I don't know how. Is there a canonical or easy way to run latex
or pdflatex
again, as it says, using pandoc?
What I've done so far:
Made a copy of the default template (using pandoc -D latex
) and added this right after $body$
, before the bibliography stuff:
$if(glossary)$
\printglossaries
$endif$
Updated my main doc YAML metadata to include glossary: true
.
My header-includes
section looks like this:
header-includes:
- \usepackage{glossaries}
- \makeglossaries
- \newglossaryentry{foo}{name=bar, description={baz}}
\gls{foo}
in an arbitrary location near the beginning, which does get hyperlinked, just...to nowhere.pandoc --standalone --template=aui.latex my_document.md -o my_document.pdf
.I've also tried without the conditional glossary
variable stuff, just in case that's what was breaking things, but there's no change.
By default, pandoc will use LaTeX to create the PDF, which requires that a LaTeX engine be installed (see --pdf-engine below). Alternatively, pandoc can use ConTeXt, roff ms, or HTML as an intermediate format. To do this, specify an output file with a .
Generating PDF from Markdown with Pandoc There are actually two steps involved in converting a Markdown file to a PDF file: The Markdown source file is converted to a LaTeX source file. Pandoc invokes the pdflatex or xelatex or other TeX command and converts the . tex source file to a PDF file.
If you use option 1 from section 4 of the glossaries beginners guide to show your glossary, you will not need multiple invocations of pdflatex
. It should compile ok with a single run.
Also if you want to use a less latexy syntax in your markdown files you can use the filter I wrote: pandoc-gls. The pandoc-gls repo also has an example meta section setup for the option 1 mentioned above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With