DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Makefile For Images In Latex

01.26.2006
| 5059 views |
  • submit to reddit
        This is a Makefile to build images for use by pdflatex from .gnuplot command files and .py python scripts. It is supposed that the gnuplot/python files produce .eps images when launched

all: sinus.pdf sincos.pdf sine.pdf sine2.pdf sincos2.pdf bode.pdf

.PHONY: all clean

# we want all .gnuplot files to be 'made' into .eps files
# the % replaces any name
# in the rule: 	$< replaces the source
# 				$@ replaces the target
# example: convert $< $@
# 
%.eps: %.gnuplot
	gnuplot < $<

%.eps: %.py
	python $<

%.pdf: %.eps
	epstopdf $<
	
clean:
	rm -f *.eps *.pdf