Fixes #1923: Use babel features only if the babel latex element is nonempty.

This commit is contained in:
Georg Brandl 2015-07-25 16:51:45 +02:00
parent 468568bdcf
commit e4b42fe15f
2 changed files with 8 additions and 3 deletions

View File

@ -33,7 +33,8 @@ Bugs fixed
* #1949: Use ``safe_getattr`` in the coverage builder to avoid aborting with
descriptors that have custom behavior.
* #1915: Do not generate smart quotes in doc field type annotations.
* #1796, On py3, automated .mo building cause UnicodeDecodeError
* #1796: On py3, automated .mo building caused UnicodeDecodeError.
* #1923: Use babel features only if the babel latex element is nonempty.
Release 1.3.1 (released Mar 17, 2015)

View File

@ -342,8 +342,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
else:
language = 'english'
babel_prefix = '\\addto\\captions%s{' % language
babel_suffix = '}'
if self.elements['babel']:
babel_prefix = '\\addto\\captions%s{' % language
babel_suffix = '}'
else:
babel_prefix = ''
babel_suffix = ''
figure = self.builder.config.numfig_format['figure'].split('%s', 1)
if len(figure) == 1: