Last active
March 29, 2022 20:34
-
-
Save mhucka/5ecb18aa2fd088c055de07366f70135e to your computer and use it in GitHub Desktop.
Makefile for generating a preview of a JOSS journal paper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ============================================================================= | |
# @file Makefile | |
# @brief Makefile for generating previews of the paper | |
# @author Michael Hucka <mhucka@caltech.edu> | |
# @license Please see the file named LICENSE in the project directory | |
# @website https://github.com/casics/dassie | |
# ============================================================================= | |
# Change the following values to match your configuration. | |
# ............................................................................. | |
input := paper.md | |
output := paper.pdf | |
bib := paper.bib | |
# Main code -- no more customization variables after this point | |
# ............................................................................. | |
title := $(shell grep title: $(input) | sed 's/title: *//' | tr -d "'") | |
authors := $(shell sed -n '/authors:/,/affiliations:/p' $(input) | grep name: | sed 's/- name: *//' | paste -d, -s - | sed 's/,/, /g') | |
repo := $(shell git remote get-url origin | sed 's|git@github.com:|https://github.com/|' | sed 's/\.git//') | |
$(output): $(input) $(bib) Makefile | |
pandoc \ | |
-V paper_title="$(title)" \ | |
-V citation_author="$(authors)" \ | |
-V repository="$(repo)" \ | |
-V archive_doi="http://dx.doi.org/00.00000/zenodo.0000000" \ | |
-V formatted_doi="00.00000/joss.00000" \ | |
-V paper_url="http://joss.theoj.org/papers/" \ | |
-V review_issue_url="http://joss.theoj.org/papers/" \ | |
-V issue="0" \ | |
-V volume="00" \ | |
-V year="2018" \ | |
-V submitted="00 January 0000" \ | |
-V published="00 January 0000" \ | |
-V page="00" \ | |
-V graphics="true" \ | |
-V joss_logo_path="whedon/resources/joss-logo.png" \ | |
-V geometry:margin=1in \ | |
-o $(output) \ | |
--pdf-engine=xelatex \ | |
--filter pandoc-citeproc $(input) \ | |
--from markdown+autolink_bare_uris \ | |
--template "whedon/resources/latex.template" | |
autorefresh:; | |
((ls $(input) $(bib) | entr make $(output)) &) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update for anyone who comes across this: I put a newer version of this Makefile in a separate gist at https://gist.github.com/mhucka/c0b82778417f38f7ae6ee7d051cec90a The new version incorporates changes from @steven-murray above and hopefully fixes a few issues like the one noted by @pmundt.Update 2022-03-29: Discovered JOSS has changed to a different scheme for generating papers, and no longer uses Whedon. The updated makefile in the new gist doesn't account for that. I'm deleting the gist to avoid confusion.