Created
February 3, 2021 02:08
-
-
Save louisswarren/5b9e130f950206f5e7497a9fd59e09f4 to your computer and use it in GitHub Desktop.
Generate two versions of the same latex document
This file contains hidden or 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
.PHONY: all | |
all: tutorial.pdf tutorial-solns.pdf | |
%.pdf: %.tex | |
pdflatex $^ | |
%-solns.pdf: %.tex | |
pdflatex -jobname $(basename $@) '\def\SOLUTIONS{} \input{$^}' | |
.PHONY: clean | |
clean: | |
rm -f *.aux *.log *.pdf |
This file contains hidden or 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
\documentclass{article} | |
\ifdefined\SOLUTIONS | |
\newcommand{\solution}[1]{\textbf{Solution:} #1} | |
\else | |
\newcommand{\solution}[1]{} | |
\fi | |
\begin{document} | |
Job name: `\jobname'.\\ | |
\solution{Just use makefiles!} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment