From 616ac315693aab515c938262c74792d80b5cd650 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Mon, 19 Jul 2021 15:06:24 -0300 Subject: [PATCH] Add Makefile targets to generate latexdiff outputs --- .gitignore | 1 + manuscript/Makefile | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1b6483cc..54947b1b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ MANIFEST *.bak *.sav _output +manuscript/*diff*.tex diff --git a/manuscript/Makefile b/manuscript/Makefile index 9bc14747..530a3360 100644 --- a/manuscript/Makefile +++ b/manuscript/Makefile @@ -10,10 +10,18 @@ OUTDIR = _output PREPRINT_PDF = $(OUTDIR)/$(PREPRINT).pdf GJI_PDF = $(OUTDIR)/$(GJI).pdf +# Latex compiler and pdfviewer LATEX_COMPILER = latexmk LATEX_FLAGS = -pdf -outdir=$(OUTDIR) PDFVIEWER = xdg-open +# Variables for generating the diffs against older versions +SUBMITTED_V1 = submitted-v1 +DIFFS_SUBMITTED_V1 = gji-diffsubmitted-v1 +DIFFS_SUBMITTED_V1_PDF = $(OUTDIR)/$(DIFFS_SUBMITTED_V1).pdf +LATEXDIFF_VC = latexdiff-vc +LATEXDIFF_VC_FLAGS = --git --flatten --disable-citation-markup + all: preprint gji @@ -22,7 +30,7 @@ preprint: $(PREPRINT_PDF) gji: $(GJI_PDF) clean: - rm -rf $(OUTDIR) + rm -rf $(OUTDIR) *diffs*.tex word-count: texcount -merge $(PREPRINT).tex @@ -39,3 +47,18 @@ $(PREPRINT_PDF): $(PREPRINT).tex $(TEX_FILES) $(RESULTS) $(GJI_PDF): $(GJI).tex $(TEX_FILES) $(RESULTS) $(LATEX_COMPILER) $(LATEX_FLAGS) $< + + +# diffs +# ----- + +show-diffs-submitted-v1: diffs-submitted-v1 + @( $(PDFVIEWER) $(DIFFS_SUBMITTED_V1_PDF) 2> /dev/null; ) + +diffs-submitted-v1: $(DIFFS_SUBMITTED_V1_PDF) + +$(DIFFS_SUBMITTED_V1_PDF): $(DIFFS_SUBMITTED_V1).tex + $(LATEX_COMPILER) $(LATEX_FLAGS) $< + +$(DIFFS_SUBMITTED_V1).tex: $(GJI).tex + $(LATEXDIFF_VC) $(LATEXDIFF_VC_FLAGS) -r $(SUBMITTED_V1) $<