Math & Science ⇒ thesis and chapters
thesis and chapters
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
thesis and chapters
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