#574: Add special code for better support of Japanese documents in the LaTeX builder.

This commit is contained in:
Georg Brandl 2011-01-03 23:13:40 +01:00
parent 205d50a01d
commit 256517b902
3 changed files with 19 additions and 0 deletions

View File

@ -1,6 +1,9 @@
Release 1.0.6 (in development) Release 1.0.6 (in development)
============================== ==============================
* #574: Add special code for better support of Japanese documents
in the LaTeX builder.
* Regression of #77: If there is only one parameter given with * Regression of #77: If there is only one parameter given with
``:param:`` markup, the bullet list is now suppressed again. ``:param:`` markup, the bullet list is now suppressed again.

View File

@ -14,6 +14,15 @@ all-pdf: $(ALLPDF)
all-dvi: $(ALLDVI) all-dvi: $(ALLDVI)
all-ps: all-dvi all-ps: all-dvi
for f in *.dvi; do dvips $$f; done for f in *.dvi; do dvips $$f; done
all-pdf-ja: $(wildcard *.tex)
ebb $(wildcard *.pdf *.png *.gif *.jpeg)
platex -kanji=utf8 $(LATEXOPTS) '$<'
platex -kanji=utf8 $(LATEXOPTS) '$<'
platex -kanji=utf8 $(LATEXOPTS) '$<'
-mendex -U -f -d '$(basename $<).dic' -s python.ist '$(basename $<).idx'
platex -kanji=utf8 $(LATEXOPTS) '$<'
platex -kanji=utf8 $(LATEXOPTS) '$<'
dvipdfmx '$(basename $<).dvi'
zip: all-$(FMT) zip: all-$(FMT)
mkdir $(ARCHIVEPREFIX)docs-$(FMT) mkdir $(ARCHIVEPREFIX)docs-$(FMT)

View File

@ -191,6 +191,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
lang = babel.get_language() lang = babel.get_language()
if lang: if lang:
self.elements['classoptions'] += ',' + babel.get_language() self.elements['classoptions'] += ',' + babel.get_language()
elif builder.config.language == 'ja':
self.elements['classoptions'] += ',english,dvipdfm'
# not elements of babel, but this should be above sphinx.sty.
# because pTeX (Japanese TeX) cannot handle this count.
self.elements['babel'] += r'\newcount\pdfoutput\pdfoutput=0'
# to make the pdf with correct encoded hyperref bookmarks
self.elements['preamble'] += r'\AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}'
else: else:
self.builder.warn('no Babel option known for language %r' % self.builder.warn('no Babel option known for language %r' %
builder.config.language) builder.config.language)