Simple template for scientific manuscripts in R markdown

[This article was first published on Are you cereal? » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The good reasons to write scientific reports and manuscripts in LaTeX or Markdown are: improved document integrity (always), simplicity (not always) and reproducibility (always). I prefer the lightweight Markdown over rich but more complex LaTeX — I think that lightweight is good for reproducibility. I am also in love with knitr.

Hence, I’ve made a really simple template for the classical manuscript format for R markdown and knitr. Here are the resulting .pdf and .html.

The template contains the four usual components of any scientific manuscript:

  • equations (using LaTeX syntax)
  • table with caption (done by kable package, but you can also use xtable)
  • figure with caption
  • citations and references (done by knitcitations package)

The template uses Methods in Ecology and Evolution reference style, which is stored in the mee.csl file.

The template does not have line numbers nor wide line spacing. To add these you will have to edit the .tex file, i.e. you will need to learn a little bit of LaTeX.

How to use the template?

  1. Go to the GitHub repository.
  2. Save the .Rmd and .csl files to your local folder.
  3. Open the .Rmd file with R studio.
  4. Edit freely.
  5. Hit the Knit html or Knit PDF button.

To leave a comment for the author, please follow the link and comment on their blog: Are you cereal? » R. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)