1

RStudio's 'Knit HTML' (Ctrl+Shift+K) produces great HTML output from an .Rmd file, that includes author names, table of content, and bibliography/citations as specified in the yaml header.

I have not been able to reproduce the output using scripted R commands, e.g., via Rscript rather than via the RStudio IDE.

How can I get the same output via Rscript? (My end goal is to use travis-ci to build my vignettes the way RStudio would -- because R CMD build doesn't make them in the same way, and they look awful -- and then have travis push to the gh-pages branch of my package repo.)

Example:

---
title: "my package vignette"
author:
  - "Author1"
  - "Author2"
date: "`r format(Sys.Date(), format='%B %d %Y')`"
output:
  html_document:
    number_sections: yes
    self_contained: yes
    toc: yes
vignette: >
  %\VignetteEngine{knitr::knitr}
  %\VignetteIndexEntry{my package vignette}
  %\VignetteKeyword{keyword1, keyword2}
  %\usepackage[utf8]{inputenc}
references:
- id: fenner2012a
  title: One-click science marketing
  author:
  - family: Fenner
    given: Martin
  container-title: Nature Materials
  volume: 11
  URL: 'http://dx.doi.org/10.1038/nmat3283'
  DOI: 10.1038/nmat3283
  issue: 4
  publisher: Nature Publishing Group
  page: 261-263
  type: article-journal
  issued:
    year: 2012
    month: 3
---

# Section 1

Lorem ipsum ...

# Section 2

Quisque dignissim ... I'll cite @fenner2012a here for fun.

# References
amc
  • 263
  • 3
  • 19

0 Answers0