diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-10-13 13:56:16 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-10-13 13:56:16 (GMT) |
commit | 1f12e6a3069220bf565b7eb4c4b130c21b67e2f6 (patch) | |
tree | 255ec38aea893ee25eab497d4cfca74119b9b070 /src/engine/SCons/Tool/tex.py | |
parent | f9c10087c8be7de44caa38aab2f59a3c6f489367 (diff) | |
parent | d3e6150b00540fc5fee56e46441dbb2390ad96b1 (diff) | |
download | SCons-1f12e6a3069220bf565b7eb4c4b130c21b67e2f6.zip SCons-1f12e6a3069220bf565b7eb4c4b130c21b67e2f6.tar.gz SCons-1f12e6a3069220bf565b7eb4c4b130c21b67e2f6.tar.bz2 |
Merged in managan/scons_biblatex2.2 (pull request #43, biber support)
Diffstat (limited to 'src/engine/SCons/Tool/tex.py')
-rw-r--r-- | src/engine/SCons/Tool/tex.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py index 0695755..5f24df0 100644 --- a/src/engine/SCons/Tool/tex.py +++ b/src/engine/SCons/Tool/tex.py @@ -129,6 +129,9 @@ LaTeXAction = None # An action to run BibTeX on a file. BibTeXAction = None +# An action to run Biber on a file. +BiberAction = None + # An action to run MakeIndex on a file. MakeIndexAction = None @@ -344,7 +347,9 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None must_rerun_latex = True # Now decide if biber will need to be run. - # The information that bibtex reads from the .bcf file is + # When the backend for biblatex is biber (by choice or default) the + # citation information is put in the .bcf file. + # The information that biber reads from the .bcf file is # pass-independent. If we find (below) that the .bbl file is unchanged, # then the last latex saw a correct bibliography. # Therefore only do this once @@ -357,11 +362,11 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None content = open(target_bcf, "rb").read() if content.find("bibdata") != -1: if Verbose: - print "Need to run bibtex on ",bcffilename + print "Need to run biber on ",bcffilename bibfile = env.fs.File(SCons.Util.splitext(target_bcf)[0]) - result = BibTeXAction(bibfile, bibfile, env) + result = BiberAction(bibfile, bibfile, env) if result != 0: - check_file_error_message(env['BIBTEX'], 'blg') + check_file_error_message(env['BIBER'], 'blg') must_rerun_latex = True # Now decide if latex will need to be run again due to index. @@ -880,6 +885,11 @@ def generate_common(env): if BibTeXAction is None: BibTeXAction = SCons.Action.Action("$BIBTEXCOM", "$BIBTEXCOMSTR") + # Define an action to run Biber on a file. + global BiberAction + if BiberAction is None: + BiberAction = SCons.Action.Action("$BIBERCOM", "$BIBERCOMSTR") + # Define an action to run MakeIndex on a file. global MakeIndexAction if MakeIndexAction is None: @@ -939,6 +949,10 @@ def generate_common(env): env['BIBTEXFLAGS'] = SCons.Util.CLVar('') env['BIBTEXCOM'] = CDCOM + '${TARGET.dir} && $BIBTEX $BIBTEXFLAGS ${SOURCE.filebase}' + env['BIBER'] = 'biber' + env['BIBERFLAGS'] = SCons.Util.CLVar('') + env['BIBERCOM'] = CDCOM + '${TARGET.dir} && $BIBER $BIBERFLAGS ${SOURCE.filebase}' + env['MAKEINDEX'] = 'makeindex' env['MAKEINDEXFLAGS'] = SCons.Util.CLVar('') env['MAKEINDEXCOM'] = CDCOM + '${TARGET.dir} && $MAKEINDEX $MAKEINDEXFLAGS ${SOURCE.file}' |