Set latex_elements['fontpkg'] = '' for Cyrillic languages (suggested by Dmitry Shachnev)

This commit is contained in:
Jonathan Waltman
2013-02-22 02:16:02 -06:00
parent 6294258b0d
commit 15b34a0940
3 changed files with 21 additions and 0 deletions

View File

@@ -1,8 +1,13 @@
Release 1.2 (in development)
============================
* The ``'fontpkg'`` item in :confval:`latex_elements` now defaults to ``''``
when the :confval:`language` uses the Cyrillic script.
Suggested by Dmitry Shachnev.
* PR#114: The LaTeX writer now includes the "cmap" package by default. The
``'cmappkg'`` item in :confval:`latex_elements` can be used to control this.
Thanks to Dmitry Shachnev.
* New locales: #1113: Added Hebrew locale.

View File

@@ -1068,6 +1068,10 @@ These options influence LaTeX output.
Font package inclusion, default ``'\\usepackage{times}'`` (which uses
Times and Helvetica). You can set this to ``''`` to use the Computer
Modern fonts.
.. versionchanged:: 1.2
Defaults to ``''`` when the :confval:`language` uses the Cyrillic
script.
``'fncychap'``
Inclusion of the "fncychap" package (which makes fancy chapter titles),
default ``'\\usepackage[Bjarne]{fncychap}'`` for English documentation,
@@ -1102,6 +1106,8 @@ These options influence LaTeX output.
Commands used to display transitions, default
``'\n\n\\bigskip\\hrule{}\\bigskip\n\n'``. Override if you want to
display transitions differently.
.. versionadded:: 1.2
``'printindex'``
"printindex" call, the last thing in the file, default
``'\\printindex'``. Override if you want to generate the index

View File

@@ -107,6 +107,12 @@ class ExtBabel(Babel):
return '\\shorthandoff{"}'
return ''
def uses_cyrillic(self):
shortlang = self.language.split('_')[0]
return shortlang in ('bg','bulgarian', 'kk','kazakh',
'mn','mongolian', 'ru','russian',
'uk','ukrainian')
# in latest trunk, the attribute is called Babel.language_codes and already
# includes Slovene
if hasattr(Babel, '_ISO639_TO_BABEL'):
@@ -208,6 +214,10 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.elements['shorthandoff'] = babel.get_shorthandoff()
self.elements['fncychap'] = '\\usepackage[Sonny]{fncychap}'
# Times fonts don't work with Cyrillic languages
if babel.uses_cyrillic():
self.elements['fontpkg'] = ''
# pTeX (Japanese TeX) for support
if builder.config.language == 'ja':
# use dvipdfmx as default class option in Japanese