mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Set latex_elements['fontpkg'] = '' for Cyrillic languages (suggested by Dmitry Shachnev)
This commit is contained in:
5
CHANGES
5
CHANGES
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user