Skip to content

Instantly share code, notes, and snippets.

@akafael
Last active October 28, 2019 01:29
Show Gist options
  • Save akafael/6283346 to your computer and use it in GitHub Desktop.
Save akafael/6283346 to your computer and use it in GitHub Desktop.
Makefile to use with Latex or Lualatex
##
# Makefile for Latex
# @author Rafael Lima
# @version 1.33
##
# Compiler Options
CC = pdflatex
CCFLAGS = --enable-write18
NAME = cursolatex
##
# Recipes:
##
.PHONY = ALL
ALL: $(NAME).pdf
# Compile Thrice to ensure all reference in the right place and open pdf
$(NAME).pdf: $(NAME).tex
$(CC) $(CCFLAGS) $< && $(CC) $< && $(CC) $< &&\
xdg-open $(@)&
# Remove generated temporary files
.PHONY = clean-aux
clean-aux:
rm -f $(NAME).aux $(NAME).bbl $(NAME).blg $(NAME).log $(NAME).idx $(NAME).out\
$(NAME).nav $(NAME).snm $(NAME).toc $(NAME).vrb
# Remove generated pdf
.PHONY = clean-pdf
clean-pdf:
rm -f ../$(NAME).pdf
# Remove All generated files
.PHONY = clean
clean: clean-aux clean-pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment