help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using make for latex


From: James
Subject: using make for latex
Date: Sat, 18 Sep 2010 09:15:29 -0400

Hi all,

I'm using make to manage the compilation of latex documents.  Latex offers 
two compilers, "latex" and "pdflatex" that create .dvi and .pdf files, 
respectively.  When compiling either one, the list of steps (including 
multiple runs of latex, each run builds on the outputs of the last run until 
a final version is created) and command line arguments are the same, its 
just the compiler that is different.

I have something like the following:

%.dvi:
     latex ... args ...
     command1
     latex ... args ...
     command2
     command3
     latex ... args ...

%.pdf:
     pdflatex ... args ...
     command1
     pdflatex ... args ...
     command2
     command3
     pdflatex ... args ...

What is the best way to handle this so I don't have to maintain two 
identical lists of commands?  Is there a way to do (in pseudocode of 
course):

if creating dvi then
  compiler = latex
else
  compiler = pdflatex
end if
$(compiler) ...args...
command1
$(compiler) ...args...
command2
command3
$(compiler) ...args...


Thanks
James
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]