From c0edf4213df32afa16e39195fd924ef96b6c164b Mon Sep 17 00:00:00 2001 From: Kevin Stevens Date: Tue, 27 Dec 2022 22:30:31 -0600 Subject: [PATCH] Fix escaping issues in the Makefile On my machine, the "\\t" in "\\therev" and \\thedate" was causing a tab character to be emitted, which caused the whole build to fail. And the same for "\\n" in "\\newcommand", when running "make draft". Double-escaping all such backslashes fixes it. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 99662d1..34e2080 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ help: ## print help | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' rev.tex: FORCE - @printf '\\gdef\\therev{%s}\n\\gdef\\thedate{%s}\n' \ + @printf '\\\\gdef\\\\therev{%s}\n\\\\gdef\\\\thedate{%s}\n' \ "$(shell git rev-parse --short HEAD)" \ "$(shell git log -1 --format='%ci' HEAD)" > $@ @@ -49,11 +49,11 @@ data/%.pdf: data/%.py ## generate plot python3 $^ draft: $(DEPS) ## generate pdf with a draft info - echo -e '\\newcommand*{\\DRAFT}{}' >> rev.tex + echo -e '\\\\newcommand*{\\\\DRAFT}{}' >> rev.tex @TEXINPUTS="sty:" bin/latexrun $(BTEX) $(MAIN) watermark: $(DEPS) ## generate pdf with a watermark - echo -e '\\usepackage[firstpage]{draftwatermark}' >> rev.tex + echo -e '\\\\usepackage[firstpage]{draftwatermark}' >> rev.tex @TEXINPUTS="sty:" bin/latexrun $(BTEX) $(MAIN) spell: ## run a spell check