2

I would try to convert the way I write my scientific articles from Sweave/LaTeX to knitr/pandoc. I've been able to reproduce almost everithing with the exceptions of the references. I googled a lot and I read the official and unofficial guide to the pandoc references but I've not yet found the right solution to my problem: no citations are included in my document.

This is what I've done:

  1. added bibliography: myBib.bib to the header of the file
  2. added the citation using [@KEY], where KEY is the key entry in my .bib file
  3. added # References section at the bottom of my document
  4. convert .Rmd file to .md file using knitr
  5. from shell I run:

    pandoc -H headers.tex --bibliography=myBib.bib -o article.pdf article.md

The .pdf file was generated but with non citation references

I've also tried to generate the .tex file and then to compile it pandoc --bibliography=myBib.bib -o article.tex article.md also using the --natbib and --biblatex switch, but nothing changes. Opening the .tex file I noticed that the citations were converted as: {[}@01, @46{]} while in the .md file I wrote: [@01, @46]. Could be this the issue?

I work using debian jessie, pandoc 1.12.4.2, knitr 1.11, emacs24.

EDIT 24 Aug 2015

Seems that all the problems were due to the old package in the stable and backport Debian repos. Now I installed pandoc and pandoc-citeproc from source and all seems to work properly. I will inform the debian administrators of the malfunction in the version present in the repositories.

closed as off-topic by cfr, Alan Munn, Stefan Pinnow, egreg, Mensch Aug 6 '16 at 22:48

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Does it work if you write [@01; @46]? I think references need to be separated with semicolons rather than commas. – twsh Aug 22 '15 at 17:29
  • By the way, you're a few releases behind on Pandoc so it might be a good idea to upgrade unless you have a reason not to. – twsh Aug 22 '15 at 17:32
  • @Tom: I tried using both semicolon and commas but nothing change. I use the pandoc version in the debian stable repo. – Riccardo Aug 22 '15 at 17:48
  • 1
    I edited the post. Installing the latest pandoc all works fine. The problems I have had are due to a prevous version(1.12.4.2) – Riccardo Aug 25 '15 at 10:14
  • 4
    I'm voting to close this question as off-topic because it was due to outdated software and the question includes the solution so there's no question now. – cfr Aug 6 '16 at 22:21