3 # Thomas Nagy, 2011 (ita)
6 Latex processing using "biber"
10 from waflib
import Task
, Logs
12 from waflib
.Tools
import tex
as texmodule
14 class tex(texmodule
.tex
):
15 biber_fun
, _
= Task
.compile_fun('${BIBER} ${BIBERFLAGS} ${SRCFILE}',shell
=False)
16 biber_fun
.__doc
__ = """
17 Execute the program **biber**
25 self
.env
.env
.update(os
.environ
)
26 self
.env
.env
.update({'BIBINPUTS': self
.texinputs(), 'BSTINPUTS': self
.texinputs()})
27 self
.env
.SRCFILE
= self
.aux_nodes
[0].name
[:-4]
29 if not self
.env
['PROMPT_LATEX']:
30 self
.env
.append_unique('BIBERFLAGS', '--quiet')
32 path
= self
.aux_nodes
[0].abspath()[:-4] + '.bcf'
33 if os
.path
.isfile(path
):
34 Logs
.warn('calling biber')
35 self
.check_status('error when calling biber, check %s.blg for errors' % (self
.env
.SRCFILE
), self
.biber_fun())
37 super(tex
, self
).bibfile()
38 super(tex
, self
).bibunits()
41 texfun
, vars = Task
.compile_fun('${LATEX} ${LATEXFLAGS} ${SRCFILE}', shell
=False)
43 texfun
, vars = Task
.compile_fun('${PDFLATEX} ${PDFLATEXFLAGS} ${SRCFILE}', shell
=False)
45 texfun
, vars = Task
.compile_fun('${XELATEX} ${XELATEXFLAGS} ${SRCFILE}', shell
=False)
49 Almost the same as in tex.py, but try to detect 'biber'
52 for p
in ' biber tex latex pdflatex xelatex bibtex dvips dvipdf ps2pdf makeindex pdf2ps'.split():
54 self
.find_program(p
, var
=p
.upper())
55 except self
.errors
.ConfigurationError
:
57 v
['DVIPSFLAGS'] = '-Ppdf'