Skip to content

Instantly share code, notes, and snippets.

@vm-wylbur
Created January 1, 2019 02:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vm-wylbur/b7ab1d16703789d2e251c48cad77305c to your computer and use it in GitHub Desktop.
create LaTeX from Rmd, using a Makefile, the HRDAG way
#
# Authors: PB
# Maintainers: PB
# Copyright: 2018, HRDAG, GPL v2 or later
# ============================================
R_OPTS=--no-save --no-restore --no-init-file --no-site-file
KNITR="rmarkdown::render('$<', output_format='md_document', output_dir='output/')"
all: output/some-file.tex \
output/some-file.tex: \
src/some-file.Rmd
Rscript $(R_OPTS) -e $(KNITR)
pandoc -s output/some-file.md -t latex -o $@
-rm output/some-file.md src/*html output/*html
# done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment