From 9cfa904ffd0a7583bb68f489aa3733f2359f2762 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 30 Jul 2015 12:14:33 -0500 Subject: [PATCH] add makefile templates --- templates/makefiles/knitr_rules.mk | 15 +++++++++++++++ templates/makefiles/xls_txt_conversion.mk | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 templates/makefiles/knitr_rules.mk create mode 100644 templates/makefiles/xls_txt_conversion.mk diff --git a/templates/makefiles/knitr_rules.mk b/templates/makefiles/knitr_rules.mk new file mode 100644 index 0000000..5d1bc7e --- /dev/null +++ b/templates/makefiles/knitr_rules.mk @@ -0,0 +1,15 @@ +R ?= R + +%.pdf: %.svg + inkscape -A $@ $< + pdfcrop $@ + mv $(dir $@)*-crop.pdf $@ + +%.png: %.svg + inkscape -e $@ -d 300 $< + +%.tex: %.Rnw + $(R) --encoding=utf-8 -e "library('knitr'); knit('$<')" + +%.pdf: %.tex $(wildcard *.bib) $(wildcard *.tex) + latexmk -pdf -pdflatex='xelatex -interaction=nonstopmode %O %S' -bibtex -use-make $< diff --git a/templates/makefiles/xls_txt_conversion.mk b/templates/makefiles/xls_txt_conversion.mk new file mode 100644 index 0000000..bc04031 --- /dev/null +++ b/templates/makefiles/xls_txt_conversion.mk @@ -0,0 +1,16 @@ +SSCONVERT ?=ssconvert + +%.xls: %.gnumeric + $(SSCONVERT) --export-type Gnumeric_Excel:excel_dsf $< $@ + +%.txt: %.gnumeric + $(SSCONVERT) --export-type Gnumeric_stf:stf_assistant -O 'separator=" " quote="" eol="unix"' $< $@ + +%.txt: %.xls + $(SSCONVERT) --export-type Gnumeric_stf:stf_assistant -O 'separator=" " quote="" eol="unix"' $< $@ + +%.txt: %.xlsx + $(SSCONVERT) --export-type Gnumeric_stf:stf_assistant -O 'separator=" " quote="" eol="unix"' $< $@ + +%.xls: %.txt + txt2xls $< > $@ -- 2.39.2