mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get rid of the workaround for cyrillic in the manual latex builder by not using a cyrillic example
This commit is contained in:
parent
d003a61ebe
commit
86b26119f0
@ -6,8 +6,6 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from sphinx.builders.latex import LaTeXBuilder
|
from sphinx.builders.latex import LaTeXBuilder
|
||||||
from sphinx.util.logging import getLogger
|
from sphinx.util.logging import getLogger
|
||||||
from sphinx.writers.latex import LaTeXTranslator
|
from sphinx.writers.latex import LaTeXTranslator
|
||||||
@ -30,14 +28,3 @@ class FixedLaTeXTranslator(LaTeXTranslator):
|
|||||||
class LaTeXHelpBuilder(LaTeXBuilder):
|
class LaTeXHelpBuilder(LaTeXBuilder):
|
||||||
name = 'mylatex'
|
name = 'mylatex'
|
||||||
default_translator_class = FixedLaTeXTranslator
|
default_translator_class = FixedLaTeXTranslator
|
||||||
|
|
||||||
def finish(self):
|
|
||||||
super().finish()
|
|
||||||
info('Fixing Cyrillic characters...')
|
|
||||||
tex = os.path.join(self.outdir, 'calibre.tex')
|
|
||||||
with open(tex, 'r+b') as f:
|
|
||||||
raw = f.read().decode('utf-8')
|
|
||||||
for x in (u'Михаил Горбачёв', u'Фёдор Миха́йлович Достоевский'):
|
|
||||||
raw = raw.replace(x, u'{\\fontencoding{T2A}\\selectfont %s}' % (x.replace(u'а́', u'a')))
|
|
||||||
f.seek(0)
|
|
||||||
f.write(raw.encode('utf-8'))
|
|
||||||
|
@ -531,15 +531,12 @@ OptionRecommendation(name='asciiize',
|
|||||||
recommended_value=False, level=OptionRecommendation.LOW,
|
recommended_value=False, level=OptionRecommendation.LOW,
|
||||||
help=(_('Transliterate Unicode characters to an ASCII '
|
help=(_('Transliterate Unicode characters to an ASCII '
|
||||||
'representation. Use with care because this will replace '
|
'representation. Use with care because this will replace '
|
||||||
'Unicode characters with ASCII. For instance it will replace "%s" '
|
'Unicode characters with ASCII. For instance it will replace "{0}" '
|
||||||
'with "Mikhail Gorbachiov". Also, note that in '
|
'with "{1}". Also, note that in '
|
||||||
'cases where there are multiple representations of a character '
|
'cases where there are multiple representations of a character '
|
||||||
'(characters shared by Chinese and Japanese for instance) the '
|
'(characters shared by Chinese and Japanese for instance) the '
|
||||||
'representation based on the current calibre interface language will be '
|
'representation based on the current calibre interface language will be '
|
||||||
'used.')%
|
'used.').format('Pelé', 'Pele'))
|
||||||
'\u041c\u0438\u0445\u0430\u0438\u043b '
|
|
||||||
'\u0413\u043e\u0440\u0431\u0430\u0447\u0451\u0432'
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
|
||||||
OptionRecommendation(name='keep_ligatures',
|
OptionRecommendation(name='keep_ligatures',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user