Penguin
Diff: LatexMakefiles
EditPageHistoryDiffInfoLikePages

Differences between version 8 and predecessor to the previous major change of LatexMakefiles.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 8 Last edited on Monday, June 7, 2004 1:26:02 pm by AristotlePagaltzis Revert
Older page: version 6 Last edited on Thursday, October 16, 2003 6:39:33 pm by JohnMcPherson Revert
@@ -1,7 +1,7 @@
-In the process of writing 420 final reports, SamJansen and Tom Young worked to create some makefiles useful for Latex projects. Latex and Bibtex have some strange properties which makes writing makefiles for them an interesting challenge. This page is currently a work in progress. 
+In the process of writing 420 final reports, SamJansen and Tom Young worked to create some [MakeFile]s useful for [LaTeX] projects. [LaTeX] and Bibtex have some strange properties which makes writing [MakeFile]s for them an interesting challenge. This page is currently a work in progress. 
  
-!!A Basic Makefile 
+!! A Basic Makefile 
  
 (remember that the indented lines need tabs, not spaces) 
  
 A very basic makefile that does not support Bibtex, images, or multiple input files looks something like the following: 
@@ -51,10 +51,13 @@
  
 Probably the most interesting thing about the above makefile is that it uses __--interaction batchmode__ as an argument to Latex. The rest is a fairly standard makefile. Things get a little more complex when Bibtex and automatic image conversion is added to the makefiles. 
  
 ---- 
-!!A Simple Latex and Bibtex Makefile 
+  
+ !! A Simple Latex and Bibtex Makefile  
+  
 Serious people use bibtex to manage their references. Here is a makefile that should run bibtex and latex the appropriate number of times. 
+  
 (I've removed the extra targets and steps I had in here to run musixtex as well... -- JohnMcPherson) 
  
 <verbatim> 
 TARGET=proposal 
@@ -96,24 +99,24 @@
  
 </verbatim> 
  
 ---- 
-!!More Powerful Makefiles  
  
-Because of all the crap that Latex and Bibtex outputs, SamJansen decided to create a directory structure for the report that kept all the "work" files away from the main directory. 
+!! More Powerful Makefiles  
+  
+ Because of all the crap that Latex and Bibtex outputs, SamJansen decided to create a directory structure for the report that kept all the "work" files away from the main directory. There are a few additions by MattBrown below to allow images to be generated from .fig files and to spellcheck the report before generating it
  
 * ''images/'' contains all images and figures used in the report. All such images are converted to appropriate formats by the makefile in this directory. 
 * ''work/'' is used when Latex and Bibtex is run. Therefore all the extraneous files like .toc and .aux and so on are put in here. 
 * The root directory holds all .tex files and the main makefile. 
  
-__ Usage__:  
-  
-Place .tex file in the root directory, a .bib file in the root directory, and .eps, .png, .jpg and .dia images/figures in the ''images/'' directory. There are various targets used, just typing 'make' will just build a postscript file. The only editing of files needed is the top of the root makefile.  
+! Usage 
  
+Place .tex file in the root directory, a .bib file in the root directory, and .eps, .png, .jpg, .fig and .dia images/figures in the ''images/'' directory. There are various targets used, just typing 'make' will just build a pdf file. The only editing of files needed is the top of the root makefile.  
  
 Here is what the current version looks like: 
  
-!Makefile in the root directory 
+! Makefile in the root directory 
  
 <verbatim> 
 # vim: ts=8 noexpandtab 
 # $Id: Makefile,v 1.11 2003/10/11 04:12:43 stj2 Exp $ 
@@ -125,21 +128,23 @@
  
 # The following should not need editing: 
 export TEXFILES BIBFILE TARGET 
  
-$(TARGET).pdf: $(TEXFILES) $(BIBFILE) 
+$(TARGET).pdf: spellcheck $(TEXFILES) $(BIBFILE) 
  $(MAKE) -C images pdf 
  $(MAKE) -C work pdf 
  
-$(TARGET).ps: $(TEXFILES) $(BIBFILE) 
+$(TARGET).ps: spellcheck $(TEXFILES) $(BIBFILE) 
  $(MAKE) -C images ps 
  $(MAKE) -C work ps 
  
 $(TARGET).dvi: 
  $(MAKE) $(TARGET).ps 
  
+spellcheck:  
+ ispell -t $(TEXFILES)  
  
-.PHONY: show showx clean wordcount images debug 
+.PHONY: show showx clean wordcount images debug spellcheck  
  
 debug: 
  $(MAKE) -C images 
  $(MAKE) -C work debug 
@@ -179,10 +184,16 @@
  
 TEXS=$(foreach i,$(TEXFILES),$(addprefix ../,$i)) 
 BIB=$(addprefix ../,$(BIBFILE)) 
  
-$(TARGET).bbl: $(BIB) 
+$(TARGET).aux: $(TEXS)  
+ @cp -l $(TEXS) . 2>/dev/null; true  
+ @cp -l ../images/*.eps . 2>/dev/null; true  
+ latex --interaction batchmode $(TARGET)  
+  
+ $(TARGET).bbl: $(BIB) $(TARGET).aux  
  @cp -l $(BIB) . 2>/dev/null; true 
+ @cp -l ../images/*.eps . 2>/dev/null; true  
  bibtex -terse $(TARGET) 
  latex --interaction batchmode $(TARGET) 
  
 $(TARGET).dvi: $(TEXS) $(TARGET).bbl 
@@ -225,19 +236,21 @@
 .PHONY: pdf ps clean 
  
 PNGS=$(wildcard *.png) 
 DIAS=$(wildcard *.dia) 
+FIGS=$(wildcard *.fig)  
 EPSS=$(wildcard *.eps) 
  
-OUTPUT_EPS=$(PNGS:png=eps) $(DIAS:dia=eps) $(EPSS) 
+OUTPUT_EPS=$(PNGS:png=eps) $(DIAS:dia=eps) $(FIGS:fig =eps) $(EPSS) 
 OUTPUT_PDF=$(OUTPUT_EPS:eps=pdf) 
  
 pdf: $(OUTPUT_PDF) 
  
 ps: $(OUTPUT_EPS) 
  
 clean: 
  rm $(OUTPUT_PDF) $(DIAS:dia=eps) $(PNGS:png=eps) 2>/dev/null; true 
+ rm $(FIGS:fig=eps) 2>/dev/null; true  
  
 # Bitmap images -> EPS: PNG and JPG are covered at the moment, using 
 # ImageMagick's 'convert' utility 
 %.eps: %.png 
@@ -253,5 +266,10 @@
  
 # DIA -> EPS 
 %.eps: %.dia 
  dia --nosplash -e $@ $< 
+  
+# FIG -> EPS  
+%.eps: %.fig  
+ fig2dev -L eps $< $@  
+  
 </verbatim>