Commits

Georg Brandl committed 2d6e1aa

Fix #574: Improvement to Japanese LaTeX support.

  • Participants
  • Parent commits cc39287

Comments (0)

Files changed (2)

sphinx/texinputs/Makefile

 all-dvi: $(ALLDVI)
 all-ps: all-dvi
 	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'
+
+all-pdf-ja:
+	for f in *.pdf *.png *.gif *.jpg *.jpeg; do ebb $$f; done
+	for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done
+	for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done
+	for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done
+	for f in *.idx; do mendex -U -f -d "`basename $$f .idx`.dic" -s python.ist $$f; done
+	for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done
+	for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done
+	for f in *.dvi; do dvipdfmx $$f; done
 
 zip: all-$(FMT)
 	mkdir $(ARCHIVEPREFIX)docs-$(FMT)
 	rm -f *.dvi *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla
 
 .PHONY: all all-pdf all-dvi all-ps clean
+.PHONY: all-pdf-ja
 

sphinx/writers/latex.py

             if lang:
                 self.elements['classoptions'] += ',' + babel.get_language()
             elif builder.config.language == 'ja':
-                self.elements['classoptions'] += ',english,dvipdfm'
+                self.elements['classoptions'] += ',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'
+                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}}'