summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2012-10-13 13:56:16 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2012-10-13 13:56:16 (GMT)
commit1f12e6a3069220bf565b7eb4c4b130c21b67e2f6 (patch)
tree255ec38aea893ee25eab497d4cfca74119b9b070 /src
parentf9c10087c8be7de44caa38aab2f59a3c6f489367 (diff)
parentd3e6150b00540fc5fee56e46441dbb2390ad96b1 (diff)
downloadSCons-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')
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Tool/tex.py22
2 files changed, 20 insertions, 4 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index ca6c5df..29cb6a3 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -40,6 +40,8 @@ RELEASE 2.X.X -
From Rob Managan:
- Updated the TeX builder to support the \newglossary command
in LaTeX's glossaries package and the files it creates.
+ - Improve support for new versions of biblatex in the TeX builder
+ so biber is called automatically if biblatex requires it.
RELEASE 2.2.0 - Mon, 05 Aug 2012 15:37:48 +0000
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}'