From 51292127a47911f973e1c2691a9adc75c6bad044 Mon Sep 17 00:00:00 2001 From: Agathe Porte Date: Tue, 8 May 2018 12:14:14 +0200 Subject: Simpler version of Makefile Instead of using a big .gitignore and a big clean target, we can tell latexmk to build into a dedicated directory. This way, all temporary files are located in a repository that we just have to ignore and remove. This allows us to have the .tex sources right next to the Makefile, which makes it easier to reason about instead of having to use the src/ subdirectory. Also moved README to reStructuredText (because Markdown sucks IMO) and removed gif and fancy badges in the README. --- .gitignore | 18 +----------------- Makefile | 41 ++++++++++++----------------------------- README.md | 26 -------------------------- README.rst | 19 +++++++++++++++++++ docs/demo.gif | Bin 319449 -> 0 bytes main.tex | 7 +++++++ src/main.tex | 7 ------- 7 files changed, 39 insertions(+), 79 deletions(-) delete mode 100644 README.md create mode 100644 README.rst delete mode 100644 docs/demo.gif create mode 100644 main.tex delete mode 100644 src/main.tex diff --git a/.gitignore b/.gitignore index 49e926e..378eac2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1 @@ -*.aux -*.fdb_latexmk -*.fls -*.glg -*.glo -*.gls -*.glsdefs -*.ist -*.lof -*.log -*.lot -*.out -*.toc -*.xdy -*.tns -*.pdf -*.dvi +build diff --git a/Makefile b/Makefile index 48593ca..5ad3eba 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# LaTeX basic Makefile +# LaTeX Makefile # # WTFPL, 2016 - 2018 Agathe Porte (MicroJoe) # @@ -8,47 +8,30 @@ # Very important variables to set up PDF=main.pdf -PRINC=src/main.tex +PRINC=main.tex +AUXDIR=build +LATEXMK=source ~/.bashrc && latexmk \ + -auxdir=$(AUXDIR) \ + -outdir=$(AUXDIR) \ + -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make # You want latexmk to *always* run, because make does not have all the info. # Also, include non-file targets in .PHONY so they are run regardless of any # file of the given name existing. -.PHONY: $(PDF) all clean +.PHONY: $(PDF) all clean live # Main rule: Construct the PDF all: $(PDF) -# + # Live: automatic watch and build of the PDF file live: $(PRINC) $(SOURCES) - source ~/.bashrc && latexmk -pvc -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make $(PRINC) + $(LATEXMK) -pvc $(PRINC) # Construct the PDF file from sources $(PDF): $(PRINC) $(SOURCES) - source ~/.bashrc && latexmk -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make $(PRINC) + $(LATEXMK) $(PRINC) # Remove all the intermediate files clean: @echo Cleaning temporary LaTeX files... - @rm -f \ - *.aux \ - *.fdb_latexmk \ - *.fls \ - *.glg \ - *.glo \ - *.gls \ - *.glsdefs \ - *.ist \ - *.lof \ - *.log \ - *.lot \ - *.out \ - *.toc \ - *.xdy - @echo Done - -mrproper: clean - @echo Removing all PDF files... - @rm -f *.pdf - @echo Removing all DVI files... - @rm -f *.dvi - @echo Done + @rm -rf build diff --git a/README.md b/README.md deleted file mode 100644 index d00cba4..0000000 --- a/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# A super LaTeX Makefile for large reports - -![License: WTFPL](https://img.shields.io/badge/license-WTFPL-blue.svg) - -Feel free to use this Makefile in order to render your LaTeX report easier! - -![Animated GIF demo of the Makefile](docs/demo.gif) - -## Description - -This Makefile uses `latexmk`, a tool that will manage any dependencies between -LaTeX files and run the LaTeX render multiple times if needed. This is -especially useful when you use a table of content, a glossary, or anything -that need the LaTeX engine to run multiple times before rendering a correct -output. - -*Be sure to use the provided .gitignore file too!* This will allow you to -use git without versionning various temporary files that LaTeX produces during -generation. Maybe all temporary files extensions are not covered. You are -welcome to send me `.patch` files! - -## License - -Everything in this repository is released under WTFPL, so yeah, do whatever -you want. Spread this tool in order to allow people to use LaTeX for -everything! diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..d4d1d61 --- /dev/null +++ b/README.rst @@ -0,0 +1,19 @@ +A super LaTeX Makefile for large reports +======================================== + +Feel free to use this Makefile in order to render your LaTeX report easier! + +Description +----------- + +This Makefile uses ``latexmk``, a tool that will manage any dependencies +between LaTeX files and run the LaTeX render multiple times if needed. This is +especially useful when you use a table of content, a glossary, or anything that +need the LaTeX engine to run multiple times before rendering a correct output. + +License +------- + +Everything in this repository is released under WTFPL, so yeah, do whatever +you want. Spread this tool in order to allow people to use LaTeX for +everything! diff --git a/docs/demo.gif b/docs/demo.gif deleted file mode 100644 index 7910629..0000000 Binary files a/docs/demo.gif and /dev/null differ diff --git a/main.tex b/main.tex new file mode 100644 index 0000000..4074cff --- /dev/null +++ b/main.tex @@ -0,0 +1,7 @@ +\documentclass{report} + +\begin{document} + +Hello, world! + +\end{document} diff --git a/src/main.tex b/src/main.tex deleted file mode 100644 index 4074cff..0000000 --- a/src/main.tex +++ /dev/null @@ -1,7 +0,0 @@ -\documentclass{report} - -\begin{document} - -Hello, world! - -\end{document} -- cgit v1.2.3