cboettig / knitcitations

:package: Generate citations for knitr markdown and html files
http://carlboettiger.info
Other
220 stars 28 forks source link

pandoc_args in tutorial #67

Closed BruceKendall closed 9 years ago

BruceKendall commented 9 years ago

I'm trying to use knitcitations in a "clean" install of Rstudio for mac (0.98.1062) and R (3.1.1), and I can't get the bibliography handling using Pandoc (as recommended in your tutorial) to work. I have tried this using both the CRAN version and the development version of knitcitations.

I should note that I am a YAML newbie.

When I paste your YAML header into my Rmd document as is, I get compilation errors; I can fix these by eliminating the whitespace before "pandoc_args". However, the bibliography is not generated. In the call to pandoc displayed in the R Markdown window, it is clear that the options associated with pandoc_args are not actually being passed by Rstudio.

I realize that this is really an Rstudio problem, but I didn't find anything about pandoc_args on the Rstudio support site, and you clearly have been able to get this working. Do you have any suggestions?

I should note that bibliography() does generate the bibliography in the default format; I'd just like to be able to get the clean output as suggested by your tutorial.

cboettig commented 9 years ago

@BruceKendall Thanks for the bug report; rmarkdown has been evolving quickly since the tutorial was posted and it looks like my tutorial is out of date (Now that rmarkdown is on CRAN, I think we can expect RStudio will keep it more stable). You shouldn't need pandoc_args any more, but just declare the bibliography and csl style as 'top-level' items in the yaml, like this: https://raw.githubusercontent.com/cboettig/template/master/manuscripts/manuscript.Rmd Let me know if that's unclear or unsuccessful.

I should update the documentation here too.

BruceKendall commented 9 years ago

Thanks, that worked. While you are updating the documentation, you might also note that the write.bibtex code chunk will normally want a ‘message=FALSE` option (took me a while to find that).

On Oct 6, 2014, at 10:26 AM, Carl Boettiger notifications@github.com<mailto:notifications@github.com> wrote:

@BruceKendallhttps://github.com/BruceKendall Thanks for the bug report; rmarkdown has been evolving quickly since the tutorial was posted and it looks like my tutorial is out of date (Now that rmarkdown is on CRAN, I think we can expect RStudio will keep it more stable). You shouldn't need pandoc_args any more, but just declare the bibliography and csl style as 'top-level' items in the yaml, like this: https://raw.githubusercontent.com/cboettig/template/master/manuscripts/manuscript.Rmd Let me know if that's unclear or unsuccessful.

I should update the documentation here too.

— Reply to this email directly or view it on GitHubhttps://github.com/cboettig/knitcitations/issues/67#issuecomment-58054145.

Bruce Kendall Professor Bren School of Environmental Science & Management University of California, Santa Barbara Santa Barbara, CA 93106-5131 Tel: +1 (805) 893-7539 kendall@bren.ucsb.edumailto:kendall@bren.ucsb.edu