|
| 1 | +# ============================================================================= |
| 2 | +# @file Makefile |
| 3 | +# @brief Makefile for generating previews of the paper |
| 4 | +# @author Michael Hucka <[email protected]> |
| 5 | +# @license Please see the file named LICENSE in the project directory |
| 6 | +# @website https://github.com/casics/dassie |
| 7 | +# ============================================================================= |
| 8 | + |
| 9 | +# Change the following values to match your configuration. |
| 10 | +# ............................................................................. |
| 11 | + |
| 12 | +input := paper.md |
| 13 | +output := paper.pdf |
| 14 | +bib := paper.bib |
| 15 | + |
| 16 | +# Main code -- no more customization variables after this point |
| 17 | +# ............................................................................. |
| 18 | + |
| 19 | +title := $(shell grep title: $(input) | sed 's/title: *//' | tr -d "'") |
| 20 | +authors := $(shell sed -n '/authors:/,/affiliations:/p' $(input) | grep name: | sed 's/- name: *//' | paste -d, -s - | sed 's/,/, /g') |
| 21 | +repo := $(shell git config --get remote.origin.url | sed 's|[email protected]:|https://github.com/|' | sed 's/\.git//') |
| 22 | +#repo := https://github.com/hipspy/hips |
| 23 | + |
| 24 | +$(output): $(input) $(bib) Makefile |
| 25 | + pandoc \ |
| 26 | + -V paper_title="$(title)" \ |
| 27 | + -V citation_author="$(authors)" \ |
| 28 | + -V repository="$(repo)" \ |
| 29 | + -V archive_doi="http://dx.doi.org/00.00000/zenodo.0000000" \ |
| 30 | + -V formatted_doi="00.00000/joss.00000" \ |
| 31 | + -V paper_url="http://joss.theoj.org/papers/" \ |
| 32 | + -V review_issue_url="http://joss.theoj.org/papers/" \ |
| 33 | + -V issue="0" \ |
| 34 | + -V volume="00" \ |
| 35 | + -V year="2018" \ |
| 36 | + -V submitted="00 January 0000" \ |
| 37 | + -V published="00 January 0000" \ |
| 38 | + -V page="00" \ |
| 39 | + -V graphics="true" \ |
| 40 | + -V joss_logo_path="whedon/resources/joss-logo.png" \ |
| 41 | + -V logo_path="whedon/resources/joss-logo.png" \ |
| 42 | + -V footnote_paper_title="..." \ |
| 43 | + -V geometry:margin=1in \ |
| 44 | + -V journal_name="JOSS" \ |
| 45 | + -o $(output) \ |
| 46 | + --pdf-engine=xelatex \ |
| 47 | + --filter pandoc-citeproc $(input) \ |
| 48 | + --from markdown+autolink_bare_uris \ |
| 49 | + --template "whedon/resources/latex.template" |
| 50 | + |
| 51 | +autorefresh:; |
| 52 | + ((ls $(input) $(bib) | entr make $(output)) &) |
0 commit comments