Apr 102008
 

A couple of weeks ago, I posted an article on how make and Makefiles can help you to organise your Stata projects. If you are working in a unix environnment, you’ll already have make installed. If you work under Windows, install GNU make – it’s free, and it can make your Stata day. Rather unsurprisingly, make is also extremely useful if you have large or medium-sized latex project (or if you want to include tables and/or graphs produced by Stata) in a latex document. For instance, this comes handy if you have eps-Figures and use pdflatex. pdflatex produces pdf files instead of dvi files. If you produces slides with, this can save you a lot of time because you don’t have to go through the latex – dvips – ps2pdf cycle. However, pdflatex cannot read eps files: you have to convert your eps files with pstoedit to the meta post format, then use meta post to convert them to mps (which can be read by pdflatex). With this Makefile snippet, everything happens automagically:


#New implicit rules for conversion of eps->mp->mps
#Change path if you have installed pstoedit in some other place
%.mp : %.eps
c:pstoedit/pstoedit.exe -f mpost $*.eps $*.mp

%.mps: %.mp
mpost $*.mp
mv $*.1 $*.mps
rm $*.mp

#Now specify a target

presentation.pdf: presentation.tex mytab1.tex myfig.mps

#Optional: if you want to create dataset x.eps, run x.do
#Stata must be in your path
%.eps : %.do
tab wstata -e do $<

Now type make presentation.pdf, and make will call Stata, pstoedit, metapost and pdflatex as required. If you need more figures, just write the do-file and add a dependency.

Social Bookmarks:
delicious Makefile helps with latex, toobluedot Makefile helps with latex, tooconnotea Makefile helps with latex, toodigg Makefile helps with latex, toofurl Makefile helps with latex, toomagnolia Makefile helps with latex, toonewsvine Makefile helps with latex, tooreddit Makefile helps with latex, toospurl Makefile helps with latex, toostumbleit Makefile helps with latex, tootechnorati Makefile helps with latex, tooque Makefile helps with latex, too

Technorati Tags: , , , , , , , , , , , , ,

Related posts:

  1. How Stata and a Makefile can make your day
  2. Resolved: French Departements, INSEE, ISO and NUTS-3 codes
Post comment as twitter logo facebook logo
Sort: Newest | Oldest