-
-
Save mstrehler/f0ab29169e9d90e0aacd to your computer and use it in GitHub Desktop.
Latex makefile
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
doc=your_document_name | |
name=$(doc) | |
BUILD=build | |
FIGS_DIR=figs | |
TARGET=$(doc).pdf | |
TOPSOURCE=$(doc).tex | |
# The first one suppressed all the output messages. but doesn't show you the error ..... | |
#OPTIONS=-interaction=batchmode --output-directory=$(BUILD) --shell-escape -file-line-error -halt-on-error -jobname $(name) | |
OPTIONS=--output-directory=$(BUILD) --shell-escape -file-line-error -halt-on-error -jobname $(name) | |
BIBFILES=$(doc).bib | |
STYLE_FILES=\ | |
your_document_style_file.sty\ | |
your_document_bibtex_file.bst | |
all: $(TARGET) | |
$(BUILD): | |
mkdir -p $@ | |
ln -fsr $(STYLE_FILES) $(BUILD)/. | |
ln -fsr $(FIGS_DIR) $(BUILD)/. | |
# you can comment the first 3 lines if you do not have a bib file | |
$(TARGET): $(BUILD) $(PDF_FIGS) | |
pdflatex $(OPTIONS) $(TOPSOURCE) | |
cp $(BIBFILES) $(BUILD)/. | |
(cd $(BUILD) && bibtex $(doc)) | |
pdflatex $(OPTIONS) $(TOPSOURCE) | |
pdflatex $(OPTIONS) $(TOPSOURCE) | |
cp $(BUILD)/$(TARGET) $(TARGET) | |
clean: | |
rm -rf $(BUILD) | |
cleanharder: clean | |
rm -f $(TARGET) | |
.PHONY: all clean cleanharder $(TARGET) $(BUILD) $(PDF_FIGS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment