Commits

Jon Waltman committed 7a82efd

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

Comments (2)

Files changed (3)

 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.
 
         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,
         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

sphinx/writers/latex.py

             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'):
             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