Skip to content

Instantly share code, notes, and snippets.

@jez
Created October 5, 2014 20:45
Show Gist options
  • Select an option

  • Save jez/b248a409d19c9f1c94cd to your computer and use it in GitHub Desktop.

Select an option

Save jez/b248a409d19c9f1c94cd to your computer and use it in GitHub Desktop.

Revisions

  1. jez created this gist Oct 5, 2014.
    26 changes: 26 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # NOTE: Change "written" to the name of your TeX file with no extension
    TARGET=written

    all: $(TARGET).pdf

    ## Generalized rule: how to build a .pdf from each .tex
    LATEXPDFS=$(patsubst %.tex,%.pdf,$(wildcard *.tex))
    $(LATEXPDFS): %.pdf: %.tex
    pdflatex -interaction nonstopmode $(patsubst %.pdf,%.tex,$@)

    clean:
    rm *.aux *.log || true

    veryclean: clean
    rm $(TARGET).pdf

    view: $(TARGET).pdf
    if [ "Darwin" = "$(shell uname)" ]; then open $(TARGET).pdf ; else evince $(TARGET).pdf ; fi

    submit: $(TARGET).pdf
    cp $(TARGET).pdf ../

    print: $(TARGET).pdf
    lpr $(TARGET).pdf

    .PHONY: all clean veryclean view print