Last active
September 10, 2018 10:58
-
-
Save ljvmiranda921/a9368c636cbf6dafbbf0a1979047aaca to your computer and use it in GitHub Desktop.
Contains a minimal workflow for compiling LaTeX documents
This file contains 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
# A Simple Makefile for LaTeX | |
# Author: Lester James V. Miranda | |
# E-mail: [email protected] | |
# Default variables which can be edited via the terminal | |
BUILDDIR = _build | |
COMPILER = pdflatex | |
PROJECT = main | |
BIBLIOGRAPHY = bibliography | |
latex: | |
@echo "Building $(PROJECT) in $(BUILDDIR) directory using $(COMPILER)..." | |
@echo "Creating $(BUILDDIR) directory..." | |
@mkdir $(BUILDDIR) | |
@mkdir $(BUILDDIR)/appendices | |
@mkdir $(BUILDDIR)/chapters | |
@$(COMPILER) -interaction=nonstopmode -halt-on-error -output-directory=$(BUILDDIR) $(PROJECT).tex | |
@echo "First pass (via $(COMPILER)) done!" | |
@cp $(BIBLIOGRAPHY).bib $(BUILDDIR) | |
@biber --output_directory=$(BUILDDIR) $(PROJECT) | |
@echo "Second pass (via bibtex) done!" | |
@$(COMPILER) -interaction=nonstopmode -halt-on-error -output-directory=$(BUILDDIR) $(PROJECT).tex | |
@echo "Third pass (via $(COMPILER)) done!" | |
@$(COMPILER) -interaction=nonstopmode -halt-on-error -output-directory=$(BUILDDIR) $(PROJECT).tex | |
@echo "Fourth pass (via $(COMPILER)) done!" | |
@echo "Compilation done. Output file can be seen in $(BUILDDIR)" | |
clean: | |
@rm -rf $(BUILDDIR) | |
@echo "Removed $(BUILDDIR) directory" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment