Hi all,
I'm a phd student and I'm writing my thesis.I need help:
first, I need a makefile to compile my files thesis (chapters): make thesis.ps (example).
second, I need to compile each chapter in separation inside the same makefile:
make chapter1.ps (of course of the same thesis)
Thanks,
mb
Math & Science ⇒ thesis and chapters
NEW: TikZ book now 40% off at Amazon.com for a short time.

thesis and chapters
Here is the make file I use to compile my thesis (There are a few if you google it, I have borrowed the bits I need). It runs latex/bibtex as many times as necessary to get all cross referencing right.
When you say compile each chapter, do you mean only include that chapter but still include all of the front and back matter ie. table of contents and bibliography?
You could add the line \includeonly{} to the main file then add a rule something like this for each chapter
Code: Select all
FILE=thesis
TEX=latex
RETEX="Rerun to get cross-references right"
BIB=bibtex
REBIB="There were undefined references"
PAPER=a4
FIGS=Figures/Chapter*/*.*ps*
$(FILE).dvi: *.tex $(FIGS) $(FILE).bib
$(TEX) $(FILE)
grep -q $(REBIB) $(FILE).log && $(BIB) $(FILE) ; true
while ($(TEX) $(FILE) && grep -q $(RETEX) $(FILE).log) do true ; done
#Create ps
$(FILE).ps: $(FILE).dvi
dvips -Ppdf -t$(PAPER) $< -o
ps: $(FILE).ps
You could add the line \includeonly{} to the main file then add a rule something like this for each chapter
Code: Select all
chapter1: chapter1.tex
sed 's/\includeonly{.*}/\includeonly{$@}/' $(FILE).tex > temp && mv temp $(FILE).tex
$(TEX) $(FILE)
grep -q $(REBIB) $(FILE).log && $(BIB) $(FILE) ; true
while ($(TEX) $(FILE) && grep -q $(RETEX) $(FILE).log) do true ; done