From 26b193324c7cc58ea11f68a6104b8ddb7a91b3bf Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Sat, 14 Jun 2014 13:40:04 +0200 Subject: [PATCH] Use latexmk in Makefile. --- .latexmkrc | 9 +++++++++ Makefile | 12 +++++------- README.md | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .latexmkrc diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..d3daef5 --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,9 @@ +# From https://tex.stackexchange.com/questions/58963/latexmk-with-makeglossaries-and-auxdir-and-outdir#59098 +add_cus_dep('glo', 'gls', 0, 'makeglossaries'); +sub makeglossaries { + my ($base_name, $path) = fileparse($_[0]); + pushd $path; + my $return = system "makeglossaries $base_name"; + popd; + return $return; +} diff --git a/Makefile b/Makefile index 1f0bacc..570e1d4 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,11 @@ FILE := main OUT := build -all: - mkdir -p $(OUT) - pdflatex -output-directory $(OUT) $(FILE) - biber $(OUT)/$(FILE) - cd $(OUT) && makeglossaries $(FILE) - pdflatex -output-directory $(OUT) $(FILE) - pdflatex -output-directory $(OUT) $(FILE) +latexmk: + # Also see .latexmkrc + latexmk -outdir=$(OUT) -pdf $(FILE) clean: rm -rf $(OUT) + +.PHONY: latexmk clean diff --git a/README.md b/README.md index 7de6374..1e77ce3 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Comments & contributions welcome! * Download the TUM logo from [here][mytum-logo-tum] and save it to `logos/tum.pdf`. * Download your faculty's logo from [here][mytum-logo-faculty] and save it to `logos/faculty.pdf`. * Some logos might not be cropped; execute the `crop-logos` script to do that for you. - * Configure your latex editor to use `pdflatex`, `biber` for bibliography, and `makeglossaries` for glossary generation. Set `main.tex` as the master document. Alternatively, you can use the provided makefile to create a PDF in the `build` directory. + * Configure your latex editor to use `pdflatex`, `biber` for bibliography, and `makeglossaries` for glossary generation. Set `main.tex` as the master document. Alternatively, you can use the provided makefile to create a PDF in the `build` directory (requires `latexmk`). * Look for `TODO` comments in the provided files. Start at `main.tex`. For additional hints, have a look at [the wiki][wiki].