TeX/LaTeX/PDFLaTeX/XeLaTeX support
Example:
def configure(conf):
conf.load('tex')
if not conf.env.LATEX:
conf.fatal('The program LaTex is required')
def build(bld):
bld(
features = 'tex',
type = 'latex', # pdflatex or xelatex
source = 'document.ltx', # mandatory, the source
outs = 'ps', # 'pdf' or 'ps pdf'
deps = 'crossreferencing.lst', # to give dependencies directly
prompt = 1, # 0 for the batch mode
)
Notes:
To configure with a special program, use:
$ PDFLATEX=luatex waf configure
This tool doesn’t use the target attribute of the task generator (bld(target=...)); the target file name is built from the source base name and the out type(s)
Parse the inputs and try to find the bibunit dependencies
Returns: | list of bibunit files |
---|---|
Return type: | list of waflib.Node.Node |
List of typical file extensions included in latex files
List of typical file extensions that contain latex
Regexp for expressions that may include latex files
Regexp for bibtex files
Regexp for expressions that create glossaries
Bases: waflib.Task.Task
Compile a tex/latex file.
Override waflib.Task.Task.exec_command() to execute the command without buffering (latex may prompt for inputs)
Returns: | the return code |
---|---|
Return type: | int |
A recursive regex-based scanner that finds latex dependencies. It uses waflib.Tools.tex.re_tex
Depending on your needs you might want:
to change re_tex:
from waflib.Tools import tex
tex.re_tex = myregex
or to change the method scan from the latex tasks:
from waflib.Task import classes
classes['latex'].scan = myscanfunction
Check an exit status and raise an error with a particular message
Parameters: |
|
---|
Parse the .aux files to find bibfiles to process. If yes, execute waflib.Tools.tex.tex.bibtex_fun()
Parse the .aux file to find bibunit files. If there are bibunit files, execute waflib.Tools.tex.tex.bibtex_fun().
Look on the filesystem if there is a .idx file to process. If yes, execute waflib.Tools.tex.tex.makeindex_fun()
Runs the TeX build process.
It may require multiple passes, depending on the usage of cross-references, bibliographies, content susceptible of needing such passes. The appropriate TeX compiler is called until the .aux files stop changing.
Makeindex and bibtex are called if necessary.
Execute the program bibtex
Execute the program makeglossaries
Execute the program makeindex
Decorator: register a task generator method that will be executed when the object attribute ‘feature’ contains the corresponding key(s):
from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
print('that is my feature!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – feature names |
---|
Decorator: register a task generator method which will be executed before the functions of given name(s):
from waflib.TaskGen import feature, before
@feature('myfeature')
@before_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Task generator method
Create waflib.Tools.tex.tex objects, and dvips/dvipdf/pdf2ps tasks if necessary (outs=’ps’, etc).
Feature: | tex |
---|
Try to find the programs tex, latex and others. Do not raise any error if they are not found.
Features defined in this module: