summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/bxjscls
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-06-11 23:24:41 +0000
committerKarl Berry <karl@freefriends.org>2016-06-11 23:24:41 +0000
commit516124d8de871007f2d2443daf2b7faff9f7c2ea (patch)
tree5de64c5c008213f7bd5e4f3da02cfe1f0f847b66 /Master/texmf-dist/source/latex/bxjscls
parenta411266ac05ce46c420c480330d94e07ac8021fc (diff)
bxjscls (28may16)
git-svn-id: svn://tug.org/texlive/trunk@41394 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/bxjscls')
-rw-r--r--Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx96
1 files changed, 87 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx b/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx
index f0dd322b5a1..cc5774906d4 100644
--- a/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx
+++ b/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx
@@ -62,7 +62,9 @@
%<*driver>
\ProvidesFile{bxjscls.dtx}
%</driver>
- [2016/05/01 v1.1c BXJS document classes]
+ [2016/05/28 v1.1e BXJS document classes]
+% [2016/05/21 v1.1d BXJS document classes]
+% [2016/05/01 v1.1c BXJS document classes]
% [2016/03/27 v1.1b BXJS document classes]
% [2016/02/20 v1.1a BXJS document classes]
% [2016/02/14 v1.1 BXJS document classes]
@@ -1054,6 +1056,35 @@
\bxjs@simplejasetuptrue}
% \end{macrocode}
%
+% \begin{macro}{\ifbxjs@bigcode}
+% {\upTeX}で有効かするToUnicode CMapとして
+% 「|UTF8-UCS2|」の代わりに「|UTF8-UTF16|」を使うか。
+% BMP外の文字に対応できる「|UTF8-UTF16|」の方が望ましいのであるが、
+% このファイルが利用可能かの確実な判定が困難であるため、
+% オプションで指定することとする。
+% \begin{macrocode}
+\newif\ifbxjs@bigcode \bxjs@bigcodefalse
+% \end{macrocode}
+% その上で、「{\TeX}環境がある程度新しければ利用可能であろう」
+% と判断し |bxjs@bigcode| の既定値を真とする。
+% 具体的な判断基準として、
+% 「{\TeX}のバージョンが3.14159265(2014年1月)以上であるか」
+% を採用する。
+% \begin{macrocode}
+\edef\bxjs@tmpa{\expandafter\noexpand\csname\endcsname}
+\def\bxjs@tmpb#1 #2#3\@nil{%
+ \ifx1#2\bxjs@bigcodetrue \fi}
+\expandafter\bxjs@tmpb\meaning\bxjs@tmpa1 0\@nil
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareOption{nobigcode}{%
+ \bxjs@bigcodefalse}
+\DeclareOption{bigcode}{%
+ \bxjs@bigcodetrue}
+% \end{macrocode}
+%
% keyval型のオプションの処理。
% \begin{macrocode}
\def\bxjs@setkey{%
@@ -2874,11 +2905,36 @@
% \begin{ZRnote}
% \begin{macro}{\subtitle}
% 副題を設定する。
+% \Note プレアンブルにおいて |\newcommand*{\subtitle}{...}| が
+% 行われることへの対策として、
+% |\subtitle| の定義を |\title| の実行まで遅延させることにする。
+% もしどうしても主題より前に副題を設定したい場合は、
+% |\jsSubtitle| 命令を直接用いればよい。
+%
+% 本体を |\jsSubtitle| として定義する。
% \begin{macrocode}
-\newcommand*{\subtitle}[1]{\gdef\bxjs@subtitle{#1}}
+\newcommand*{\jsSubtitle}[1]{\gdef\bxjs@subtitle{#1}}
%\let\bxjs@subtitle\@undefined
% \end{macrocode}
+%
+% |\title| にフックを入れる。
+% \begin{macrocode}
+\renewcommand*{\title}[1]{\bxjs@decl@subtitle\gdef\@title{#1}}
+\AtBeginDocument{\bxjs@decl@subtitle}
+\def\bxjs@decl@subtitle{%
+ \global\let\bxjs@decl@subtitle\relax
+ \ifx\subtitle\@undefined
+ \global\let\subtitle\jsSubtitle
+ \fi}
+% \end{macrocode}
% \end{macro}
+%
+% \begin{macrocode}
+\def\bxjs@annihilate@subtitle{%
+ \ifx\subtitle\jsSubtitle \global\let\subtitle\relax \fi
+ \global\let\jsSubtitle\relax}
+% \end{macrocode}
+%
% \end{ZRnote}
%
% \begin{macro}{\etitle}
@@ -2989,6 +3045,7 @@
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
+ \bxjs@annihilate@subtitle
}%
\else
\newcommand{\maketitle}{\par
@@ -3023,6 +3080,7 @@
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
+ \bxjs@annihilate@subtitle
}
% \end{macrocode}
% \end{macro}
@@ -6944,7 +7002,12 @@
\else\ifnum\jis"2121="8140 %sjis
\bxjs@urgent@special{pdf:tounicode 90ms-RKSJ-UCS2}
\else\ifnum\jis"2121="3000 %uptex
- \bxjs@urgent@special{pdf:tounicode UTF8-UCS2}
+ \ifbxjs@bigcode
+ \bxjs@urgent@special{pdf:tounicode UTF8-UTF16}
+ \PassOptionsToPackage{bigcode}{pxjahyper}
+ \else
+ \bxjs@urgent@special{pdf:tounicode UTF8-UCS2}
+ \fi
\fi\fi\fi
\let\bxToUnicodeSpecialDone=t
\fi
@@ -7094,12 +7157,27 @@
%
% \paragraph{hyperref対策}
%
-% 昔の |hyperref| では |unicode| を無効にするのが正解だった。
-% ところが、現在では“形式上は” |unicode| を有効にするのが正解で、
-% 無効だと警告が出て強制的に有効化される。
-% 内部動作としては、「通常({\XeTeX}以外)の |unicode| 無効」の時と
-% 同じになるようである。
-% 取りあえず、ここでは |unicode| オプションの設定を行わない。
+% |unicode| オプションの指定に関する話。
+%
+% {\XeTeX}の場合は、xdvipdfmxがUTF-8→UTF-16の変換を行う機能を
+% 持っているため、本来はspecial命令の文字列の文字コード変換は不要である。
+% ところが、|hyperref| での方針としては、{\XeTeX}の場合にも
+% パッケージ側で文字コード変換を行う方が望ましいと考えている。
+% 実際、|unicode| を無効にしていると警告が出て強制的に有効化される。
+% 一方で、過去(r35125まで)^^A2014/09/20
+% のxdvipdfmxでは、文字列をUTF-16に変換した状態で与えるのは不正と
+% 見なしていて警告が発生する。
+%
+% これを踏まえて、ここでは、
+% 「{\XeTeX}のバージョンが0.99992以上の場合に |unicode| を既定で
+% 有効にする」
+% ことにする。
+% \Note 取りあえず固定はしない。
+% \begin{macrocode}
+\ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99992}>\m@ne
+ \PassOptionsToPackage{unicode}{hyperref}
+\fi
+% \end{macrocode}
%
% \paragraph{段落頭でのグルー挿入禁止}
%