Differences between version 7 and predecessor to the previous major change of LatexMakefiles.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 7 | Last edited on Sunday, May 30, 2004 3:43:30 pm | by MattBrown | Revert |
Older page: | version 6 | Last edited on Thursday, October 16, 2003 6:39:33 pm | by JohnMcPherson | Revert |
@@ -98,17 +98,17 @@
----
!!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.
+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.
+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:
@@ -125,21 +125,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 +181,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 +233,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 +263,10 @@
# DIA -> EPS
%.eps: %.dia
dia --nosplash -e $@ $<
+
+# FIG -> EPS
+%.eps: %.fig
+ fig2dev -L eps $< $@
+
</verbatim>