SumatraPDF integration in LaTeX-Emacs-make tool chain

  1. upgrade to the most recent SumatraPDF http://code.google.com/p/sumatrapdf/downloads/list
  2. make sure sumatrapdf is in the search path
  3. update make file for the make integration
MAIN=maintex

EPS=img/*.eps

TEX=tomo_spectra.tex 

BIB=da.bib 

REBUILDABLES =  \
*.log   \
*.blg   \
*.bbl   \
*.aux   \
*.lof   \
*.lot   \

LATEXOPTIONS = -src-specials -interaction=nonstopmode

PDFVIEWER = sumatrapdf -reuse-instance -inverse-search "c:\emacs\bin\emacsclientw.exe +%l \"%f\""

BIBDIR = "C:/H/Bib"

BIBOPTIONS = -include-directory=$(BIBDIR)

vpath %.bib /cygdrive/c/H/Bib

viewpdf : $(MAIN).pdf
    $(PDFVIEWER) $(MAIN).pdf &

dvi : $(MAIN).dvi
    yap -1  $(MAIN).dvi

$(MAIN).pdf : $(MAIN).dvi
    pdfclosem $(MAIN).pdf ; dvipdfm $(MAIN).dvi

$(MAIN).dvi : $(MAIN).bbl $(EPS)
    latex $(LATEXOPTIONS) $(MAIN)
        if ( grep 'Rerun' $(MAIN).log > /dev/null ) ; then\
            latex $(LATEXOPTIONS) $(MAIN) ; \
        else :; fi

$(MAIN).bbl : $(TEX)
    rm -f $(MAIN).aux *.bbl; latex $(LATEXOPTIONS) $(MAIN); bibtex $(BIBOPTIONS) $(MAIN) 

clean :
    rm -f $(REBUILDABLES)
  1. if I need inverse search, pub /usepackage{pdfsync} before \begin{document}, or use pdflatex instead of latex
  2. why using sumatrapdf? it does not lock the pdf file, so when restarting the make process, I don’t need to close the pdf file manually.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s