Skip to content

Instantly share code, notes, and snippets.

@k3yavi
Created March 22, 2018 21:01
Show Gist options
  • Save k3yavi/709bea5bc875d3991b7590394459e24e to your computer and use it in GitHub Desktop.
Save k3yavi/709bea5bc875d3991b7590394459e24e to your computer and use it in GitHub Desktop.
ALL = alevin.pdf
TEXFILES = alevin
# STYFILES = our-comments
CLSFILES = bmcart
FIGURES = figs/alevin.pdf figs/timing.pdf
LATEXMKOPTS = -pdf -dvi-
LATEX = pdflatex
BIBFILES = bmc_article
########### Shouldn't require configuration below here ##########
# run "make CONT=1" for continuous compilation
ifdef CONT
LATEXMKOPTS += -pvc
FORCED = .PHONY
endif
all: $(ALL)
zip: all
rm -rf alevin.tgz
tar cvzf alevin.tgz \
alevin.pdf \
$(ALL) \
alevin.tex \
$(BIBFILES:=.bib) \
figs/alevin.pdf figs/timing.pdf
# figs/Patro.287.fig.1.pdf figs/Patro.287.fig.3.png figs/Patro.287.fig.4b.pdf figs/Patro.287.fig.4d.pdf figs/Patro.287.fig.4f.pdf figs/Patro.287.fig.5b.pdf \
# figs/Patro.287.fig.2.pdf figs/Patro.287.fig.4a.pdf figs/Patro.287.fig.4c.pdf figs/Patro.287.fig.4e.pdf figs/Patro.287.fig.5a.pdf
$(ALL): $(TEXFILES:=.tex) $(STYFILES:=.sty) $(CLSFILES:=.cls) $(FIGURES) $(BIBFILES:=.bib)
# How to compile a .tex file to a .pdf file
%.pdf: %.tex $(FORCED)
@if (command -v latexmk > /dev/null) ; then latexmk $(LATEXMKOPTS) $< ; \
else $(LATEX) $<; bibtex $@; $(LATEX) $<; $(LATEX) $<; fi
#
# Rules for converting various figure formats to pdf
#
%.pdf_tex: %.svg
inkscape -A $(@:.pdf_tex=.pdf) --export-latex $<
%.pdf: %.svg
inkscape -A $@ $<
%.pdf: %.dia
dia --nosplash -e $(@:.pdf=.eps) $(@:.pdf=.dia)
epstopdf $(@:.pdf=.eps)
%.pdf: %.fig
fig2dev -L pdftex $< $@
%.pdf_t: %.fig %.pdf
fig2dev -L pdftex_t -p $(@:.pdf_t=.pdf) $< $@
%.pstex_t: %.fig
fig2dev -L pstex_t -p $(@:.pstex_t=.pstex) $< $@
fig2dev -L pstex $< $(@:.pstex_t=.pstex)
.PHONY:
clean:
latexmk -C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment