summaryrefslogtreecommitdiff
path: root/sphinx/texinputs
diff options
context:
space:
mode:
authorAkihiro Uchida <uchida@ike-dyn.ritsumei.ac.jp>2011-11-09 20:51:48 +0900
committerAkihiro Uchida <uchida@ike-dyn.ritsumei.ac.jp>2011-11-09 20:51:48 +0900
commit6b22eb99829c3ef36d306657fd6b4b5cd02d7af3 (patch)
treec24249a91fc288dd8e62ec334e3c5d23c904cbfc /sphinx/texinputs
parent9ee282995b60455905bf2eefd6fd88f5d1969dab (diff)
downloadsphinx-6b22eb99829c3ef36d306657fd6b4b5cd02d7af3.tar.gz
support pTeX and dvipdfmx with sphinx.sty
Diffstat (limited to 'sphinx/texinputs')
-rw-r--r--sphinx/texinputs/sphinx.sty22
1 files changed, 22 insertions, 0 deletions
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty
index 08adec9e..01a642a9 100644
--- a/sphinx/texinputs/sphinx.sty
+++ b/sphinx/texinputs/sphinx.sty
@@ -45,6 +45,13 @@
%\renewcommand{\paperwidth}{8.5in} % typical squarish manual
%\renewcommand{\paperwidth}{7in} % O'Reilly ``Programmming Python''
+% use pdfoutput for pTeX and dvipdfmx
+\ifx\kanjiskip\undefined\else
+ \ifx\Gin@driver{dvipdfmx.def}\undefined\else
+ \newcount\pdfoutput\pdfoutput=0
+ \fi
+\fi
+
% For graphicx, check if we are compiling under latex or pdflatex.
\ifx\pdftexversion\undefined
\usepackage{graphicx}
@@ -419,6 +426,21 @@
\addcontentsline{toc}{chapter}{\indexname}
}
+% to make pdf with correct encoded bookmarks in Japanese
+% this should precede the hyperref package
+\ifx\kanjiskip\undefined\else
+ \usepackage{atbegshi}
+ \ifx\ucs\undefined
+ \ifnum 42146=\euc"A4A2
+ \AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}}
+ \else
+ \AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}}
+ \fi
+ \else
+ \AtBeginShipoutFirst{\special{pdf:tounicode UTF8-UCS2}}
+ \fi
+\fi
+
% Include hyperref last.
\RequirePackage[colorlinks,breaklinks,
linkcolor=InnerLinkColor,filecolor=OuterLinkColor,