Monday, December 2, 2013

compile latex

two ways:
1. use pdflatex: compile latex to pdf
$latexpdf main.tex

this method does not work well with .eps images

2. use latex: compile latex to dvi; then use dvipdfm: compile dvi to pdf
$latex main.tex
$dvipdfm main.dvi

bibtex main.tex generates all of the .bbl. you can manually put it in the main.tex


sample Makefile for method 1
TARGETS = main

LATEX = pdflatex
BIBTEX = bibtex

all:    $(TARGETS) debug

$(TARGETS):
$(LATEX) $@
$(BIBTEX) $@ > $(BIBTEX)_out.log


debug:
-grep Warning *.log
clean:  

rm -f images/*.aux images/*~ images/*.log *.aux *.bbl *.blg *.log *.dvi *.bak *~ $(TARGETS:%=%.pdf)

sample Makefile for method 2
TARGETS = main

LATEX = latex
DVIPDFM = dvipdfm
BIBTEX = bibtex

all:    $(TARGETS) debug

$(TARGETS):
$(LATEX) $@
-$(BIBTEX) $@ > $(BIBTEX)_out.log
$(DVIPDFM) $@

debug:
-grep Warning *.log
clean:  

rm -f *.aux images/*.aux *.bbl *.blg *.log images/*.log *.dvi *.bak *~ $(TARGETS:%=%.pdf)





No comments: