Trying to get biber to run when generating PDF

15 views
Skip to first unread message

Lyndon Drake

unread,
Apr 20, 2020, 4:36:08 AM4/20/20
to pandoc-discuss
Hi,

Last one for the day (I hope): if I generate a LaTeX file and run latexmk on it, I get my citations fine, but if I try to get pandoc to generate the PDF the citations don't come through. I.e. this works:

/usr/local/bin/pandoc -dlatex -s -o output/README.tex README.md
cd output/
latexmk -lualatex README.tex

but this doesn't - the PDF is generated with the citations unmatched:

/usr/local/bin/pandoc -dlatex -s -o output/README.pdf README.md

I'm using the following defaults file in both cases:

metadata:
  author: Lyndon Drake
  papersize: a4
  documentclass: article
  mainfont: Times New Roman
  lang: en-GB
  mainfontoptions: Ligatures=TeX, Numbers=OldStyle
  otherlangs: [grc, he]
  bibliography:
    - /Users/lyndon/repo/workflow/zot-export.bib
  biblio-style: sbl
  biblatexoptions:
    - backend=biber
    - indexing=cite
  indent: true

cite-method: biblatex

pdf-engine: lualatex

number-sections: true

Lukas Atkinson

unread,
Apr 20, 2020, 7:33:52 AM4/20/20
to pandoc-...@googlegroups.com
This seems about right. Either use Pandoc's built-in citation system, or generate LaTeX and compile it yourself. Pandoc is no substitute for latexmk. Latexmk knows how and when to run additional required programs such as Biber or Makeindex.

I tend to write makefiles that manage the necessary Pandoc/Latexmk calls for me, e.g.:

  %.tex : %.md
    pandoc -st latex $< -o $@

  %.pdf : %.tex
    mkdir -p build
    latexmk -pdf -outdir build -interaction=batchmode $*
    cp build/$*.pdf .

Then, a call like `make paper.pdf` will do the necessary steps, assuming paper.md exists.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/68a5023c-3ce3-44ef-9f05-2753626caf90%40googlegroups.com.

John MacFarlane

unread,
Apr 20, 2020, 12:27:19 PM4/20/20
to Lyndon Drake, pandoc-discuss

You can use latexmk as your pdf-engine. You'll need to pass in
--pdf-engine-opts to tell latexmk to use lualatex and biber.

John MacFarlane

unread,
Apr 20, 2020, 12:28:09 PM4/20/20
to Lyndon Drake, pandoc-discuss

To clarify, pandoc doesn't attempt to run bibtex or biber itself.
But if you use latexmk as your pdf-engine, latexmk can do this.

Lyndon Drake

unread,
Apr 20, 2020, 1:41:21 PM4/20/20
to pandoc-discuss
Ah, OK, that makes perfect sense now that I think about it. I'll give it a go with latexmk as the pdf-engine.
Reply all
Reply to author
Forward
0 new messages