Simple template for scientific manuscripts in R markdown

By | March 12, 2015

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.

10 thoughts on “Simple template for scientific manuscripts in R markdown

  1. Bernhard

    I will definitely try that out. Have youn considered citing

    @Manual{,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2014},
    url = {http://www.R-project.org/},
    }

    in the template?

    Cheers,
    Bernhard

    Reply
    1. Petr Keil Post author

      Good idea, thanks! I have included the R citation.

      Reply
  2. jn

    1. What's about referencing to a figure or a table in a text?
    2. Do you have any experience in sending a result of .Rmd files to a journal?

    Reply
    1. Petr Keil Post author

      Hi,
      ad 1: Good idea, I will try to add that asap.
      ad 2: I have experience with submitting LaTeX's .tex files to journals, but not .Rmd. I would not even expect journals to take .Rmd now. But you don't have to do that, because knitr can also give you the .tex file, which almost every journal takes. However, the .tex file is not a default output, you need to check a box in the "Knit PDF settings", and then the .tex will be produced alongside your .pdf.

      Reply
      1. jn

        ad 2: I'm writing my papers in .Rnw format, but I was thinking about writing them in .Rmd. Although, I've found few problems:
        1. bibliography citations and references
        2. captions for figures and tables
        3. references to a figure or table
        (Probably, there were more problems, but those above I can think right now). So my previous question wasn't about "did you ever send .Rmd file", but more "did you ever send .tex file, which was prepared in knitr to a journal?"

        Thanks for your good work,
        JN

        Reply
      2. Tom

        Thanks, Petr, this is really excellent. I wish I had this last year!
        Do you have any idea why the Figure and Table numbers don't show up in the HTML file? Maybe it's just my browser. And lastly, yes, if you can add the figure reference in the text that would be wonderful.

        Reply
  3. Pingback: Distilled News | Data Analytics & R

  4. Máy Chạy Bộ Chính Hãng

    Having read this I thought it was very informative. I appreciate you spending some time and energy to put this informative article together.
    I once again find myself personally spending way too much
    time both reading and commenting. But so what, it was still worthwhile!

    Reply
  5. https://worldscoop.org

    It is heartbreaking for a sports lover to visit away at
    the time of airing in the match of these
    favorite team. Then a week ago he declared Martial Law in 15 provinces north of
    Bangkok which can be overwhelmingly politically 'Red Shirt' in affiliation. This is usually the extension products was once the task associated with an editor, but rather than looking simply at the stories presented by the small collection of journalists, curation signifies that you
    are considering an extremely great deal of stories
    from throughout the internet and also other sources, including social media posts on websites online such as twitter or Facebook, websites on small,
    and obscure blogs, and other websites.

    Reply
  6. news destin fl

    " Not being a philosopher or a physicist, I'm not planning to explore that subject in publications, but I can tell you that, coming from a marketing standpoint, the web marketing effect for the business stated earlier was a big fat zero. An eyewitness account from the Independent's Andrew Buncombe, who was simply shot while taking refuge with 1,500 'red shirt' protesters inside a temple - a supposed safety - received jibes as being inside pay of Thaksin. Just finished watching Dabangg, Abhinav Kashyap's sterling debut performance.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *