Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Makefile targets to generate latexdiff outputs #166

Merged
merged 1 commit into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) $<