Skip to content

Commit

Permalink
Add Makefile targets to generate latexdiff outputs (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
santisoler authored Jul 21, 2021
1 parent 60b97c0 commit fab22c7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ MANIFEST
*.bak
*.sav
_output
manuscript/*diff*.tex
25 changes: 24 additions & 1 deletion manuscript/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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) $<

0 comments on commit fab22c7

Please sign in to comment.