texlive[44481] Master/texmf-dist: bxbase (30may17)
commits+karl at tug.org
commits+karl at tug.org
Tue Jun 6 01:15:19 CEST 2017
Revision: 44481
http://tug.org/svn/texlive?view=revision&revision=44481
Author: karl
Date: 2017-06-06 01:15:19 +0200 (Tue, 06 Jun 2017)
Log Message:
-----------
bxbase (30may17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/bxbase/LICENSE
trunk/Master/texmf-dist/tex/latex/bxbase/bxbase.def
trunk/Master/texmf-dist/tex/latex/bxbase/bxbase.sty
trunk/Master/texmf-dist/tex/latex/bxbase/bxutf8.def
trunk/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def
trunk/Master/texmf-dist/tex/latex/bxbase/zxbase.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/bxbase/README-ja.md
trunk/Master/texmf-dist/doc/latex/bxbase/README.md
trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.pdf
trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.tex
trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ext.def
trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ja.def
trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.def
trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.sty
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/bxbase/00README
trunk/Master/texmf-dist/doc/latex/bxbase/README
trunk/Master/texmf-dist/tex/latex/bxbase/bxucs.sty
Deleted: trunk/Master/texmf-dist/doc/latex/bxbase/00README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxbase/00README 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/doc/latex/bxbase/00README 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,47 +0,0 @@
-
-Package bxucs
- bxucs.sty, bxutf8.def
-
-Description:
- Simple Unicode support to use with TrueType fonts
-
-Example with 'Charis SIL'
-
-1. Name the family and font base name.
- - Here I use 'fsch' and 'zfsch'
-2. Setup this family for some ordinary TeX encoding (say T1).
- - (Ex) Generate zfschr8t.tfm by:
- ttf2tfm CharisSILR.ttf zfschr at TeXStd@.tfm
- - Make t1fsch.fd as follows:
-<t1fsch.fd>
-\DeclareFontFamily{T1}{fsch}{}
-\DeclareFontShape{T1}{fsch}{m}{n}{<->zfschr8t}{}
-<EOF>
-3. Setup this family for Unicode-subfont (USF) encoding.
- - Generate USF-encoding TFMs:
- ttf2tfm CharisSILR.ttf zfschr9u- at Unicode@.tfm
- - Note the valid UCS-row range:
- 00-05,1D-1E,20-25,27,2C,A7,F1-F3,FB,FE-FF
- - Make a special FD file for USF-encoding:
-<usffsch.fd>
-\USFDeclareFontShape{fsch}{00-05,1D-1E,20-25,27,2C,A7,F1-F3,FB,FE-FF}{
- \USFShape{m}{n}{<->zfschr9z-#1}{}
-}
-<EOF>
-
-
-bxutf8.def: <utf8> -> \bxus at uc
-bxutf8s.def: <utf8> -> <bxutf8.def> / \bxus at uc
-
-\bxus at uc
-
-
-
-
-
-utf8 - bxucs - otf
-
-
-utf8 - bxucs - otf
-
-
Modified: trunk/Master/texmf-dist/doc/latex/bxbase/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxbase/LICENSE 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/doc/latex/bxbase/LICENSE 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,9 +1,6 @@
-$BK\%=%U%H%&%'%"$O(B MIT $B%i%$%;%s%9$N2<$GG[I[$5$l$^$9!#Cx:n8"$O:n<T$G$k!V(BZR$B!W$K(B
-$BB0$7$^$9!#$^$?K\%=%U%H%&%'%"$OL5J]>Z$G$9!#(B
-
The MIT License
-Copyright (c) 2009 ZR
+Copyright (c) 2017 Takayuki YATO (aka. "ZR")
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Deleted: trunk/Master/texmf-dist/doc/latex/bxbase/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxbase/README 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/doc/latex/bxbase/README 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,472 +0,0 @@
-==================================================
-== BXbase バンドル v0.5 <2010/06/15> ==
-== by「ZR」(八登 崇之/Takayuki YATO)==
-== <zrbabbler at yahoo.co.jp> ==
-==================================================
-(This file is encoded in UTF-8,)
-
-欧文 LaTeX2e における多言語文書およびそれに関わるマクロパッケージの作成
-を支援する基本的な機能を提供する。
-
- - bxutf8 入力エンコーディング: UTF-8 入力
- - bxutf8x 入力エンコーディング: UTF-8 入力
- - bxbase パッケージ: 基礎ライブラリ
- - bxucs パッケージ: 欧文 Unicode 文字出力
-
-※ 対応環境は各々のパッケージの解説を参照。
-
-■ 本ソフトウェアの一次配布サイト(作者のサイト)
-
- En toi Pythmeni tes TeXnopoleos 〜電脳世界の奥底にて〜
- http://zrbabbler.hp.infoseek.co.jp/
-
- ※ 以下のページに一部機能の使用例を紹介した。
- 「Unicode による文字入力」
- http://zrbabbler.hp.infoseek.co.jp/unichar.html
- 「BXbase パッケージ」
- http://zrbabbler.hp.infoseek.co.jp/bxbase.html
-
-■ インストール
-
- TDS 1.1 に従ったシステムでは、各ファイルを次の場所に移動する。
- ・*.sty, *.def → $TEXMF/tex/latex/BXbase/
- (残りのファイルは不要)
-
- W32TeX を C:\usr\local にインストールした場合の例。
- ・*.sty, *.def → C:\usr\local\share\texmf-local\tex\latex\BXbase
-
---------------------------------------------------
- bxutf8 入力エンコーディング (v0.5) -- UTF-8 入力
---------------------------------------------------
-
-LaTeX2e 標準の utf8 入力エンコーディングを拡張して、utf8 で処理できない
-文字について符号値を含む中間形式に変換する。この中間形式は他のパッケージ
-が処理することが想定されている。
-
-■ 対応環境
-
- 欧文 LaTeX2e / pLaTeX2e / upLaTeX2e
-
-■ 読込
-
- inputenc のオプションとして指定する。
- \usepackage[bxutf8]{inputenc}
-
- inputenc が読み込み済の場合は \inputencoding を使う。
- \inputencoding{bxutf8}
-
- 本文中で他の入力エンコーディングとの間で切り替えることも可能であるが、
- その場合は、一度プレアンブルのどこかで入力エンコーディングを bxutf8
- に切り替えなければならない(bxutf8.def が内部で読み込む utf8.def の
- 仕様による)。本文での切り替えはあまりテストされていないので、バグが
- ある可能性が高い ;-)
-
-■ 機能
-
- bxutf8 は utf8 の拡張である。utf8 は UTF-8 で書かれた文字を次のよう
- に処理する。その文字が出力方法を知っている—つまり読込済のフォント
- エンコーディングに含まれる—文字の場合、それを LaTeX の標準的な内部
- 形式(\"a や \OE 等)に変換して後をフォントエンコーディング(fontenc)
- の処理に任せる。しかし、知らない文字の場合はエラーになる。
-
- bxutf8 は「知らない文字」の場合の処理を変更し、これを \bxUHex{XXXX}
- の形式に変換する。ここで XXXX は該当の文字のコード値の 16 進表現で
- ある。\bxUHex は該当の文字を出力することが想定されているが、これの
- 定義(「ドライバ」と呼ぶことにする)は他のパッケージで与えられる。
- bxutf8 自身のドライバの定義は単にエラーを出すだけである。
-
-■ 注意事項
-
- - UTF-8 のバイト列から \bxUHex の形式までは完全展開可能になっている。
- また、\bxUHex の定義は robust でなければならない。これは他の入力
- エンコーディングと共通の性質である。
- - 0.5 版の改訂で、BMP 外(U+10000 以上)の符号値に対応した。
- - pLaTeX/upLaTeX の場合、入力漢字コードは UTF-8 (-kanji=utf8) である
- 必要がある。この場合、処理系により和文トークンと解釈される文字以外
- が bxutf8 の処理に回る。
- - utf8 が扱える文字については飽くまでも utf8 と全く同じように処理
- されることに注意。例えば、フォントエンコーディングに OT1 と T2A が
- 読み込まれている状態で「Д」が入力されると、utf8 はこれを \CYRD に
- 変換するが、これは現在のフォントエンコーディングが OT1 である時は
- エラーになる(たとえ \bxUHex がフォントエンコーディングに関わらず
- 動作するとしても)。
-
-
----------------------------------------------------
- bxutf8x 入力エンコーディング (v0.3) -- UTF-8 入力
----------------------------------------------------
-
-Unicode パッケージ(ucs パッケージ)が使用する utf8x 入力エンコーディング
-を拡張して、bxutf8 と同様の機能を実現したものである。
-
-■ 対応環境
-
- 欧文 LaTeX2e / pLaTeX2e / upLaTeX2e
-
-■ 読込
-
- inputenc のオプションとして指定する。
- \usepackage[bxutf8]{inputenc}
-
- inputenc が読み込み済の場合は \inputencoding を使う。
- \inputencoding{bxutf8}
-
- 後者の使用については、bxutf8 と同じ制限の他に、utf8x に特有の制限
- がある。
-
-■ 機能
-
- 基本的には bxutf8 と同じなので、相違点を挙げておく。
-
- - utf8x (ucs) のプログラムは utf8 と比して遥かに複雑である。従って
- bxutf8x が正しく実装されているかについてはあまり自信が無い。
- - bxutf8x は \bxUInt という内部命令を用いる。
- - utf8x は実際にフォントエンコーディングが読み込まれているかに関わら
- ず広範な範囲の文字を自分で処理しようとする。結果的に、欧文の文字に
- 関してはほとんど \bxUInt に変換されない。CJK 文字に対しては utf8x
- は既定では処理しないので \bxUInt に変換される。
-
-
---------------------------------------------
- bxbase パッケージ (v0.5) -- 基礎ライブラリ
---------------------------------------------
-
-他の BX シリーズのパッケージの下請けが主な役目である。文書作成者がこの
-パッケージを読み込む場面は少ない。
-
-■ 対応環境
-
- 欧文 LaTeX2e / pLaTeX2e / upLaTeX2e
-
-■ 読込
-
- \usepackage で読み込む。オプションはない。
-
-■ pxbase パッケージとの関係
-
- bxbase パッケージと pxbase パッケージ(PX シリーズ)は大部分の機能を
- 共通にしている。両方読み込んだ場合は、共通する機能については版が
- 新しい方が採用される。過去互換性を崩す更新は行われないので、このこと
- に関して文書作成者が気にする必要はないはずである。
-
- なお、現在の所、bxbase のみに存在する機能はない。
-
-■ 機能
-
- DVI special 出力の命令。
-
- \recordpapersize
- 次の形の papersize special 命令を DVI の先頭に出力する。
- papersize=<幅>,<高さ>
- (幅と高さは現在の \paperwidth と \paperheight の値。)
-
- \dvipdfmxmapline{<テキスト>}
- dvipdfmx のマップ指定を文書中で行う。
- ※次の形の papersize special 命令を DVI の先頭に出力する。
- pdf:mapline <テキスト>
-
- \dvipdfmxmapfile{<ファイル名>}
- dvipdfmx のマップファイル指定を文書中で行う。
- ※次の形の papersize special 命令を DVI の先頭に出力する。
- pdf:mapfile <ファイル名>
-
- 符号値による文字入力のための命令。
-
- \Ux{<コード値>,...}
- \UI{<コード値>,...}
- Unicode コード値による入力を行う。\Ux は欧文用、\UI は和文用(I は
- Ideographic の意味)。コード値は以下の形式で表す。コンマで区切って
- 複数文字入力できる。
- - <16進数>: A72C, 02000B, 1bd 等。
- - +<10進数>: +254, +0937 等。
- - '<8進数>: '376, '1651 等。
- Unicode 文字の出力には次の順番で利用可能な最初の機能を用いる。(\UI
- の場合 3) を飛ばす。)
- 1) zxjatype パッケージ。この場合、その機構に従って出力される。\UI
- は必ず和文フォントで出力し、\Ux は和文/欧文切替の対象となる。
- 2) XeTeX の Unicode 出力。
- 3) [\Ux のみ] bxums パッケージ。
- 4) upTeX の和文 Unicode 出力。
- 5) UTF/OTF/pxotf パッケージ。
- 6) ums/bxsuika パッケージ。
- どれも使えない場合は「16進表現による代替表現」になる。
-
- \AJ{<コード値>,...}
- Adobe-Japan1 のコード値による入力を行う。コード値は 10 進数で指定
- する。出力には次の順番で利用可能な最初の機能を用いる。
- 1) zxotf パッケージ。
- 2) UTF/OTF/pxotf パッケージ。
- どれも使えない場合は代替表現になる。
-
- \JI{<コード値>,...}
- いわゆる「JIS コード」(JIS X 0208 の GL 表現)のコード値による入力
- を行う。コード値指定の方法は \Ux と同じ。出力には (u)pTeX の JIS
- コード和文出力の機能を使う。使えない場合は代替表現になる。
-
- \KI{<コード値>,...}
- いわゆる「区点コード」のコード値による入力を行う。コード値指定は
- 以下のいずれかの方法で指定する。
- - RRCC : RR は区番号、CC は点番号を 10 進 2 桁で表したもの。
- - PRRCC : P は面番号。JIS X 0213 のための指定。
- 出力には (u)pTeX の JIS コード和文出力の機能を使う。使えない場合は
- 代替表現になる。JIS X 0213 の文字を出力したい場合は、現在の和文
- フォントのエンコーディングが JIS X 0213 に対応するものである必要が
- ある。さらに、第 2 面の文字を出力する場合には pTeX の内部漢字コード
- が sjis でなければならない。
-
- \bxUx / \bxUI / \bxAJ / \bxJI / \bxKI
- \Ux 等は非常に短い名前なので他のパッケージと衝突する恐れがあり、
- そこでこのパッケージでは既に同名の命令がある場合は上書きしない
- ようにしている。\bxUx 等はそれぞれ \Ux 等と同じで、先のような場合
- にも常に使える。
-
- 加えて、このパッケージは bxutf8 の為のドライバ \bxUHex および bxutf8x
- の為のドライバを \Ux に相当するものに設定する。
-
- 以下のものは本来は和文用の命令であるが、理由があって bxbase にも含めて
- いる。pxbase と共通なので詳細は PXbase の説明書を参照してほしい。
-
- \safecaret
- TeX エスケープ形式(^^ab)の解釈が失敗するのを回避する。
-
- Bwbel 関係の命令。
-
- \bxcaptionlanguage{<言語名>}
- Babel では、通常言語が切り替わるとキャプションや日付の文字列が切り
- 替わる。この命令を実行すると、文字列は指定された言語のもので固定
- され、Babel の言語切替の命令に追随しなくなる。この命令自体はプレ
- アンブル中で何回でも使用できて最後のものが有効になる。引数には有効
- な言語オプションの名前の他に以下のものが指定できる。
- - main : 基底言語、すなわち Babel で最後に読み込まれた言語だが
- 次に述べる \bxmainlanguage で変更可能。
- - default : 文書クラスで指定されたものをそのまま用いる。日本語
- の文書クラスで Babel を用いる時に便利である。
- この命令の意義については後の「キャプション文字列の切替機能について」
- の節を参照。
-
- \bxmainlanguage{<言語名>}
- 基底言語、すなわち \begin{document} の直後において有効となる言語を
- 設定する。通常は Babel において最後に読み込まれた言語オプションが
- 基底言語になる。
-
-■ キャプション文字列の切替機能について
-
- Babel の機能の 1 つとして、言語の切替に伴って、キャプションの文字列
- (「参考文献」や「図」等)および日付の書式をその言語用のものに切り替え
- るというものがある。これにより、ある言語(例えばスロベニア語)の為の
- 文書クラスがなくても英語用のクラスと Babel の言語切替でスロベニア語
- のキャプションの文書が作成できる(レイアウトがその言語の使用圏で許容
- されるかの問題は残るが)。だがこの目的には、プレアンブルでキャプション
- 言語を 1 回指定できればよく、文書途中での言語切替にまでキャプション
- が追随する利点はあまりなく、場合によっては弊害があると思われる。この
- ような場合は
- \bxcaptionlanguage{main}
- を実行すれば、キャプションは基底言語(\bxmainlanguage の説明参照)で
- 固定され以後は変更されない。また
- \bxcaptionlanguage{spanish}
- のように直接に言語名を指定することもできる。
-
- 日本語の場合はもっと特殊な事情がある。日本語のレイアウトは欧米の言語
- のものとは大きく異なるので、日本語の文書を作成する場合には日本語用の
- 文書クラスが用いられるのが普通であり、そこでは当然キャプションは既に
- 日本語になっている。このような場合は
- \bxcaptionlanguage{default}
- を実行すれば、キャプションは文書クラスで設定されたものに固定され、
- 以後は変更されない。
-
-■ 開発者向け機能
-
- \bxUHex{<コード値16進表記>}
- bxutf8 が構成する内部表現。用いる機能は \Ux と同じ。
- \bxUInt{<整数>}
- bxutf8x が構成する内部表現。用いる機能は \Ux と同じ。
-
- \bxInputDefFIle{<ファイルベース名>}
- 拡張子 .def のファイルを \usepackage と同じ方式で読み込む。
- \bxCheckCPart{<ファイルベース名>}
- 別のファイル(.sty/.def)との版の比較。
- \bxNullify\CS
- マクロ \CS を無効にする。
- \bxDebug{<テキスト>}
- デバッグメッセージの表示。
- \bxCheckMA<テキスト>\bxEndCheckMA
- \edef 中ではこの部分がエラーを出す命令に展開される。
- \bxIfPrimitive\CS{<yes>}{<no>}
- 現在の \CS の定義が(同名の)プリミティブかの判定。
- \bxEngineTypeX [整数定数]
- 1=pTeX拡張; 2=XeTeX拡張; 3=Omega拡張; 0=以上に該当せず
- \bxEngineTypeY [整数定数]
- 1=eTeX拡張; 3=pdfTeX拡張; 0=以上に該当せず
- (upTeX か否かの判定は ifuptex パッケージを用いる)
-
- \bxTrivLangDef{<言語名>}
- 中身が空の Babel 言語オプションを生成する。
-
- \bxToHexTwo{<整数>} [%02X 形式; 0x00〜FF]
- \bxToHexThree{<整数>} [%03X 形式; 0x000〜FFF]
- \bxToHexFour{<整数>} [%04X 形式; 0x0000〜FFFF]
- \bxToHexFive{<整数>} [%05X 形式; 0x00000〜FFFFF]
- \bxToHexFiveX{<整数>} [%05X 形式; 0x00000〜FFFFF ※1]
- \bxToHexEight{<整数>} [%08X 形式; 0x00000000〜7FFFFFFF]
- \bxToHexTiny{<整数>} [%X 形式; 0x0〜FF]
- \bxToHexSmall{<整数>} [%X 形式; 0x0〜7FFF]
- \bxToHexUC{<整数>} [%04X 形式; 0x0000〜10FFFF ※2]
- 16 進表記を \bxHex に返す。UC は 4〜6 桁での表記。
- ※1 0xFFFFF を超える場合は "FFFFF" になる
- ※2 XeTeX/LuaTeX/upTeX の場合、\char が可能な範囲。
-
- \bxCodeValueSeq\CS{<文字列>} [16進]
- \bxCodeValueSeqD\CS{<文字列>} [10進]
- \Ux, \UI が使っている、コード値の列を解釈するルーチン。
-
- \bxAssign<代入文>\relax
- 代入文が完全(ゴミがない)かの判定しスイッチ \ifbxOk に返す。
-
- \bxToLower{<文字列>}
- \bxToUpper{<文字列>}
- 小文字/大文字に変換したものを \bxRes に返す。
-
- \bxDocumentSpecial{<テキスト>}
- \AtBeginDvi を普通に用いて DVI の先頭部に special を出力する。
- \bxDocumentSpecialUrgent{<テキスト>}
- DVI のなるべく先頭(他の special より前)の位置に special を出力。
-
- \bxEnableSafeCaret
- safe caret 機能を使用可能にしておく。すなわち、プレアンブルでこの
- 命令が呼ばれなかった場合、safe caret は使用不可になる。実際にある
- 状況で safe caret を有効にするには、\bx at acr@normcaret を「その状況
- での本来の〈^〉の動作」に定義した上で〈^〉をアクティブにする必要が
- ある。
- ※ ユーザ命令の \safecaret はこの命令を実行するとともに、verbatim
- と babel での適切な safe caret 処理を有効化している。
-
- \bxUseShadowMap\CS{<TFM名>}
- 命令語 \CS を指定の TFM から生成される shadow map として定義する。
- \bxMap\CS
- 整数レジスタ \bxUcv の現在の値に shadow map を適用し、その結果を
- \bxUcv に代入する。
- ※ shadow map とは「16 bit 整数 → 整数」の写像を TFM として表現
- したもの。
-
----------------------------------------------------
- bxucs パッケージ (v0.2) -- 欧文 Unicode 文字出力
----------------------------------------------------
-
-Unicode subfont を利用して、(欧文の) Unicode 処理能力をネイティブには
-もたない LaTeX 処理系で Unicode フォントを最大限活用する為のパッケージ
-である。upLaTeX は和文に関するネイティブな Unicode 処理を行うが、欧文
-として Unicode 文字を扱う場合にはこのパッケージが有効であろう。
-
-■ 対応環境
-
- 欧文 LaTeX2e / pLaTeX2e / upLaTeX2e
-
-■ 読込
-
- \usepackage で読み込む。オプションはない。
- \usepackage{bxucs}
-
-■ フォントの準備
-
- 欧文フォントファミリに対してこのパッケージによる Unicode 出力を可能
- にする為には、次の 2 種類のエンコーディングに対するファミリの NFSS
- に基づくフォント定義が必要である。
- - LaTeX の通常のエンコーディング、最低でも OT1 と T1
- - Unicode subfont エンコーディング(ここでは USF と呼ぶ)
-
- 例えば、次の 2 シェープからなるフォントファミリがあるとする。
- - FOO_R.ttf : regular weight
- - FOO_B.ttf ; bold weight
- これを LaTeX ファミリ名 "foo" で定義することを考える。
-
- 最初に OT1 に関する定義をする。その為には、各シェープに対する TFM の
- 名前を決める必要がある。regular を foo-r-ot1、bold を foo-b-ot1 と
- する(勿論 Berry 命名法に従っても良い)と、OT1 に対するフォント定義
- ファイル ot1foo.fd の内容は次のようになる。
-
- \DeclareFontFamily{T1}{foo}{}
- \DeclareFontShape{T1}{foo}{m}{n}{<->foo-r-ot1}{}
- \DeclareFontShape{T1}{foo}{bx}{n}{<->foo-b-ot1}{}
-
- T1 エンコーディングに対する設定も同様である。
-
- 次に Unicode subfont (USF) に対する定義をする。Unicode subfont とは
- Unicode の BMP 領域を 256 文字毎に分割して複数の TFM に収めたもので
- ある。従って、1 つのシェープに対して TFM は(最大で) 256 個あること
- になり、名前の一部に番号(小文字 16 進表記)を含めて表す。今の場合で
- は例えば Regular のシェープに対する TFM 名は
- foo-r-u?? (?? は 00, 01, …, fe, ff)
- とすることができる。同様に Bold を foo-b-u?? とする。Unicode subfont
- に対するフォント定義ファイルは次の形式で記述される。
-
- \USFDeclareFontShape{<ファミリ>}{<番号列>}{
- \USFShape{<シリーズ>}{<シェープ>}{<TFM定義>}{<初期化>}
- (必要なだけ \USFShape を繰り返す)
- }
-
- Unicode subfont は 256 個全てが揃っているとは限らない。例えば 60 番
- (U+6000〜60FF) は漢字のみを含むので、元のフォントファイルが CJK 対応
- のものでない限り、60 番の subfont は存在しないことになる。<番号列>
- には、存在する番号の範囲の列を記す。ここでは 00, 01, 02, 03, ff が
- 存在するとする。今の例でのフォント定義ファイル usffoo.fd の内容は次
- のようになる。
-
- \USFDeclareFontShape{foo}{00-03,FF}{
- \USFShape{m}{n}{<->foo-r-u#1}{}
- \USFShape{bx}{n}{<->foo-b-u#1}{}
- }
-
- あとは、今の過程で決めた事項に従って、実際に TFM ファイルを生成し
- (TrueType フォントの場合は ttf2tfm を使う)、さらに TFM と実物の
- フォントファイルを関連付けるように DVI ウェアを設定する必要もある。
-
-■ 機能
-
- このパッケージは bxbase の \Ux のインタフェースを利用する。従って、
- \Ux{0425,043E,0440,043E,0448,043E}
- のように \Ux の引数にコード値の 16 進表記の列を書けばよい。ただし
- この時に、現在のフォントファミリは前述の説明で用意した Unicode
- subfont が定義されたものでなければならない。(なお、このパッケージは
- 内部で bxbase を読み込むので別に読み込む必要はない。)
-
- 使用中のフォントに指定されたコードの文字がない場合は、和文用の \UI
- の方に処理を渡す。ただしここで e-TeX 拡張が使えない場合、存在する
- 文字と同じ subfont に属する文字は全て存在すると判断されてしまうと
- いう制限があり、結果として和文フォントには文字があるのに使えない
- という現象が起こりうる。
-
-
--------------------------------------------------------
- zxbase パッケージ (v0.4a) -- XeLaTeX 基礎ライブラリ
-------------------------------------------------------
-
-拙作の XeLaTeX 用パッケージ(ZX シリーズ)で使われる部品的機能を収めた
-パッケージである。今のところ、このパッケージにはユーザ命令は定義されて
-いないので、文書作成者が \usepackage で直接これを読み込むことはない。
-(現在、zxotf がこのパッケージを内部で読み込む。)
-
-----------------------------------------
-
-■ 更新履歴
-
- version 0.5 <2010/06/15>
- - bxbase: \JI/\KI を追加。
- - bxbase: \dvipdfmxmapline/\dvipdfmxmapfont を追加。
- - bxutf8: BMP 外の符号値への対応。
-
- version 0.4a <2009/11/16>
- - bxbase で \UI/\Ux を zxjatype と、\AJ を zxotf と連携させた。
- - zxbase パッケージを追加。
-
- version 0.4 <2009/07/05>
- - PXbase の v0.4 に合わせた改訂。
-
- version 0.3 <2008/04/06>
- - bxutf8x を追加。
- - bxutf8 のバグを修正。
- - bxbase でも pxbase の命令 \recordpapersize を使用可能にした。
-
- version 0.2 <2008/03/28>
- - 最初の公開版。
-
-# EOF
Added: trunk/Master/texmf-dist/doc/latex/bxbase/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxbase/README-ja.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bxbase/README-ja.md 2017-06-05 23:15:19 UTC (rev 44481)
@@ -0,0 +1,535 @@
+BXbase パッケージバンドル
+=========================
+
+LaTeX: 他の BX パッケージのためのサポートライブラリ
+
+本バンドルの主な目的は、作者(ZR)の制作する他のパッケージ(名前が
+“BX”や“PX”で始まる)が依拠するライブラリ機能の提供である。
+
+ただし bxbase パッケージは少数のユーザレベルのコマンドも含むので
+単体でも有用である。
+
+### 前提環境
+
+ * TeX フォーマット: LaTeX
+ * TeX エンジン: 不問
+ * DVI ウェア(DVI 出力時): 不問
+
+### 構成物
+
+ * `bxbase.sty`: ‘bxbase’パッケージ
+ * `bxbase.def`: ‘bxbase’のサブモジュール
+ * `bxtoolbox.sty`: ‘bxtoolbox’パッケージ
+ * `bxtoolbox.def`: ‘bxtoolbox’のサブモジュール
+ * `bxtoolbox-ext.def`: ‘bxtoolbox’のサブモジュール
+ * `bxtoolbox-ja.def`: ‘bxtoolbox’のサブモジュール
+ * `bxutf8.def`: ‘bxutf8’入力エンコーディング定義
+ * `bxutf8x.def`:‘bxutf8x’入力エンコーディング定義
+ * `zxbase.sty`: ‘zxbase’パッケージ
+ * `bxbase-ja.pdf`: ‘bxbase’のユーザ向け説明書(日本語)
+ * `bxbase-ja.tex`: `bxbase-ja.pdf` のソースファイル
+
+### インストール
+
+TDS 1.1 に準拠するシステムの場合、以下のようにファイルを移動する:
+
+ - `*.sty`, `*.def` → $TEXMF/tex/latex/BXbase
+
+この後必要に応じて mktexlsr を実行する。
+
+### ライセンス
+
+本パッケージは MIT ライセンスの下で配布される。
+
+bxbase パッケージ ― 基礎ライブラリ
+----------------------------------
+
+基本的に、他のパッケージの内部で読み込まれるものであり、作者(ZR)の制作
+する他のパッケージで必要な機能を提供する。
+
+本パッケージは幾つかのユーザ命令も提供していたが、その大部分が 1.1 版に
+おいて非推奨となった。日本語入力に関する少数の機能が残されている。
+
+### ユーザ向け機能
+
+ユーザ向け機能についてはマニュアル `bxbase-ja.pdf` を参照されたい。
+
+### 開発者向け機能
+
+ここでは bxbase パッケージが提供する開発者向け機能について簡単に解説する。
+
+※ bxbase パッケージは内部で bxtoolbox パッケージを読み込むため、bxtoolbox
+の機能も利用できる。
+
+#### 書式記述に関する注意
+
+`<LaTeXマクロ定義記述>` は `\newcommand` 等の LaTeX マクロ定義命令に
+後続する要素列で、以下のものに等しい。
+
+ {<命令>}[<引数個数>][<引数既定値>]{<置換テキスト>}
+
+`<TeXマクロ定義記述>` は `\def` 等の TeX マクロ定義プリミティブに
+後続する要素列で、以下のものに等しい。
+
+ <命令><引数宣言部>{<置換テキスト>}
+
+`<TeXマクロ定義記述*>` は `<TeXマクロ定義記述>` の先頭の `<命令>`
+を除去したもの。
+
+#### プログラミング補助
+
+ * `\bxDebug{<テキスト>}`
+ デバック出力用命令。このパッケージでの定義では何もしない。
+ * `\bxRequireDefinition{<ファイルベース名>}`
+ 拡張子 .def のファイルを `\usepackage` と同じ方式で読み込む。
+ * `\bxNullify\制御綴`
+ `\制御綴` を「何もしない命令」で `\providecommand` により
+ 上書きされないものに再定義する。
+ * `\bxForEachIn<引数1>,<引数2>,...\do{<置換テキスト>}`
+ 各々の引数について、`<置換テキスト>` の `#1` をそれで置き換えた
+ ものを実行する。LaTeX の `\@for` のラッパーで、`\@for` と同じく、
+ `\bxForEachIn` の直後のトークンは予め一度展開される。
+ * `\bxForEachTokenIn<トークン1><トークン2>...\do{<置換テキスト>}`
+ 各々の引数について `<置換テキスト>` の `#1` を置き換えたものを
+ 実行する。LaTeX の `\@tfor` のラッパー。
+ * `\bxWithArgExpd{<引数1>}\do{<置換テキスト>}`
+ * `\bxWithArgsExpd{<引数1>}{<引数2>}...\do{<置換テキスト>}`
+ `<置換テキスト>` 中の `#1`、`#2`… を各々の引数を一回展開した
+ ものに置き換えたものを実行する。`\bxWithArgExpd` は 1 引数用に
+ 最適化したもの。
+ * `\bxWithArgFullExpd{<引数1>}\do{<置換テキスト>}`
+ * `\bxWithArgsFullExpd{<引数1>}{<引数2>}...\do{<置換テキスト>}`
+ `\bxWithArgsExpd` と同様だが、一回展開でなく完全展開する点が
+ 異なる。
+ * `\bxChompComma<命令>`
+ `<命令>` の 置換テキストの先頭が `,` の場合、それを削除したもので
+ 再定義する。
+ * `\bxAssign<代入文>\relax`
+ 代入を行った後、代入文の後ろにゴミがないかを判定しその結果を
+ スイッチ `\ifbxOk` に返す。
+ * `\bxCheckMA<テキスト>\bxEndCheckMA`
+ `\edef` 中ではこの部分がエラーを出す命令に展開される。
+
+#### TeX エンジン判別
+
+ * `\bxEngineTypeX` [整数定数]
+ 1=pTeX拡張; 2=XeTeX拡張; 3=Omega拡張; 0=以上に該当せず
+ * `\bxEngineTypeY` [整数定数]
+ 1=eTeX拡張; 3=pdfTeX拡張; 5=LuaTeX拡張; 0=以上に該当せず
+ ※現在の LuaTeX は X/Y=0/5 となる。
+ ※upTeX か否かの判定は ifptex パッケージを用いる。
+
+#### Babel 関係
+
+ * `\bxAtBeginDocumentBabel{<テキスト>}`
+ Babel 読込時にのみ実行される begin-document 時のフック。
+ * `\bxTrivLangDef{<言語名>}`
+ 中身(キャプション定義等)が空の Babel 言語オプションを生成する。
+
+#### 数値の書式化出力
+
+ * `\bxToHexTwo{<整数>}` [%02X 形式; 0x00~FF]
+ * `\bxToHexThree{<整数>}` [%03X 形式; 0x000~FFF]
+ * `\bxToHexFour{<整数>}` [%04X 形式; 0x0000~FFFF]
+ * `\bxToHexFive{<整数>}` [%05X 形式; 0x00000~FFFFF]
+ * `\bxToHexFiveX{<整数>}` [%05X 形式; 0x00000~FFFFF ※1]
+ * `\bxToHexEight{<整数>}` [%08X 形式; 0x00000000~7FFFFFFF]
+ * `\bxToHexTiny{<整数>}` [%X 形式; 0x0~FF]
+ * `\bxToHexSmall{<整数>}` [%X 形式; 0x0~7FFF]
+ * `\bxToHexUC{<整数>}` [%04X 形式; 0x0000~10FFFF ※2]
+ 16 進表記を `\bxHex` に返す。UC は 4~6 桁での表記。
+ ※1 0xFFFFF を超える場合は `FFFFF` になる
+ ※2 XeTeX/LuaTeX/upTeX の場合、`\char` が可能な範囲。
+ * `\bxToDecFour{<整数>}` [%04d 形式; 0000~9999]
+ * `\bxToDecFive{<整数>}` [%05d 形式; 00000~99999]
+ ゼロ付の 10 進表記を `\bxHex` に返す。
+
+#### 符号値による入力
+
+ * `\bxCodeValueSeq\制御綴{<符号値>,...} [16進]`
+ * `\bxCodeValueSeqD\制御綴{<符号値>,...} [10進]`
+ 各々の `<符号値>` を解釈した結果を `\bxUcv` に代入してマクロ
+ `\制御綴` を呼び出す。解釈方法はそれぞれ `\Ux` と `\AJ` 命令の
+ 解説にある通り。
+ * `\bxUHex{<コード値16進表記>}`
+ bxutf8 が構成する内部表現。用いる機能は `\Ux` と同じ。
+ * `\bxUInt{<整数>}`
+ bxutf8x が構成する内部表現。用いる機能は `\Ux` と同じ。
+
+#### 文字列操作
+
+ * `\bxToLower{<文字列>} [小文字]`
+ * `\bxToUpper{<文字列>} [大文字]`
+ `<文字列>` を小文字/大文字に変換したものを `\bxRes` に返す。
+
+#### Special 出力
+
+ * `\bxDocumentSpecial{<テキスト>}`
+ `\AtBeginDvi` を普通に用いて DVI の先頭部に special を出力する。
+ * `\bxDocumentSpecialUrgent{<テキスト>}`
+ DVI のなるべく先頭(他の special より前)の位置に special を出力。
+
+#### Safe caret 機能
+
+ * `\bxBDHookSafeCaret`
+ safe caret 機能に関する begin-document フック。
+ * `\bxEnableSafeCaret`
+ safe caret 機能を使用可能にしておく。すなわち、プレアンブルでこの
+ 命令が呼ばれなかった場合、safe caret は使用不可になる。実際にある
+ 状況で safe caret を有効にするには、`\bx at acr@normcaret` を「その
+ 状況での本来の `^` の動作」に定義した上で `^` をアクティブにする
+ 必要がある。
+ ※ ユーザ命令の `\safecaret` はこの命令を実行した上で、verbatim
+ と babel での適切な safe caret 処理を有効化している。
+
+#### Shadow map 機能
+
+Shadow map とは「16 ビット整数 → 整数」の写像を TFM として表現
+したもの。
+
+ * `\bxUseShadowMap\制御綴{<TFM名>}`
+ `\制御綴` を指定の TFM から生成される shadow map として定義。
+ * `\bxMap\制御綴`
+ 整数レジスタ `\bxUcv` の現在の値に shadow map を適用し、その結果を
+ `\bxUcv` に代入する。
+
+#### モジュール名
+
+ここでいう「モジュール」とは文書クラス(.cls)・パッケージ(.sty)・
+定義ファイル(.def)の総称。「モジュール読込中に発生するエラーを出力
+するためのマクロ」を別のモジュール内で定義する際に、呼び出した側の
+モジュール名をメッセージ中に出力させるための仕組み。
+
+ * `\bxSetModuleName{<文字列>}`
+ 現在のモジュールに対するモジュール名を設定する。
+ * `\bxModuleName`
+ 現在のモジュールに対するモジュール名に展開される。モジュール名が
+ 設定されていない場合はファイルのベース名を代わりに使う。
+ * `\bxError` [`\PackageError` に対応]
+ * `\bxWarning` [`\PackageWarning` に対応]
+ * `\bxWarningNoLine` [`\PackageWarningNoLine` に対応]
+ * `\bxInfo` [`\PackageInfo` に対応]
+ 現在のモジュール名をパッケージ名として `\PackageError` 等を呼ぶ。
+
+#### keyval の拡張
+
+(xkeyval が普及した今では非推奨かも…)
+
+keyval の `\setkeys` について、「未定義のキーをエラーにせず、代わりに
+未定義のキーのリストを作成する」という変種を提供する。この機能は
+xkeyval で `\setkeys*` として提供されている。しかし xkeyval が利用
+できない環境に対応するために keyval へのパッチとして実現すること
+にする。しかし、xkeyval はこのパッチを無効化してしまう。従って
+xkeyval.sty が存在するかに応じて処理を分けることにした。
+
+ * `\bxPrepareSetKeysSafe`
+ `\bxSetKeysSafe` を使用可能にする。
+ ※ xkeyval.sty が存在するかを判定し、存在すれば読み込む。
+ そして `\bxSetKeysSafe` の実現方法をこの段階で確定させる。
+ * `\bxSetKeysSafe{<ファミリ>}{<テキスト>}`
+ `\setkeys` と同様だが、未定義のキーをエラーとせず、代わりに
+ 未定義のキーからなるコンマ区切りのリストを `\bxRestKeys` に
+ 代入する。
+
+#### ドライバ判別
+
+以下の説明で「先天的な」ドライバとは、TeX 実行時に使用が判定できる
+もの(事実上「TeX エンジンがドライバを兼ねるもの」に等しい)を指し、
+例えば pdfTeX、XeTeX、LuaTeX が該当する。
+
+ * `\bxDriverList`
+ (後天的な)ドライバ名のリスト。
+ ※ 現状では「`dvips,dvipdfmx,dviout`」。
+ * `\bxDriverInherent`
+ 先天的なドライバ名(未定義なら空)に展開される。
+ * `\bxSetDriver[<ファイル名>]{<ドライバ名>}`
+ 指定のファイル名をもつモジュールに対するドライバ名を指定する。
+ `<ファイル名>` がない場合は現在のモジュールに対する設定。
+ * `\bxDriver`
+ 現在のモジュールに対するドライバ名に展開される。未定義ならば
+ `default` を返す。
+ * `\bxDriverSpecifiedFor{<ファイル名>}`
+ `\bxDriver` と同様だが、指定のファイル名をもつモジュールに
+ 対する設定を返す。
+ * `\bxDefineDDProcess{<名前>}{<ドライバ名>}<TeXマクロ定義記述*>`
+ ドライバ依存マクロを定義する。
+ * `\bxDefineDDProcessDefault{<名前>}`
+ `<ドライバ名>` が `default` の `\bxDefineDDProcess`。
+ * `\bxDoDDProcess{<名前>}`
+ ドライバ依存マクロを実行する。
+ * `\bxDeclareDriverOptions`
+ 後天的なドライバ名の各々について、「`\bxSetDriver{ドライバ名}`
+ を呼ぶ」という動作のパッケージ(クラス)オプションを定義する。
+
+bxtoolbox パッケージ ― 非 e-TeX エンジンでの etoolbox の模倣
+-------------------------------------------------------------
+
+本パッケージの主な目的は、etoolbox パッケージの一部の機能を e-TeX 拡張を
+持たないエンジンで利用可能にすることである。(pTeX エンジンの e-TeX 拡張
+が普及し出したのは 2010 年頃である。)
+
+なお、本パッケージを e-TeX 拡張をもつエンジンで読み込んだ場合は、本物の
+etoolbox が読み込まれてその機能が使われる。
+
+### etoolbox 互換命令
+
+ここに挙げる命令は、etoolbox の命令の複製であり、それぞれ、命令名の頭の
+`bx` を取って先頭を小文字に変えた名前(`\bxCsdef`→`\csdef`)の etoolbox
+の命令に対応する。e-TeX 拡張のエンジンで動作する場合は実際に etoolbox を
+読み込んでそれの命令のエイリアスとするが、そうでない場合は自前の実装を
+用いる。
+
+各命令の詳細については etoolbox のマニュアルを参照されたい。etoolbox の
+元の命令と仕様が異なる部分にのみ説明を付している(この説明は e-TeX 非拡張
+のエンジンでの動作時のみ当てはまることに注意)。
+
+(頑強な命令の定義)
+
+ * `\bxNewrobustcmd[*]<LaTeXマクロ定義記述>`
+ * `\bxRenewrobustcmd[*]<LaTeXマクロ定義記述>`
+ * `\bxProviderobustcommand[*]<LaTeXマクロ定義記述>`
+ * `\bxRobustify{<命令>}`
+ e-TeX の \protected の代わりに LaTeX の protect 処理を用いる。結果
+ 的に \DeclareRobustCommand と同じ処理が使われる。
+
+(メイン文書コンパイル時フック)
+
+ * `\AfterPreamble{<テキスト>}`
+ * `\AtEndPreamble{<テキスト>}`
+ * `\AfterEndPreamble{<テキスト>}`
+ * `\AfterEndDocument{<テキスト>}`
+
+(マクロ定義)
+
+ * `\csdef<TeXマクロ定義記述*>`
+ * `\csgdef<TeXマクロ定義記述*>`
+ * `\csedef<TeXマクロ定義記述*>`
+ * `\csxdef<TeXマクロ定義記述*>`
+
+(命令の意味の操作)
+
+ * `\cslet{<命令名1>}{<命令2>}`
+ * `\letcs{<命令1>}{<命令名2>}`
+ * `\csletcs{<命令名1>}{<命令名2>}`
+ * `\bxCsuse{<命令名>}`
+ * `\undef{<命令>}`
+ * `\csundef{<命令名>}`
+ * `\bxCsshow{<命令名>}`
+ `\bxCsuse` と `\bxCsshow` は、LaTeX の protect を施しているが、
+ 動く引数の中で展開されるとエラーになる。
+
+(マクロの追記式定義)
+
+ * `\appto{<命令>}{<テキスト>}`
+ * `\gappto{<命令>}{<テキスト>}`
+ * `\eappto{<命令>}{<テキスト>}`
+ * `\xappto{<命令>}{<テキスト>}`
+ * `\csappto{<命令名>}{<テキスト>}`
+ * `\csgappto{<命令名>}{<テキスト>}`
+ * `\cseappto{<命令名>}{<テキスト>}`
+ * `\csxappto{<命令名>}{<テキスト>}`
+ * `\preto{<命令>}{<テキスト>}`
+ * `\gpreto{<命令>}{<テキスト>}`
+ * `\epreto{<命令>}{<テキスト>}`
+ * `\xpreto{<命令>}{<テキスト>}`
+ * `\cspreto{<命令名>}{<テキスト>}`
+ * `\csgpreto{<命令名>}{<テキスト>}`
+ * `\csepreto{<命令名>}{<テキスト>}`
+ * `\csxpreto{<命令名>}{<テキスト>}`
+
+(真理値変数―bool系)
+
+ * `\newbool{<名前>}`
+ * `\providebool{<名前>}`
+ * `\booltrue{<名前>}`
+ * `\boolfalse{<名前>}`
+ * `\setbool{<名前>}{<値>}`
+ * `\ifbool{<名前>}{<真>}{<偽>}`
+ * `\notbool{<名前>}{<真>}{<偽>}`
+
+(真理値変数―toggle系)
+
+ * `\newtoggle{<名前>}`
+ * `\providetoggle{<名前>}`
+ * `\toggletrue{<名前>}`
+ * `\togglefalse{<名前>}`
+ * `\settoggle{<名前>}{<値>}`
+ * `\iftoggle{<名前>}{<真>}{<偽>}`
+ * `\nottoggle{<名前>}{<真>}{<偽>}`
+
+(定義済判定)
+
+ * `\ifdef{<命令>}{<真>}{<偽>}`
+ * `\ifundef{<命令>}{<真>}{<偽>}`
+ * `\bxIfcsdef{<命令名>}{<真>}{<偽>}`
+ * `\bxIfcsundef{<命令名>}{<真>}{<偽>}`
+ `\bxIfcsdef` と `\bxIfcsdef` は動く引数の中で展開されるとエラーに
+ なる。
+
+### それ以外の命令
+
+種々の事情により、「etoolbox 互換用」以外の機能も含まれている。
+
+(エンジンチェック―ifトークン)
+
+ * `\ifbxineTeX`
+ * `\ifbxinpdfTeX`
+ * `\ifbxinLuaTeX`
+ * `\ifbxinOmega`
+ * `\ifbxinAleph`
+ * `\ifbxinXeTeX`
+ * `\ifbxinpTeX`
+ * `\ifbxinupTeX`
+ エンジンのチェック。これらは TeX の if-トークンである。
+
+(エンジンチェック―LaTeXテスト)
+
+ * `\bxIfineTeX{<真>}{<偽>}`
+ * `\bxIfinpdfTeX{<真>}{<偽>}`
+ * `\bxIfinLuaTeX{<真>}{<偽>}`
+ * `\bxIfinOmega{<真>}{<偽>}`
+ * `\bxIfinAleph{<真>}{<偽>}`
+ * `\bxIfinXeTeX{<真>}{<偽>}`
+ * `\bxIfinpTeX{<真>}{<偽>}`
+ * `\bxIfinupTeX{<真>}{<偽>}`
+ エンジンのチェック。これらは LaTeX 形式のテストである。(完全展開
+ 可能である。)
+
+(プリミティブifトークンのLaTeXテスト版)
+
+ * `\bxIf{<テスト>}{<真>}{<偽>}`
+ * `\bxIfcat{<テスト>}{<真>}{<偽>}`
+ * `\bxIfx{<テスト>}{<真>}{<偽>}`
+ * `\bxIfdim{<テスト>}{<真>}{<偽>}`
+ * `\bxIfnum{<テスト>}{<真>}{<偽>}`
+ TeX のプリミティブなテストを LaTeX 形式のテストにしたもの。例えば
+ 以下のようにして使う。
+ `\bxIfx{\somecs\relax}{\dotrue}{\dofalse}`
+ `\bxIfnum{\count@<3}{\dotrue}{\dofalse}`
+ (これらの命令は完全展開可能である。)
+
+(プリミティブ判定)
+
+ * `\bxIfPrimitive{<命令>}{<真>}{<偽>}`
+ * `\bxIfPrimitiveX{<命令名>}{<真>}{<偽>}`
+ `<命令>` が同名の TeX プリミティブであるかを判定する。機能としては
+ pdfTeX の `\ifpdfprimitive` と同じ。`\bxIfPrimitive` は脆弱である。
+ `\bxIfPrimitiveX` は完全展開可能(従って頑強)であるが、pdfTeX
+ 拡張の `\ifpdfprimitive` が使えない時は処理が非常に重い。
+ * `\bxIfCsPrimitive{<命令名>}{<真>}{<偽>}`
+ 引数が命令名であることを除き `\bxIfPrimitive` と同じ。
+
+(文字列化)
+
+ * `\bxDetokenize{<テキスト>}`
+ e-TeX 拡張の `\detokenize` と同じ機能で、e-TeX 拡張が有効の場合は
+ `\detokenize` のエイリアスになる。無効の場合は自前の実装を使うが、
+ 処理が非常に重い。(完全展開可能である。)
+ * `\bxStringify{<テキスト>}`
+ 完全展開して detokenize した文字列に展開する。現状では全エンジン
+ について自前の実装を使っていて処理が非常に重い。(完全展開可能。)
+
+(トークン列比較)
+
+ * `\bxIfExpToEqual{<テキスト1>}{<テキスト2>}{<真>}{<偽>}`
+ * `\bxIfExpToEqualX{<テキスト1>}{<テキスト2>}{<真>}{<偽>}`
+ 2つのテキストについて、完全展開して detokenize した結果の文字列が
+ 等しいかを判定する。機能としては pdfTeX の `\pdfstrcmp` での等価
+ 判定と同じ。`\bxIfExpToEqual` は脆弱である。`\bxIfExpToEqualX`
+ は完全展開可能だが、`\pdfstrcmp` が使えない時は処理が非常に重い。
+ * `\bxIfstrequalX{<テキスト1>}{<テキスト2>}{<真>}{<偽>}`
+ etoolbox の `\ifstrequal` と同じ機能、すなわち 2 つのテキストに
+ ついて展開せずに detokenize した結果の文字列が等しいかを判定する。
+ 元の `\ifstrequal` と異なり完全展開可能であるが、e-TeX 拡張が無効
+ の時は処理が非常に重い。
+
+(プレアンブル専用命令宣言)
+
+ * `\bxPreamble<TeXマクロ定義命令><TeXマクロ定義記述>`
+ * `\bxPreamble<LaTeXマクロ定義命令>[*]<LaTeXマクロ定義記述>`
+ `\@onlypreamble` を設定してマクロを定義する。
+ ※ 実際の動作は単に `\bxPreamble\制御綴A[*]\制御綴B` を
+ `\@onlypreamble\制御綴B \制御綴A[*]\制御綴B`
+ に置き換えているだけである。
+
+(保護付マクロ定義)
+
+ * `\bxRobustdef<TeXマクロ定義記述>`
+ * `\bxRobustgdef<TeXマクロ定義記述>`
+ * `\bxRobustedef<TeXマクロ定義記述>`
+ * `\bxRobustxdef<TeXマクロ定義記述>`
+ 保護付な命令を定義する。e-TeX 拡張が有効であれば、`\protected` を
+ 有効にし、無効であれば、LaTeX の保護機構を用いる。前に `\long` を
+ 付けられるが `\global` は不可。
+
+(その他)
+
+ * `\bxIfInMovingArg{<真>}{<偽>}`
+ いわゆる動く引数(実行が抑止された環境)であるかのテスト。実行が有効
+ である場合は、<偽> を実行したのと等価になる。実行が抑止されている
+ 場合は「無意味な代入文」の後に <真> を続けたものに展開される。この
+ 命令は、動く引数の中での使用を事前に検査してエラーを出すという目的
+ を想定している。(`\bxCheckForMovingArg` も参照。)
+
+ * `\bxMessageToken{<文字列>}{<テキスト>}`
+ `<テキスト>` の中の `#1` を制御綴 `\<文字列>` に置換したテキスト
+ を実行する。`\<文字列>` の意味は変化しない。`<テキスト>` 中で
+ パラメタ `#1` 等を使う場合は `##1` のように書く必要がある。例えば
+ 以下のように用いる。
+
+ \bxMessageToken{Hello TeX!}{\def\dohello{\do#1}}
+
+ `\dohello` の定義は `\do` の後に制御綴「`\Hello TeX!`」が続いた
+ ものになる。
+
+ * `\bxCheckForMovingArg{<テキスト>}`
+ 動く引数の中であるかの確認。動く引数の中でない場合は `<テキスト>`
+ が実行されるが、ある場合は次のように「未定義命令の形」でエラーが
+ 表示される。ここでは、`\xx at prepare` の中で `\bxCheckForMovingArg`
+ のテストを行っているとする。
+
+ ! Undefined control sequence.
+ <argument> \ ERROR: Use in wrong place!
+ <*> \protected at edef\xx at example{\xx at prepare
+ \xx at tmpa}
+
+ ※ 実行が抑止されている場合は `\errmessage` プリミティブも実行
+ されないので、普通にエラー表示ができないのである。
+ ※ `\bxIfInMovingArg` を利用しているので、そこに述べられている
+ ように、動く引数である場合の展開結果にはゴミが残る。
+
+zxbase パッケージ ― XeTeX 用基礎ライブラリ
+-------------------------------------------
+
+作者(ZR)の制作する他のパッケージで必要な、XeTeX 特有の機能を提供する。
+
+現状では、本パッケージに公開の機能は存在しない。
+
+更新履歴
+--------
+
+ * Version 1.1 〈2017/05/29〉
+ - 内容の整理。
+ - 一部の機能を非推奨にした。
+ * Version 1.0 〈2013/04/29〉
+ - ほぼ全面的な書き直し。
+ * Version 0.5 〈2010/06/15〉
+ - bxbase: `\JI`/`\KI` を追加。
+ - bxbase: `\dvipdfmxmapline`/`\dvipdfmxmapfont` を追加。
+ - bxutf8: BMP 外の符号値への対応。
+ * Version 0.4a 〈2009/11/16〉
+ - bxbase で `\UI`/`\Ux` を zxjatype と、`\AJ` を zxotf
+ と連携させた。
+ - zxbase パッケージを追加。
+ * Version 0.4 〈2009/07/05〉
+ - PXbase の v0.4 に合わせた改訂。
+ * Version 0.3 〈2008/04/06〉
+ - bxutf8x を追加。
+ - bxutf8 のバグを修正。
+ - bxbase でも pxbase の命令 `\recordpapersize` を使用可能にした。
+ * Version 0.2 〈2008/03/28〉
+ - 最初の公開版。
+
+--------------------
+Takayuki YATO (aka. "ZR")
+https://github.com/zr-tex8r
Property changes on: trunk/Master/texmf-dist/doc/latex/bxbase/README-ja.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bxbase/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxbase/README.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bxbase/README.md 2017-06-05 23:15:19 UTC (rev 44481)
@@ -0,0 +1,133 @@
+BXbase Package Bundle
+=====================
+
+LaTeX: Support library for other BX packages
+
+The main purpose of this bundle is to serve as underlying library
+to make work other packages created by the same author (their names
+start with “BX” or “PX”).
+
+However bxbase package contains a few user-level commands and is of
+some use by itself.
+
+### System Requirements
+
+ * TeX format: LaTeX.
+ * TeX engine: Any engine.
+ * DVI-ware (in DVI output): Anything.
+
+### Package content
+
+ * `bxbase.sty`: the ‘bxbase’ package
+ * `bxbase.def`: a submodule of ‘bxbase’
+ * `bxtoolbox.sty`: the ‘bxtoolbox’ package
+ * `bxtoolbox.def`: a submodule of ‘bxtoolbox’
+ * `bxtoolbox-ext.def`: a submodule of ‘bxtoolbox’
+ * `bxtoolbox-ja.def`: a submodule of ‘bxtoolbox’
+ * `bxutf8.def`: the ‘bxutf8’ input encoding definition
+ * `bxutf8x.def`: the ‘bxutf8x’ input encoding definition
+ * `zxbase.sty`: the ‘zxbase’ package
+ * `bxbase-ja.pdf`: the user manual for the ‘bxbase’ (in Japanese)
+ * `bxbase-ja.tex`: the source file of `bxbase-ja.pdf`
+
+### Installation
+
+In a system compliant to TDS 1.1, move the files as follows:
+
+ - `*.sty`, `*.def` → $TEXMF/tex/latex/BXbase
+
+And rehash your TEXMF trees if necessary.
+
+### License
+
+This package is distributed under the MIT License.
+
+bxbase Package ― The base library
+----------------------------------
+
+This package provides many package-level features, which are required by
+other packages created by the same author.
+
+It also contains some user-level commands, but most of such commands have
+been deprecated since v1.1, except a few which are related to inputting
+Japanese text.
+
+Unfortunately the documentation is available only in Japanese. (However,
+those unfamiliar with the Japanese language will probably have no need to
+load this package directly.)
+
+bxtoolbox Package ― To emulate etoolbox on non-e-TeX
+-----------------------------------------------------
+
+The main goal of this package is to provide part of the functions of the
+[etoolbox] package for TeX engines without e-TeX extension. (Note that
+TeX users in Japan have long used the pTeX engine for writing Japanese,
+and e-TeX extention for the engine did not appeared until around 2010.)
+
+[etoolbox]: https://www.ctan.org/pkg/etoolbox
+
+Note that when this package is loaded in e-TeX engines, then it loads
+the real etoolbox and uses the functions of that package.
+
+### e-TeX functions provided by this package
+
+Below is the list:
+
+ \AfterPreamble \AtEndPreamble \AfterEndPreamble
+ \AfterEndDocument
+ \csdef \csgdef \csedef \csxdef
+ \cslet \letcs \csletcs \undef \csundef
+ \appto \gappto \eappto \xappto
+ \csappto \csgappto \cseappto \csxappto
+ \preto \gpreto \epreto \xpreto
+ \cspreto \csgpreto \csepreto \csxpreto
+ \newbool \providebool \booltrue \boolfalse
+ \setbool \ifbool \notbool
+ \newtoggle \providetoggle \toggletrue \togglefalse
+ \settoggle \iftoggle \nottoggle
+ \ifdef \ifundef
+ \ifstrequal \ifstrempty
+
+### “Fakes” provided by this package
+
+These commands have a name of the original command prefixed by “bx”,
+that is, `\bxZzz` instead of `\zzz`. Some come in two versions: `\bxZzz`
+works as `\zzz` but is lack of expandability `\zzz` has, whereas `\bxZzzX`
+is expandable as `\zzz` is but otherwise flawed.
+
+ * `\bxNewrobustcmd`: Uses LaTeX-protect instead of `\protected`.
+ * `\bxRenewrobustcmd`: Ditto.
+ * `\bxProviderobustcmd`: Ditto.
+ * `\bxRobustify`: Ditto.
+ * `\bxCsuse`: Forbidden in moving arguments.
+ * `\bxCsuseX`: Suffering from `\relax`’ifying.
+ * `\bxCsshow`: Forbidden in moving arguments.
+ * `\bxIfcsdef`: Forbidden in moving arguments.
+ * `\bxIfcsundef`: Forbidden in moving arguments.
+ * `\bxIfcsundefX`: Suffering from `\relax`’ifying.
+
+Note: On e-TeX extended engines, these commands are simply aliases to the
+real commands of etoolbox.
+
+zxbase Package ― The base library for XeTeX
+--------------------------------------------
+
+This package provides XeTeX-specific features, which are required by
+other packages created by the same author.
+
+For the present this package contains no public features.
+
+Revision History
+----------------
+
+ * Version 1.1 〈2017/05/29〉
+ * Version 1.0 〈2013/04/29〉
+ * Version 0.5 〈2010/06/15〉
+ * Version 0.4a 〈2009/11/16〉
+ * Version 0.4 〈2009/07/05〉
+ * Version 0.3 〈2008/04/06〉
+ * Version 0.2 〈2008/03/28〉
+
+--------------------
+Takayuki YATO (aka. "ZR")
+https://github.com/zr-tex8r
Property changes on: trunk/Master/texmf-dist/doc/latex/bxbase/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.pdf 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.pdf 2017-06-05 23:15:19 UTC (rev 44481)
Property changes on: trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.tex 2017-06-05 23:15:19 UTC (rev 44481)
@@ -0,0 +1,108 @@
+% 文字コードは UTF-8
+% uplatex で組版する
+\documentclass[a4paper,uplatex]{jsarticle}
+\usepackage{shortvrb}
+\MakeShortVerb{\|}
+\newcommand{\PkgVersion}{1.1}
+\newcommand{\PkgDate}{2017/05/29}
+\newcommand{\Pkg}[1]{\textsf{#1}}
+\newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$}
+\newcommand{\Note}{\par\noindent ※}
+\newcommand{\Means}{~:\quad}
+\providecommand{\pTeX}{p\TeX}
+\providecommand{\upTeX}{u\pTeX}
+\providecommand{\pLaTeX}{p\LaTeX}
+\providecommand{\upLaTeX}{u\pLaTeX}
+%-----------------------------------------------------------
+\begin{document}
+\title{\Pkg{bxbase} パッケージ\\
+(ユーザ命令の解説)}
+\author{八登崇之\ (Takayuki YATO; aka.~``ZR'')}
+\date{v\PkgVersion \quad[\PkgDate]}
+\maketitle
+
+%===========================================================
+\section{パッケージの読込}
+
+|\usepackage| で読み込む。オプションは無い。
+\begin{quote}\small\begin{verbatim}
+\usepackage{bxbase}
+\end{verbatim}\end{quote}
+
+\Note 本パッケージのライブラリとしての機能は特定の
+エンジンやDVIウェアに依存しないが、以下に述べる命令に
+ついては必ずしもそうでないことに注意。
+
+%===========================================================
+\section{機能}
+
+%-------------------
+\subsection{符号値による文字入力}
+
+\begin{itemize}
+\item |\Ux{|\Meta{コード値}|,...}|\\
+ |\UI{|\Meta{<コード値>}|,...}|\Means
+Unicode コード値による入力を行う。
+|\Ux| は欧文用、|\UI| は和文用
+(I は Ideographic の意味)。
+コード値は以下の形式で表す。
+コンマで区切って複数文字入力できる。
+\begin{itemize}
+\item \Meta{16進数}\Means |A72C|, |02000B|, |1bd| 等。
+\item |+|\Meta{10進数}\Means |+254|, |+0937| 等。
+\item |'|\Meta{8進数}\Means |'376|, |'1651| 等。
+\end{itemize}
+
+Unicode 文字の出力には次の順番で利用可能な最初の機能を用いる。
+(|\UI| の場合 3) を飛ばす。)
+\begin{enumerate}
+\item[1)] \Pkg{zxjatype}パッケージ。
+この場合、その機構に従って出力される。
+すなわち |\UI| は必ず和文フォントで出力し、
+|\Ux| は和文/欧文切替の対象となる。
+\item[2)] XeTeXのUnicode出力。
+\item[3)] (|\Ux| のみ)\Pkg{bxucs}パッケージ。
+\item[4)] {\upTeX}の和文Unicode出力。
+\item[5)] \Pkg{UTF}/\Pkg{OTF}パッケージ。
+\item[6)] \Pkg{ums}/\Pkg{bxsuika}パッケージ。
+\end{enumerate}
+どれも使えない場合は「16進表現による代替表現」になる。
+
+\item |\AJ{|\Meta{コード値}|,...}|\Means
+Adobe-Japan1のコード値による入力を行う。
+コード値は10進数で指定する。
+出力には次の順番で利用可能な最初の機能を用いる。
+\begin{enumerate}
+\item[1)] \Pkg{zxotf}パッケージ。
+\item[2)] \Pkg{UTF}/\Pkg{OTF}パッケージ。
+\end{enumerate}
+どれも使えない場合は代替表現になる。
+
+\item |\JI{|\Meta{コード値}|,...}|\Means
+いわゆる「JISコード」(JIS~X~0208のGL表現)
+のコード値による入力を行う。
+コード値指定の方法は |\Ux| と同じ。
+出力には{(u)\pTeX}のJISコード和文出力の機能を使う。
+使えない場合は代替表現になる。
+
+\item |\KI{|\Meta{コード値}|,...}|\Means
+いわゆる「区点コード」のコード値による入力を行う。
+コード値指定は「RRCC」(RRは区番号、CCは点番号を10進2桁で表したもの)
+の形式で指定する。
+出力には{(u)\pTeX}のJISコード和文出力の機能を使う。
+使えない場合は代替表現になる。
+
+\item |\bxUx| / |\bxUI| / |\bxAJ| / |\bxJI| / |\bxKI|\Means
+|\Ux| 等は非常に短い名前なので他のパッケージと衝突する恐れがあり、
+そこでこのパッケージでは既に同名の命令がある場合は上書きしない
+ようにしている。
+|\bxUx| 等はそれぞれ |\Ux| 等と同じで、
+先のような場合にも常に使える。
+
+\end{itemize}
+
+なお、このパッケージは\Pkg{bxutf8}の為のドライバ(|\bxUHex|)
+および\Pkg{bxutf8x}の為のドライバを |\Ux| に相当するものに設定する。
+
+%===========================================================
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/bxbase/bxbase-ja.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/bxbase/bxbase.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxbase.def 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxbase.def 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,76 +1,80 @@
-%
-% bxbase.def
-%
+%%
+%% This is file 'bxbase.def'.
+%%
-% Note: bxbase.def and pxbase.def provide same set of functionality.
-% To avoid version clash, when a version of one of them is loaded,
-% load of an older version of the other is aborted.
+%% file declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bxbase.def}[2017/05/29 v1.1 BX base library]
+\def\bx at pkgname{BXbase} % bundle name
-%%%% stuffs read when \input'ed
-\ifx\bxbaseOk\undefined
-\bgroup
-\catcode`\@=11
-\gdef\bx at defextension{def}
-\gdef\bx at ver@#1{\expandafter\expandafter\expandafter\@parse at version
- \csname ver@#1.\@currext\endcsname//00\@nil}
- %% \bxInputDefFile{<def_name>}
-\gdef\bxInputDefFile#1{\@onefilewithoptions{#1}[][]\bx at defextension}
- %% \bxCheckCPart{<def_name>}
-\gdef\bxCheckCPart#1{%
- \@ifl at aded\@currext{#1}{%
- \ifnum\bx at ver@{#1}>\bx at ver@\@currname \expandafter\endinput\fi}{}}
-\egroup
-\let\bxbaseOk=t
-\bxInputDefFile{bxbase} %% read this file again
-\expandafter\endinput\fi
+%% check intergrity
+\edef\bxbz at tmpa{\@currname.\@currext}\def\bxbz at tmpb{bxbase.def}
+\ifx\bxbz at tmpa\bxbz at tmpb\else
+ \PackageError\bx at pkgname{Illegal load sequence}\@eha
+\expandafter\endinput\fi\relax
-%%--------------- folloing stuffs are read by \bxTnext
+%% code guards
+\edef\bxbz at restore@codes{%
+ \catcode33=\the\catcode33%
+ \catcode34=\the\catcode34%
+ \catcode39=\the\catcode39%
+ \catcode43=\the\catcode43%
+ \catcode45=\the\catcode45%
+ \catcode46=\the\catcode46%
+ \catcode47=\the\catcode47%
+ \catcode58=\the\catcode58%
+ \catcode60=\the\catcode60%
+ \catcode62=\the\catcode62%
+ \catcode94=\the\catcode94%
+ \catcode96=\the\catcode96%
+\relax}
+\catcode33=12 % <!>
+\catcode34=12 % <">
+\catcode39=12 % <'>
+\catcode43=12 % <+>
+\catcode45=12 % <->
+\catcode46=12 % <.>
+\catcode47=12 % </>
+\catcode58=12 % <:>
+\catcode60=12 % <<>
+\catcode62=12 % <>>
+\catcode94=7 % <^>
+\catcode96=12 % <`>
+\AtEndOfPackage{%
+ \bxbz at restore@codes
+ \let\bxbz at restore@codes\@undefined}
-%%%% file declaration
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{bxbase.def}[2010/06/15 v0.5 BX/PX base library]
-\bxCheckCPart{pxbase}
-%* v0.5.r13
+%--------------------------------------- general
-%%%% error messages
-\def\bx at b@pkgname{BX/PXbase} % bundle name
-\def\bx at b@error{\PackageError\bx at b@pkgname}
-\def\bx at err@nobbl{\bx at b@error{babel not yet loaded}\@eha}
-\def\bx at err@oorng{\bx at b@error{Number out of range}\@eha}
-\def\bx at err@nanbc{\bx at b@error{Non-BMP characters not supported}\@eha}
-\def\bx at err@ilnfm{\bx at b@error{Illegal number format}\@eha}
-\def\bx at err@uddrv#1{\bx at b@error{\string#1 is undefined}\@eha}
+%% packages
+\RequirePackage{bxtoolbox}[2017/05/29]
-%%%% common stuffs
-\ifx\bxUcv\@undefined
-\newcount\bxUcv % argument of \bx at Ux
-\fi
-\newif\ifbxOk % all-purpsoe switch
+%% variables
\let\bxHex\relax % result of \bxToHex...
\let\bxRes\relax % result of \bxToLower
-\edef\bx at b@resetcatcodes{% < ! " ' + ^ >
- \catcode33=\the\catcode33\catcode34=\the\catcode34%
- \catcode39=\the\catcode39\catcode43=\the\catcode43%
- \catcode94=\the\catcode94\relax}
-\catcode33=12 \catcode34=12 \catcode39=12 \catcode43=12
-\catcode94=6
+\ifundef\bxUcv{\newcount\bxUcv}{} % argument of \bx at Ux
-%%------ Programming tools
+%% unique tokens
+\def\bxbz at uniq{\bxbz at uniq@}
-%%%% \bxNullify\CS
-% Make \CS void and unoverridable by \providecommand.
-\def\bxNullify#1{\global\let#1\bx at nullified}
-\def\bx at nullified{\@gobble\bx@@nullified}
+%% error messages
+\def\bx at error{\PackageError\bx at pkgname}
+\def\bx at warn{\PackageWarningNoLine\bx at pkgname}
+\def\bx at err@nobbl{\bx at error{babel not yet loaded}\@eha}
+\def\bx at err@nanbc{\bx at error{Non-BMP characters not supported}\@eha}
+\def\bx at err@ilnfm{\bx at error{Illegal number format}\@eha}
+\def\bx at err@uddrv#1{\bx at error{\string#1 is undefined}\@eha}
+\def\bxbz at warn@depre#1#2{%
+ \PackageWarning\bx at pkgname
+ {The command '\string#1' is obsolete and\MessageBreak
+ its use is deprecated%
+ \ifx\relax#2\relax, \else
+ \MessageBreak (use #2 instead),\MessageBreak
+ \fi detected}}
-%%%% \bxDebug{<text>}
-% If \bxUseDebug is defined when bxbase is loaded, this command
-% prints debug messages; otherwise it is ignored.
-%\let\bx at typeout\typeout
-%\ifx\bxUseDebug\@undefined \let\bxDebug\@gobble
-%\else \def\bxDebug#1{\bx at typeout{BX debug: #1}}\fi
-\providecommand*\bxDebug{\@gobble}
+%--------------------------------------- programming tools
-%%%% \bxCheckMA\CS <text> \bxEndCheckMA
+%%<+> \bxCheckMA\CS <text> \bxEndCheckMA
% If this construct appears in moving arguments, it expands to
% an error message command.
\def\bxCheckMA{\let\bx at chkma@a\bx at chkma@a\noexpand}
@@ -77,18 +81,21 @@
\let\bxEndCheckMA\@empty \let\bx at chkma@z\relax
\def\bx at chkma@a#1{\bx at chkma@z\relax\bx at chkma@b}
\def\bx at chkma@b#1#2#3\bxEncCheckMA{\noexpand\bx at err@ivfrg#1#2}
-\def\bx at err@ivfrg#1{\bx at b@error{Cannot use \string#1 here}\@eha}
+\def\bx at err@ivfrg#1{\bx at error{Cannot use \string#1 here}\@eha}
-%%------ TeX engine distinction
+%%<+D> \bxCheckCounterpart{<base_name>}
+% Compares the version between the current file and <base_name>
+% with the extension of current file, and if the latter file is
+% already loaded and moreover turns out to be newer than the
+% system aborts loading the current file.
+\bxPreamble\newcommand*\bxCheckCounterpart[1]{%
+ \PackageWarning\bx at pkgname
+ {'\string\bxCheckCounterpart' is no more supported,%
+ \MessageBreak detected}}
-%%%% \bxIfPrimitive\CS{<yes>}{<no>}
-% Checks if \CS is a primitive.
-\def\bxIfPrimitive#1{%
- \edef\bx at tmpa{\string#1}\edef\bx at tmpb{\meaning#1}%
- \ifx\bx at tmpa\bx at tmpb \expandafter\@firstoftwo
- \else \expandafter\@secondoftwo \fi}
+%--------------------------------------- TeX engine distinction
-%%%% \bxEngineTypeX / \bxEngineTypeY
+%%<+> \bxEngineTypeX / \bxEngineTypeY
% Numbers that signify what I am.
% \bxEngineTypeX values
\chardef\bxETTeX=0 % none of those
@@ -98,27 +105,35 @@
% \bxEngineTypeY values (plus \bxETTeX)
\chardef\bxETeTeX=1 % e-TeX-extended
\chardef\bxETpdfTeX=3 % pdfTeX-extended
+\chardef\bxETLuaTeX=5 % LuaTeX-extended
% (here old pdfTeX without e-TeX is ignored)
%
-\bxIfPrimitive\kansuji{\let\bxEngineTypeX\bxETpTeX}{%
-\bxIfPrimitive\XeTeXversion{\let\bxEngineTypeX\bxETXeTeX}{%
-\bxIfPrimitive\Omegaversion{\let\bxEngineTypeX\bxETOmega}{%
- \let\bxEngineTypeX\bxETTeX}}}
-\bxIfPrimitive\eTeXversion{\let\bxEngineTypeY\bxETeTeX}{%
-\bxIfPrimitive\pdftexversion{\let\bxEngineTypeY\bxETpdfTeX}{%
- \let\bxEngineTypeY\bxETTeX}}
+ % Note:
+ % Originally LuaTeX was supposed to be 'both pdfTeX- and Omega-
+ % extended' (\bxEngineTypeX/Y = 3/3); however, It seems that
+ % in today's LaTeX world LuaTeX is no longer seen as Omega-
+ % extended (indeed, current LuaTeX drops many of the Omega-
+ % specific features). So LuaTeX got relocated at \bxEngineTypeX/Y
+ % = 0/5.
+\ifbxinpTeX \let\bxEngineTypeX\bxETpTeX
+\else\ifbxinXeTeX \let\bxEngineTypeX\bxETXeTeX
+\else\ifbxinOmega \let\bxEngineTypeX\bxETOmega
+\else \let\bxEngineTypeX\bxETTeX
+\fi\fi\fi
+\ifbxineTeX \let\bxEngineTypeY\bxETeTeX
+\else\ifbxinpdfTeX \let\bxEngineTypeY\bxETpdfTeX
+\else\ifbxinLuaTeX \let\bxEngineTypeY\bxETLuaTeX
+\else \let\bxEngineTypeY\bxETTeX
+\fi\fi\fi
+\bxDebug{engine type = \the\bxEngineTypeX/\the\bxEngineTypeY}
-%%%% \bx at b@uptex
-\bxIfPrimitive\kchar{\chardef\bx at b@uptex\@ne}{\chardef\bx at b@uptex\z@}
+%--------------------------------------- Babel something
-%%------ Babel something
-
%%<+> \bxBDHookBabel
% A begindocument-hook about Babel.
-\newif\ifbx at bbl@inuse
-\def\bx at bbl@bdhook{}
-\providecommand\bxBDHookBabel{\bx at bdhook@babel at do}
-\def\bx at bdhook@babel at do{%
+\newbool{bx at bbl@inuse}
+\bxPreamble\def\bx at bbl@bdhook{}
+\bxPreamble\newcommand*\bxBDHookBabel{%
\AtBeginDocument{%
\@ifpackageloaded{babel}{%
\bx at bbl@inusetrue
@@ -126,241 +141,96 @@
\bx at bbl@bdhook
}{}}%
\bxNullify\bxBDHookBabel}
-\@onlypreamble\bxBDHookBabel
-\@onlypreamble\bx at bdhook@babel at do
%%<+> \bxAtBeginDocumentBabel{<text>}
-% Register a begin-document hook that willl be invoked only when babel
+% Register a begin-document hook that will be invoked only when babel
% is loaded.
-\def\bxAtBeginDocumentBabel{%
+\bxPreamble\newcommand\bxAtBeginDocumentBabel{%
\g at addto@macro\bx at bbl@bdhook}
-\@onlypreamble\bxAtBeginDocumentBabel
-\@onlypreamble\bx at bbl@bdhook
-%%%% \bx at bbl@patch at sel@lang
+%% \bx at bbl@patch at sel@lang
% A patch to \select at language that disables automatic switching of
% caption language.
-\def\bx at bbl@patch at sel@lang{% this wlll be never invoked twice
+\bxPreamble\def\bx at bbl@patch at sel@lang{%
+ \global\let\bx at bbl@patch at sel@lang\relax
\global\let\bx at bbl@org at select@language\select at language
\gdef\select at language##1{%
\bx at bbl@copy{**C}{##1}\bx at bbl@copy{##1}{**Z}%
\bx at bbl@org at select@language{##1}\bx at bbl@copy{##1}{**C}}}
-\@onlypreamble\bx at bbl@patch at sel@lang
-%%%% \bx at bbl@do at captlang
-\def\bx at bbl@@main{main}
-\def\bx at bbl@@default{default}
-\def\bx at bbl@do at captlang{%
- % set captions
- \ifx\bx at bbl@captlang\bx at bbl@@main
- \let\bx at bbl@captlang\bbl at main@language \fi
- \ifx\bx at bbl@captlang\bx at bbl@@default
- \else\expandafter\ifx\csname l@\bx at bbl@captlang\endcsname\relax
- \@nolanerr\bx at bbl@captlang
- \else \csname date\bx at bbl@captlang\endcsname
- \csname captions\bx at bbl@captlang\endcsname
- \fi\fi}
-\@onlypreamble\bx at bbl@do at captlang
+%% \bx at bbl@do at captlang
+% Sets the caption language of Babel according to the value of
+% \bx at bbl@captlang.
+\bxPreamble\def\bx at bbl@do at captlang{%
+ \bxIfExpToEqual{\bx at bbl@captlang}{main}%
+ {\let\bx at bbl@captlang\bbl at main@language}{}%
+ \bxIfExpToEqual{\bx at bbl@captlang}{default}{}%else
+ {\bxIfcsundef{l@\bx at bbl@captlang}{\@nolanerr\bx at bbl@captlang}%
+ {\@nameuse{date\bx at bbl@captlang}%
+ \@nameuse{captions\bx at bbl@captlang}}}}
-%%%% \bx at bbl@copy{<lang1>}{<lang2>}
+%% \bx at bbl@copy{<lang1>}{<lang2>}
% Copies \captions... and \date... for save.
\def\bx at bbl@copy#1#2{%
- \bx at bbl@copy at a{#1}{#2}{captions}%
- \bx at bbl@copy at a{#1}{#2}{date}}
-\def\bx at bbl@copy at a#1#2#3{%
- \edef\bx at tmpa{\let\expandafter\noexpand\csname#3#1\endcsname
- \expandafter\noexpand\csname#3#2\endcsname}\bx at tmpa}
-\@namedef{captions**Z}{\@empty}
-\@namedef{date**Z}{\@empty}
+ \csletcs{captions#1}{captions#2}%
+ \csletcs{date#1}{date#2}}
+\csdef{captions**Z}{\@empty}
+\csdef{date**Z}{\@empty}
-%%<*> \bxcaptionlanguage{<lang>}
+%%<*D> \fixcaptionlanguage{<lang>}
+%%<+> \bxFixCaptionLanguage{<lang>}
% Change the caption language manually, with disabling automatic
% switching on it.
-\def\bxcaptionlanguage#1{%
+\bxPreamble\newcommand*\fixcaptionlanguage[1]{%
+ \bxbz at warn@depre\fixcaptionlanguage{}%
+ \bxFixCaptionLanguage{#1}}
+\bxPreamble\newcommand*\bxFixCaptionLanguage[1]{%
\@ifpackageloaded{babel}%
- {\ifx\bx at bbl@captlang\@undefined \bx at bbl@patch at sel@lang \fi
+ {\bx at bbl@patch at sel@lang
\xdef\bx at bbl@captlang{#1}}%
{\bx at err@nobbl}}
-\@onlypreamble\bxcaptionlanguage
-%%<*> \bxmainlanguage{<lang>}
+%%<+> \bxProvideCaptionLanguage{<lang>}
+\bxPreamble\newcommand*\bxProvideCaptionLanguage[1]{%
+ \ifundef\bx at bbl@captlang
+ {\bxFixCaptionLanguage{#1}}{}}
+
+%%<*> \setmainlanguage{<lang>}
% Changes the 'main' language (one that is effective at beginning).
-\def\bxmainlanguage#1{%
- \expandafter\ifx\csname date#1\endcsname\relax
- \@nolanerr{#1}\fi
+\bxPreamble\newcommand*\setmainlanguage[1]{%
+ \bxIfcsundef{date#1}{\@nolanerr{#1}}{}%
\xdef\bbl at main@language{#1}}
-\@onlypreamble\bxmainlanguage
%%<+> \bxTrivLangDef{<lang>}
% Makes a fake language option.
-\def\bxTrivLangDef#1{%
- \@ifundefined{date#1}{%
- \@ifundefined{l@#1}%
+\bxPreamble\newcommand*\bxTrivLangDef[1]{%
+ \bxIfcsundefX{date#1}{%
+ \bxIfcsundefX{l@#1}%
{\expandafter\chardef\csname l@#1\endcsname\z@}{}%
- \@namedef{date#1}{\relax}%
- \@namedef{captions#1}{\relax}%
- \@namedef{extras#1}{\relax}%
- \@namedef{noextras#1}{\relax}%
- \@namedef{date#1}{\relax}%
+ \csdef{date#1}{\relax}%
+ \csdef{captions#1}{\relax}%
+ \csdef{extras#1}{\relax}%
+ \csdef{noextras#1}{\relax}%
+ \csdef{date#1}{\relax}%
}{}}
-\@onlypreamble\bxTrivLangDef
-%%------ 'Number-to-hex-string' functions
-% All public commands put their result in \bxHex.
+%--------------------------------------- input through code values
-%%%% preparation
-\newif\ifbx at hx@bigchar
-\ifnum\bxEngineTypeX>\@ne \bx at hx@bigchartrue \fi
-\ifnum\bx at b@uptex>\z@ \bx at hx@bigchartrue \fi
-
-%%<+> \bxToHexTiny
-% For one-to-two-digit hex strings.
-\def\bxToHexTiny#1{%
- \chardef\bxHex=#1\relax
- \expandafter\bx at hx@tohextiny at a\meaning\bxHex\@nil}
-\def\bx at hx@tohextiny at a#1"#2\@nil{\def\bxHex{#2}}
-
-%%<+> \bxToHexSmall
-% For one-to-three-digit hex strings.
-\def\bxToHexSmall#1{%
- \mathchardef\bxHex=#1\relax
- \expandafter\bx at hx@tohexsmall at a\meaning\bxHex\@nil}
-\def\bx at hx@tohexsmall at a#1"#2\@nil{\def\bxHex{#2}}
-
-%%<+> \bxToHexTwo
-% For zero-padded two-digit hex strings.
-\def\bxToHexTwo#1{%
- \chardef\bxHex=#1\relax
- \expandafter\bx at hx@tohextwo at a\meaning\bxHex"0\@nil}
-\def\bx at hx@tohextwo at a#1"#2#3#4#5\@nil{\bx at hx@tohextwo at b#2#3#4\@nil}
-\def\bx at hx@tohextwo at b#1"#2\@nil{\def\bxHex{#2#1}}
-
-%%<+> \bxToHexThree
-% For zero-padded three-digit hex strings.
-\def\bxToHexThree#1{%
- \mathchardef\bxHex=#1\relax
- \expandafter\bx at hx@tohexthree at a\meaning\bxHex"00\@nil}
-\def\bx at hx@tohexthree at a#1"#2#3#4#5#6\@nil{\bx at hx@tohexthree at b#2#3#4#5\@nil}
-\def\bx at hx@tohexthree at b#1"#2\@nil{\def\bxHex{#2#1}}
-
-%%<+> \bxToHexFour
-% For zero-padded four-digit hex strings.
-\ifbx at hx@bigchar %----<*bigchar>
-\def\bxToHexFour#1{%
- \chardef\bxHex=#1\relax
- \expandafter\bx at hx@tohexfour at a\meaning\bxHex"000\@nil}
-\def\bx at hx@tohexfour at a#1"#2#3#4#5#6#7\@nil{\bx at hx@tohexfour at b#2#3#4#5#6\@nil}
-\def\bx at hx@tohexfour at b#1"#2\@nil{\def\bxHex{#2#1}}
-\else %----<*!bigchar>
-\mathchardef\bx at hx@fzzz="4000
-\def\bxToHexFour#1{\bgroup
- \@tempcnta=#1\relax\@tempcntb\@tempcnta\divide\@tempcntb\bx at hx@fzzz
- \ifcase\@tempcntb \advance\@tempcnta\bx at hx@fzzz \or \or
- \advance\@tempcnta-\bx at hx@fzzz \or \advance\@tempcnta-"8000 \or
- \@tempcnta\z@ \fi
- \mathchardef\bx at hx@tmp\@tempcnta
- \expandafter\bx at hx@tohexfour at a\meaning\bx at hx@tmp\@nil
- \egroup \let\bxHex\bx at hx@gtmp}
-\def\bx at hx@tohexfour at a#1"#2#3\@nil{%
- \expandafter\let\expandafter\bx at hx@tmp
- \csname bxhx at X/\the\@tempcntb#2\endcsname
- \ifx\bx at hx@tmp\relax \bx at err@oorng \global\let\bx at hx@gtmp\@empty
- \else \xdef\bx at hx@gtmp{\bx at hx@tmp#3}\fi}
-\def\bx at hx@nxt#1#2#3{\bgroup\catcode`#3=12
- \global\expandafter\def\csname bxhx at X/#1#2\endcsname{#3}\egroup}
-\@for\bx at hx@tmp:={040,051,062,073,144,155,166,177,248,259,26A,27B,%
- 34C,35D,36E,37F}\do{\expandafter\bx at hx@nxt\bx at hx@tmp}
-\fi %----</bigchar>
-
-%%<+> \bxToHexFive
-%%<+> \bxToHexFiveX
-% For zero-padded five-digit hex strings.
-\def\bxToHexFive{\bx at tohexfive@aa\relax}
-\def\bxToHexFiveX{\bx at tohexfive@aa
- {\ifnum\@tempcnta>\bx at hx@vdmax \@tempcnta=\bx at hx@vdmax\fi}}
-\ifbx at hx@bigchar %----<*bigchar>
-\chardef\bx at hx@vdmax="FFFFF
-\def\bx at tohexfive@aa#1#2{%
- {\@tempcnta=#2\relax#1\global\chardef\bx at hx@gtmp=\@tempcnta}%
- \expandafter\bx at hx@tohexfivex at a\meaning\bx at hx@gtmp"0000\@nil}
-\def\bx at hx@tohexfivex at a#1"#2#3#4#5#6#7#8\@nil{%
- \bx at hx@tohexfivex at b#2#3#4#5#6#7\@nil}
-\def\bx at hx@tohexfivex at b#1"#2\@nil{\edef\bxHex{#2#1}}
-\else %----<*!bigchar>
-\edef\bx at hx@vdmax{"FFFFF\space}
-\def\bx at tohexfive@aa#1#2{%
- \bgroup \@tempcnta=#2\relax#1%
- \@tempcntb=\@tempcnta \divide\@tempcnta\bx at hx@m\relax
- \bxToHexTwo\@tempcnta \let\bx at hx@tmp\bxHex
- \multiply\@tempcnta-\bx at hx@m\advance\@tempcnta\@tempcntb\relax
- \bxToHexThree\@tempcnta \xdef\bx at hx@gtmp{\bx at hx@tmp\bxHex}%
- \egroup \let\bxHex\bx at hx@gtmp}
-\fi %----</bigchar>
-
-%%<+> \bxToHexEight
-% For zero-padded eight-digit hex strings.
-\def\bxToHexEight#1{%
- \bgroup \@tempcnta=#1\relax
- \@tempcntb=\@tempcnta\divide\@tempcnta\p@\relax
- \bxToHexFour\@tempcnta \let\bx at hx@tmp\bxHex
- \multiply\@tempcnta-\p@\advance\@tempcnta\@tempcntb\relax
- \bxToHexFour\@tempcnta \xdef\bx at hx@gtmp{\bx at hx@tmp\bxHex}%
- \egroup \let\bxHex\bx at hx@gtmp}
-
-%%<+> \bxToHexUC
-% For zero-padded four-to-six-digit hex strings.
-\ifbx at hx@bigchar %----<*bigchar>
-\def\bxToHexUC#1{%
- \chardef\bxHex=#1\relax
- \expandafter\bx at hx@tohexuc at a\meaning\bxHex"\@empty\@empty000\@nil}
-\def\bx at hx@tohexuc at a#1"#2#3#4#5#6#7#8#9\@nil{%
- \bx at hx@tohexuc at b#2#3#4#5#6#7#8\@nil}
-\def\bx at hx@tohexuc at b#1"#2\@nil{\edef\bxHex{#2#1}}
-\else %----<*!bigchar>
-\mathchardef\bx at hx@m="1000
-\def\bxToHexUC#1{%
- \bgroup \@tempcnta=#1\relax
- \@tempcntb=\@tempcnta \divide\@tempcnta\bx at hx@m\relax
- \bxToHexSmall\@tempcnta \let\bx at hx@tmp\bxHex
- \multiply\@tempcnta-\bx at hx@m\advance\@tempcnta\@tempcntb\relax
- \bxToHexThree\@tempcnta \xdef\bx at hx@gtmp{\bx at hx@tmp\bxHex}%
- \egroup \let\bxHex\bx at hx@gtmp}
-\fi %----</bigchar>
-
-%%<+> \bxToDecFour
-\def\bxToDecFour#1{%
- \expandafter\bx at hx@todecfour at a\number#1"000\@nil}
-\def\bx at hx@todecfour at a#1#2#3#4#5#6\@nil{\bx at hx@todecfour at b#1#2#3#4#5\@nil}
-\def\bx at hx@todecfour at b#1"#2\@nil{\def\bxHex{#2#1}}
-
-%%<+> \bxToDecFive
-\def\bxToDecFive#1{%
- \expandafter\bx at hx@todecfive at a\number#1"0000\@nil}
-\def\bx at hx@todecfive at a#1#2#3#4#5#6#7\@nil{\bx at hx@todecfive at b#1#2#3#4#5#6\@nil}
-\def\bx at hx@todecfive at b#1"#2\@nil{\def\bxHex{#2#1}}
-
-%%------ Input through code values
-
%%<+> \bxBDHookUnicode
% A begindocument-hook about Unicode (& CID) input.
-\providecommand\bxBDHookUnicode{\bx at bdhook@unicode at do}
-\def\bx at bdhook@unicode at do{%
+\bxPreamble\newcommand*\bxBDHookUnicode{%
\AtBeginDocument{\bx at assign@Ux}%
\bxNullify\bxBDHookUnicode}
-\@onlypreamble\bxBDHookUnicode
-\@onlypreamble\bx at bdhook@unicode at do
%%<+> \bxBDHookJisInput
% A begindocument-hook about JIS-code input.
-\providecommand\bxBDHookJisInput{\bx at bdhook@jisinput at do}
-\def\bx at bdhook@jisinput at do{%
+\bxPreamble\newcommand*\bxBDHookJisInput{%
\AtBeginDocument{\bx at assign@JI}%
\bxNullify\bxBDHookJisInput}
-\@onlypreamble\bxBDHookJisInput
-\@onlypreamble\bx at bdhook@jisinput at do
-%%<+> \bxFallbackSym
-\def\bxFallbackSym#1{\leavevmode\bx at fbs@fnt{\dimen@=\bx at junit\relax
+%%<+> \bxFallbackSym{<code>}
+\newcommand*\bxFallbackSym[1]{%
+ \leavevmode\bx at fbs@fnt{\dimen@=\bx at junit\relax
\hb at xt@\dimen@{\hss\vrule\@width\z@\@height.88\dimen@\@depth.12\dimen@
\frame{\lower.04\dimen@\hb at xt@.84\dimen@{\hss\vbox to.84\dimen@{\vss
\hsize=.84\dimen@\baselineskip\z@\lineskip.01\dimen@\parskip\z at skip
@@ -375,7 +245,7 @@
%%<+> \bxCodeValueSeq\CS{<text>}
% Dispatcher for code value sequences.
-\def\bxCodeValueSeq{%
+\newcommand*\bxCodeValueSeq{%
\let\bx at cvseq@branch\bx at cvseq@branch at hex
\bx at cvseq@a}
\def\bx at cvseq@a#1#2{%
@@ -404,7 +274,7 @@
%%<+> \bxCodeValueSeqD\CS{<text>}
% Same as \bxCodeValueSeq, except that it defaults to decimal.
-\def\bxCodeValueSeqD{%
+\newcommand*\bxCodeValueSeqD{%
\let\bx at cvseq@branch\bx at cvseq@branch at dec \bx at cvseq@a}
\def\bx at cvseq@branch at dec{%
\if !\bx at toka \let\bx at nxt\bx at cvseq@fin
@@ -411,25 +281,24 @@
\else \let\bx at nxt\bx at cvseq@pfx \fi
\bx at nxt}
-%%<+> \bxUx, \bxUI, \bxAJ, \bxJI, \bxKI
+%%<*> \bxUx, \bxUI, \bxAJ, \bxJI, \bxKI
% The prefixed names for \Ux, etc. They are (more likely to be)
% collision-safe.
-\let\bxUx\relax
-\DeclareRobustCommand*\bxUx{\bxCodeValueSeq\bx at Ux}
-\let\bxUI\relax
-\DeclareRobustCommand*\bxUI{\bxCodeValueSeq\bx at UI}
-\let\bxAJ\relax
-\DeclareRobustCommand*\bxAJ{\bxCodeValueSeqD\bx at AJ}
-\let\bxJI\relax
-\DeclareRobustCommand*\bxJI{\bxCodeValueSeq\bx at JI}
-\let\bxKI\relax
-\DeclareRobustCommand*\bxKI{\bxCodeValueSeqD\bx at KI}
+\bxNewrobustcmd*\bxUx{\bxCodeValueSeq\bx at Ux}
+\bxNewrobustcmd*\bxUI{\bxCodeValueSeq\bx at UI}
+\bxNewrobustcmd*\bxAJ{\bxCodeValueSeqD\bx at AJ}
+\bxNewrobustcmd*\bxJI{\bxCodeValueSeq\bx at JI}
+\bxNewrobustcmd*\bxKI{\bxCodeValueSeqD\bx at KI}
%%<+> \bxUHex{<value>}, \bxUInt{<value>}
% Alternative entry points for \Ux. The code value is specified in
% hexadecimal (\bxUHex) / decimal (\bxUInt) numerals.
-\def\bxUHex{\protect\bx at Uxh}
-\def\bxUqInt{\protect\bx at UInt}
+\def\bxbz at tmpa{\bxUIntDummyBxutfx}
+\bxIfx{\bxUInt\bxbz at tmpa}{\undef\bxUInt}{}
+\def\bxbz at tmpa{\bxUHexDummyBxutf}
+\bxIfx{\bxUHex\bxbz at tmpa}{\undef\bxUHex}{}
+\newcommand*\bxUHex{\protect\bx at Uxh}
+\newcommand*\bxUInt{\protect\bx at UInt}
\def\bx at UInt#1{\bxUcv=#1\relax\bx at Ux}
%% \bx at UIh@fb, \bx at AJ@fb
@@ -447,7 +316,7 @@
\bxFallbackSym{{\sml#6}\\#1#2\\#3#4}}
\def\bx at hx@supzero#1{\ifx0#1\else\expandafter#1\fi}
-%%%% \bx at assign@Ux
+%% \bx at assign@Ux
% Picks up appropriate drivers \bx at Ux etc. according to current
% load-states of packages.
% [driver] [purpose] [argument] [default]
@@ -477,7 +346,7 @@
\def\bx at UIh@ums#1{\expandafter\UMS\expandafter{#1}}
% \CID with \bxUcv
\def\bx at AJ@otf{\CID\bxUcv}
-\def\bx at assign@Ux{%
+\bxPreamble\def\bx at assign@Ux{%
% If I have bxucs, then set \bx at Ux to \bx at Ux@ucs
% (which fallbacks on \bx at UI in failure).
\@ifpackageloaded{bxucs}{%
@@ -495,7 +364,7 @@
\@ifpackageloaded{pxotf}{%
\let\bx at UIh\bxUIh at otf \let\bx at UI\pxUcvUTF \let\bx at AJ\pxUcvCID}{}%
% If I am upTeX I use \kchar.
- \ifnum\bx at b@uptex>\z@
+ \ifbxinupTeX
\def\bx at UI{\kchar\bxUcv}\def\bx at UIh##1{\kchar"##1\relax}%
% If I am a Unicode-aware engine, then...
\else\ifnum\bxEngineTypeX>\@ne %
@@ -515,17 +384,16 @@
\ifx\bx at AJ@usr\@undefined\else \let\bx at AJ\bx at AJ@usr \fi
\let\bx at setajdriver@a\bx at setajdriver@b
}
-\@onlypreamble\bx at assign@Ux
-%%%% \setUIdriver\CS
-\def\setUIdriver#1{%
+%%<*> \setUIdriver\CS
+\newcommand*\setUIdriver[1]{%
\ifx#1\@undefined \bx at err@uddrv#1%
\else \bx at setuidriver@a#1\fi}
\def\bx at setuidriver@a#1{\let\bx at UIh@usr#1}
\def\bx at setuidriver@b#1{\let\bx at UIh#1}
-%%%% \setAJdriver\CS
-\def\setAJdriver#1{%
+%%<*> \setAJdriver\CS
+\newcommand*\setAJdriver[1]{%
\ifx#1\@undefined \bx at err@uddrv#1%
\else \bx at setajdriver@a#1\fi}
\def\bx at setajdriver@a#1{\let\bx at AJ@usr#1}
@@ -538,7 +406,7 @@
% \bx at KI Kuten-code \bxUcv fallback
\def\bx at JI{\bx at JI@fb}
\def\bx at KI{\bx at KI@fb}
-\def\bx at assign@JI{%
+\bxPreamble\def\bx at assign@JI{%
% \JI & \KI are available only in (u)pTeX
\ifnum\bxEngineTypeX=\@ne
\def\bx at JI{\char\jis\bxUcv\relax}\let\bx at KI\bx at KI@pTeX
@@ -557,7 +425,7 @@
\ifnum\bxUcv<\bx at ki@myr \advance\bxUcv\bx at ki@myr \fi
\expandafter\bx at ki@ptex at a\the\bxUcv\@nil
\bx at ki@char\jis\bxUcv\relax}
-\bgroup \@tempcnta=94
+\begingroup \@tempcnta=94
\@for\bx at tmpa:=01,08,03,04,05,12,13,14,15\do{\advance\@tempcnta\@ne
\expandafter\xdef\csname bx at JSH/\bx at tmpa\endcsname{\the\@tempcnta}}
\@tempcntb=77 \loop
@@ -565,7 +433,7 @@
\expandafter\xdef\csname bx at JSH/\the\@tempcntb\endcsname
{\the\@tempcnta}%
\ifnum\@tempcntb<94 \repeat
-\egroup
+\endgroup
\def\bx at ki@ptex at a#1#2#3#4#5#6\@nil{%
\ifnum#1=\@ne \bxUcv=#2#3\relax
\else \bxUcv=0\csname bx at JSH/#2#3\endcsname\relax \fi
@@ -572,104 +440,38 @@
\multiply\bxUcv\@cclvi \advance\bxUcv#4#5\relax
\advance\bxUcv\bx at ki@bas}
\fi %----</pTeX>
-\@onlypreamble\bx at assign@JI
-%%------ Assignment check
+%--------------------------------------- "safe-caret" module
-%%%% \bxAssign <assignment>\relax
-\def\bxAssign{%
- \bxOkfalse\afterassignment\bx at b@assign at a}
-\def\bx at b@assign at a#1\relax{%
- \def\bx at tmpa{#1}\ifx\bx at tmpa\@empty\bxOktrue\fi}
+%% variables
+\newbool{bx at acr@ok}
+\newbool{bx at acr@needed}
+\newbool{bx at safecaret}
-%%------ Case conversion
+\catcode`\^=13 %---- make caret active
-%%%% \bxToLower{<string>}
-% Sets to \bxRes <string> converted to lowercase.
-\def\bxToLower#1{%
- \edef\bxRes{\lowercase{\def\noexpand\bxRes{#1}}}\bxRes}
-
-%%%% \bxToUpper{<string>}
-\def\bxToUpper#1{%
- \edef\bxRes{\uppercase{\def\noexpand\bxRes{#1}}}\bxRes}
-
-%%------ Document-level specials
-% Such specials must come before any typeset commands in DVI.
-
-%%%% \bxDocumentSpecial{<text>}
-% Appends \special{<text>} to the list of 'document-level specials'.
-% A simple use of \AtBeginDvi will do in this case.
-\def\bxDocumentSpecial#1{%
- \AtBeginDvi{\special{#1}}}
-\@onlypreamble\bxDocumentSpecial
-
-%%%% \bxDocumentSpecialUrgent{<text>}
-% Similar to the above, but it demands that the given special be
-% placed as early as possible.
-\def\bxDocumentSpecialUrgent#1{%
- \bx at docspec@urgent at init
- \bx at prepend@box\bx at dsu@box{\special{#1}}}
-\def\bx at prepend@box#1#2{%
- \global\setbox#1\vbox{#2\unvbox#1}}
-\providecommand\bx at docspec@urgent at init{\bx at docspec@urgent at init@do}
-\def\bx at docspec@urgent at init@do{%
- \newbox\bx at dsu@box
- \AtBeginDocument{%
- \ifx\AtBeginShipoutFirst\@undefined
- \bx at prepend@box\@begindvibox{\unvbox\bx at dsu@box}%
- \else % 'atbegshi' package is in use
- {\toks@{\unvbox\bx at dsu@box}%
- \toks\tw@\expandafter{\AtBegShi at HookFirst}%
- \xdef\AtBegShi at HookFirst{\the\toks@\the\toks\tw@}}
- \fi}%
- \bxNullify\bx at docspec@urgent at init}
-\@onlypreamble\bxDocumentSpecialUrgent
-\@onlypreamble\bx at docspec@urgent at init
-\@onlypreamble\bx at docspec@urgent at init@do
-
-%%%% \recordpapersize
-\def\recordpapersize{%
- \bxDocumentSpecial{papersize=\the\paperwidth,\the\paperheight}%
- \bxNullify\recordpapersize}
-\@onlypreamble\recordpapersize
-
-%%<*> \dvipdfmxmapline{<text>}
-%%<*> \dvipdfmxmapfile{<text>}
-\def\dvipdfmxmapline#1{\bxDocumentSpecial{pdf:mapline #1}}
-\@onlypreamble\dvipdfmxmapline
-\def\dvipdfmxmapfile#1{\bxDocumentSpecial{pdf:mapfile #1}}
-\@onlypreamble\dvipdfmxmapfile
-
-%%----- "safe-caret" module
-\newif\ifbx at acr@ok
-\newif\ifbx at acr@needed \bx at acr@neededfalse
-\newif\ifbx at safecaret \bx at safecaretfalse
-\catcode`\^=13
-
-%%%%<*> \safecaret
-\def\safecaret{%
+%%<*> \safecaret
+\bxPreamble\newcommand*\safecaret{%
\bx at safecarettrue}
-\@onlypreamble\safecaret
-%%%% \bxEnableSafeCaret
-\def\bxEnableSafeCaret{%
+%%<+> \bxEnableSafeCaret
+\bxPreamble\newcommand*\bxEnableSafeCaret{%
\bx at acr@neededtrue}
-\@onlypreamble\bxEnableSafeCaret
-%%%% \bx at acr@defbytes
-\def\bx at acr@defbytes{%
+%% \bx at acr@defbytes
+\bxPreamble\def\bx at acr@defbytes{%
\bgroup\@tempcnta128\lccode`\Z=`\B\catcode`\^\active
\@whilenum\@tempcnta<256 \do{%
\lccode`\^\@tempcnta \chardef\bx at acr@tok\@tempcnta
\expandafter\bx at acr@defbytes at do@a\meaning\bx at acr@tok\@nil
\advance\@tempcnta\@ne}\egroup}
-\def\bx at acr@defbytes at do@a#1"#2\@nil{% name is bx at acr@B/ab etc.
+\bxPreamble\def\bx at acr@defbytes at do@a#1"#2\@nil{% name is bx at acr@B/ab etc.
\lowercase{\expandafter\gdef\csname bx at acr@Z/#2\endcsname{^}}}
\@onlypreamble\bx at acr@defbytes
\@onlypreamble\bx at acr@defbytes at do@a
-%%%% \bx at acr@caret
-%% This command should be \let'd to active <^>.
+%% \bx at acr@caret
+% This command should be \let'd to active <^>.
\def\bx at acr@caret{%
\let\bx at acr@out\@empty \bx at acr@caret at a}
\def\bx at acr@caret at a{%
@@ -720,13 +522,12 @@
\bx at acr@normcaret #2}
\let\bx at acr@normcaret\sp % this does not mean much
-%%%% \bx at acr@initialize
-\def\bx at acr@initialize{%
+%% \bx at acr@initialize
+\bxPreamble\def\bx at acr@initialize{%
\bx at acr@defbytes}
-\@onlypreamble\bx at acr@initialize
-%%%% \bx at acr@annihilate
-\def\bx at acr@annihilate{%
+%% \bx at acr@annihilate
+\bxPreamble\def\bx at acr@annihilate{%
\let\bx at acr@caret\relax\let\bx at acr@caret at a\relax
\let\bx at acr@caret at b\relax\let\bx at acr@caret at c\relax
\let\bx at acr@caret at d\relax\let\bx at acr@caret at e\relax
@@ -734,30 +535,28 @@
\let\bx at acr@nextcaret\relax\let\bx at acr@nextcaret at a\relax
\let\bx at acr@nexthexdgt\relax\let\bx at acr@nexthexdgt at a\relax
\let\bx at acr@finish\relax\let\bx at acr@finish at a\relax}
-\@onlypreamble\bx at acr@annihilate
-%%%% \bx at acr@babel at hookcaret
-\def\bx at acr@babel at hookcaret{%
+%% \bx at acr@babel at hookcaret
+\bxPreamble\def\bx at acr@babel at hookcaret{%
\expandafter\ifx\csname active at char\string^\endcsname\relax\else
\declare at shorthand\system at group{^}{\bx at acr@caret}%
\let\bx at acr@normcaret\bx at acr@babel at normcaret
\bxEnableSafeCaret \fi}
-\@onlypreamble\bx at acr@babel at hookcaret
\edef\bx at acr@babel at normcaret{%
\expandafter\noexpand\csname normal at char\string^\endcsname}
-%%%% \bx at acr@verbatim at hookcaret
-\def\bx at acr@verbatim at hookcaret{%
+%% \bx at acr@verbatim at hookcaret
+\bxPreamble\def\bx at acr@verbatim at hookcaret{%
\g at addto@macro\@noligs{\catcode`\^\active\let^\bx at acr@caret
\let\bx at acr@normcaret\bx at acr@verb at normcaret}%
\bxEnableSafeCaret}
\begingroup \catcode`\^=12
-\global\let\bx at acr@verb at normcaret=^\endgroup
-\@onlypreamble\bx at acr@verbatim at hookcaret
+\global\let\bx at acr@verb at normcaret=^%
+\endgroup
-%%%% begin-document hook
-\providecommand*\bxBDHookSafeCaret{\bx at bdhook@safecaret at do}
-\def\bx at bdhook@safecaret at do{%
+%%<+> \bxBDHookSafeCaret
+% Begin-document hook.
+\bxPreamble\newcommand*\bxBDHookSafeCaret{%
\AtBeginDocument{%
%% function activated by '\safecaret'
\ifbx at safecaret
@@ -769,23 +568,106 @@
\else \bx at acr@annihilate \fi
\let\bxEnableSafeCaret\@undefined}%
\bxNullify\bxBDHookSafeCaret}
-\@onlypreamble\bx at bdhook@safecaret at do
-\catcode`\^=6
-%%------ "shadow map" module
+\catcode`\^=7 %---- make caret normal
-%%%% \bxUseShadowMap\CS{<map_tfm>}
-\def\bxUseShadowMap#1#2{%
- \global\font#1=#2\relax}
+%--------------------------------------- hyphenation something
-%%%% \bxMap\CS
-\mathchardef\bx at m@cc=256
-\def\bxMap#1{\begingroup\count@\bxUcv\divide\count@\bx at m@cc
- \chardef\bx at m@hb\count@ \multiply\count@\bx at m@cc
- \advance\bxUcv-\count@ \setbox\z@\hbox{#1\bx at m@hb\char\bxUcv}%
- \global\bxUcv\wd\z@ \endgroup}
+%%<*> 'withnohyph' environment
+\expandafter\ifx\csname l at nohyphenation\endcsname\relax
+ \newlanguage\l at nohyphenation \fi
+\def\withnohyph{\language\l at nohyphenation}
+\let\endwithnohyph\relax
-%%------ all done
-\bx at b@resetcatcodes \let\bx at nxt\relax
+%--------------------------------------- patch for 'ucs' package
+
+%% \bxBDHookUcsFastErrors
+% The begin-document hook, which forces the 'fasterrors' option
+% of 'ucs' package when running on pTeX.
+\bxPreamble\newcommand*\bxBDHookUcsFastErrors{%
+ \ifbxinpTeX
+ \AtBeginDocument{%
+ \@ifpackageloaded{ucs}{%
+ \let\UnicodeOptionfasterrorsfalse\UnicodeOptionfasterrorstrue
+ \UnicodeOptionfasterrorstrue}{}}%
+ \fi
+ \bxNullify\bxBDHookUcsFastErrors}
+
+%--------------------------------------- DVI-specials
+
+%%<*D> \usejapanesepdfstring
+\bxPreamble\newcommand*\usejapanesepdfstring{}
+\if s\bxInternalJaEncoding
+ \def\usejapanesepdfstring{% why use CP932??
+ \bxDocumentSpecialUrgent{pdf:tounicode 90ms-RKSJ-UCS2}%
+ \bxNullify\usejapanesepdfstring}
+\else\if e\bxInternalJaEncoding
+ \def\usejapanesepdfstring{%
+ \bxDocumentSpecialUrgent{pdf:tounicode EUC-UCS2}%
+ \bxNullify\usejapanesepdfstring}
+\else\if u\bxInternalJaEncoding
+ \def\usejapanesepdfstring{%
+ \bxDocumentSpecialUrgent{pdf:tounicode UTF8-UCS2}%
+ \bxNullify\usejapanesepdfstring}
+\else
+ \def\usejapanesepdfstring{%
+ \bx at warn{\string\usejapanesepdfstring\space ignored,\MessageBreak
+ since internal encoding is unknown}%
+ \bxNullify\usejapanesepdfstring}
+\fi\fi\fi
+\preto\usejapanesepdfstring{%
+ \bxbz at warn@depre\usejapanesepdfstring{'pxjahyper' package}}
+
+%%<*D> \recordpapersize
+\bxPreamble\newcommand*\recordpapersize{%
+ \bxbz at warn@depre\recordpapersize{'bxpapersize' package}%
+ \bxDocumentSpecial{papersize=\the\paperwidth,\the\paperheight}%
+ \bxNullify\recordpapersize}
+
+%%<*D> \dvipdfmxmapline{<text>}
+%%<*D> \dvipdfmxmapfile{<text>}
+\bxPreamble\newcommand*\dvipdfmxmapline[1]{%
+ \bxbz at warn@depre at dpxmap
+ \bxDocumentSpecial{pdf:mapline #1}}
+\bxPreamble\newcommand*\dvipdfmxmapfile[1]{%
+ \bxbz at warn@depre at dpxmap
+ \bxDocumentSpecial{pdf:mapfile #1}}
+\def\bxbz at warn@depre at dpxmap{%
+ \bxbz at warn@depre\dvipdfmxmapfile{'pxchfon' package}%
+ \global\let\bxbz at warn@depre at dpxmap\relax}
+
+%--------------------------------------- CJK font scaling
+
+%% \bxbz at doc@class at type
+%%<+D> \pxDocClassType
+% 1 = pLaTeX standard class
+% 2 = New standard classes by Okumura
+% 0 = otherwise
+\bxUcv=\z@
+\@ifclassloaded{jarticle}{\bxUcv=\@ne}{}
+\@ifclassloaded{jreport}{\bxUcv=\@ne}{}
+\@ifclassloaded{jbook}{\bxUcv=\@ne}{}
+\@ifclassloaded{tarticle}{\bxUcv=\@ne}{}
+\@ifclassloaded{treport}{\bxUcv=\@ne}{}
+\@ifclassloaded{tbook}{\bxUcv=\@ne}{}
+\@ifclassloaded{ujarticle}{\bxUcv=\@ne}{}
+\@ifclassloaded{ujreport}{\bxUcv=\@ne}{}
+\@ifclassloaded{ujbook}{\bxUcv=\@ne}{}
+\@ifclassloaded{utarticle}{\bxUcv=\@ne}{}
+\@ifclassloaded{utreport}{\bxUcv=\@ne}{}
+\@ifclassloaded{utbook}{\bxUcv=\@ne}{}
+\@ifclassloaded{jsarticle}{\bxUcv=\tw@}{}
+\@ifclassloaded{jsreport}{\bxUcv=\tw@}{}
+\@ifclassloaded{jsbook}{\bxUcv=\tw@}{}
+\chardef\bxbz at doc@class at type=\bxUcv
+\chardef\pxDocClassType=\bxUcv
+
+%%<+> \pxUpScale
+\edef\pxUpScale{%
+ \ifx\Cjascale\@undefined
+ \ifcase\bxbz at doc@class at type 1\or 0.962216\or 0.924690\else 1\fi
+ \else \Cjascale \fi}
+
+%--------------------------------------- all done
\endinput
%% EOF
Modified: trunk/Master/texmf-dist/tex/latex/bxbase/bxbase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxbase.sty 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxbase.sty 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,49 +1,51 @@
-%
-% bxbase.sty
-%
+%%
+%% This is file 'bxbase.sty'.
+%%
+%% Copyright (c) 2017 Takayuki YATO (aka. "ZR")
+%% GitHub: https://github.com/zr-tex8r
+%% Twitter: @zr_tex8r
+%%
+%% This package is distributed under the MIT License.
+%%
-%%%% package declaration
+%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxbase}[2010/06/15 v0.5 BX base library]
+\ProvidesPackage{bxbase}[2017/05/29 v1.1 BX base library]
-%%%% include 'bxbase.def'
-\input{bxbase.def}
+%--------------------------------------- main
+
+%% load submodule
+\providecommand*\bxRequireDefinition[1]{%
+ \def\bxbz at ext{def}\@onefilewithoptions{#1}[][]\bxbz at ext}
+\bxRequireDefinition{bxbase}
+
+%% enable begin-document hooks
\bxBDHookBabel
\bxBDHookUnicode
+\bxBDHookJisInput
\bxBDHookSafeCaret
+\bxBDHookUcsFastErrors
-%%%% error messages
-\def\bx at pkgname{bxbase}
-\def\bx at error{\PackageError\bx at pkgname}
-\def\bx at alert{\PackageWarningNoLine\bx at pkgname}
-\def\bx at warn{\PackageInfo\bx at pkgname}
-\def\bx at warn@aecs#1{\px at warn{Command \string#1 already exists}}
+%% error messages
+\def\bxbz at pkgname{bxbase}
+\def\bxbz at inf@aecsq#1{%
+ \PackageInfo\bxbz at pkgname
+ {Command \string#1 already exists}}
-%%------
+%--------------------------------------- extra
-%%<*> \Ux, \UI, \AJ
-\ifx\Ux\@undefined \def\Ux{\bxUx}%
-\else \px at warn@aecs\Ux \fi
-\ifx\UI\@undefined \def\UI{\bxUI}%
-\else \px at warn@aecs\UI \fi
-\ifx\AJ\@undefined \def\AJ{\bxAJ}%
-\else \px at warn@aecs\AJ \fi
+%%<*> \Ux / \UI / \AJ / \JI / \KI
+% define commands unless their name is already used
+\bxPreamble\def\bxbz at charcmd#1#2{%
+ \ifundef#1{\def#1{#2}}{\bxbz at inf@aecsq#1}}
+\bxbz at charcmd\Ux\bxUx
+\bxbz at charcmd\UI\bxUI
+\bxbz at charcmd\AJ\bxAJ
+\bxbz at charcmd\JI\bxJI
+\bxbz at charcmd\KI\bxKI
-%%<*> \JI, \KI
-\ifx\JI\@undefined \def\JI{\bxJI}%
-\else \px at warn@aecs\JI \fi
-\ifx\KI\@undefined \def\KI{\bxKI}%
-\else \px at warn@aecs\KI \fi
-
-%%%% withnohyph environment
-\expandafter\ifx\csname l at nohyphenation\endcsname\relax
- \newlanguage\l at nohyphenation \fi
-\def\withnohyph{\language\l at nohyphenation}
-\let\endwithnohyph\relax
-
-%%------ all done
+%--------------------------------------- all done
\endinput
-%% EOF
%
% * bxbase provides:
% - bx at Uxh@fb (terminal)
@@ -68,3 +70,4 @@
% v v
% bx at UI > bx at UIh = bx at Uxh@fb or bx at UIh@p
%
+%% EOF
Added: trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ext.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ext.def (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ext.def 2017-06-05 23:15:19 UTC (rev 44481)
@@ -0,0 +1,563 @@
+%%
+%% This is file 'bxtoolbox-ext.def'.
+%%
+
+%% file declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bxtoolbox-ext.def}[2017/05/29 v1.1]
+
+%% check intergrity
+\edef\bxtb at tmpa{\@currname.\@currext}\def\bxtb at tmpb{bxtoolbox-ext.def}
+\ifx\bxtb at tmpa\bxtb at tmpb\else
+ \PackageError\bxtb at pkgname{Illegal load sequence}\@eha
+\expandafter\endinput\fi\relax
+
+%% load submodule
+\providecommand*\bxRequireDefinition[1]{%
+ \def\bx@@def{def}\@onefilewithoptions{#1}[][]\bx@@def}
+\bxRequireDefinition{bxtoolbox}
+
+%% code guards
+\edef\bxtb at x@restore at codes{%
+ \catcode33=\the\catcode33%
+ \catcode34=\the\catcode34%
+ \catcode39=\the\catcode39%
+ \catcode45=\the\catcode45%
+ \catcode46=\the\catcode46%
+ \catcode47=\the\catcode47%
+ \catcode58=\the\catcode58%
+ \catcode59=\the\catcode59%
+ \catcode60=\the\catcode60%
+ \catcode62=\the\catcode62%
+ \catcode96=\the\catcode96%
+\relax}
+\catcode33=12 % <!>
+\catcode34=12 % <">
+\catcode39=12 % <'>
+\catcode45=12 % <->
+\catcode46=12 % <.>
+\catcode47=12 % </>
+\catcode58=12 % <:>
+\catcode59=12 % <;>
+\catcode60=12 % <<>
+\catcode62=12 % <>>
+\catcode96=12 % <`>
+\AtEndOfPackage{%
+ \bxtb at x@restore at codes
+ \undef\bxtb at x@restore at codes}
+
+%--------------------------------------- general
+
+%% variables
+\bxIfcsundefX{ifbxOk}{\newbool{bxOk}}{} % all-purpsoe switch
+\bxIfcsundefX{bxResDim}{\newdimen\bxResDim}{}
+\let\bxHex\relax % result of \bxToHex...
+\let\bxRes\relax % result of \bxToLower
+
+%% error messages
+\def\bxtb at err@oorng{\bxtb at error{Number out of range}\@eha}
+
+%--------------------------------------- programming tools
+
+%%<+> \bxDebug{<text>}
+% Prints a debug message. By default, it is no-op.
+\providecommand*\bxDebug{\@gobble}
+
+%%<+> \bxShowbool{<name>}
+\newcommand*{\bxShowbool}[1]{\ifbool{#1}{true}{false}}
+
+%%<+> \bxShowtoggle{<name>}
+\newcommand*{\bxShowtoggle}[1]{\iftoggle{#1}{true}{false}}
+
+%%<+> \bxRequireDefinition
+% Same as \RequirePackage except that it loads '.def' files.
+% [Definition appears near the top of this file]
+%%<+D> \bxInputDefFile
+% Old name for \bxRequireDefinition
+\bxPreamble\newcommand*{\bxInputDefFile}{\bxRequireDefinition}
+
+%%<+> \bxNullify\CS
+% Make \CS void and unoverridable by \providecommand.
+\def\bxNullify#1{\global\let#1\bx at nullified}
+\def\bx at nullified{\@gobble\bx@@nullified}
+
+%%<+> \bxForEachIn<arg>,...\do{<repl_text>}
+%%<+> \bxForEachTokenIn<arg>,...\do{<repl_text>}
+\newcommand*\bxForEachIn{\bxtb at forei@a\@for}
+\newcommand*\bxForEachTokenIn{\bxtb at forei@a\@tfor}
+\def\bxtb at forei@a#1#2\do#{%
+ \def\bxtb at forei@b{#1\bxtb at forei@x:=#2\do
+ {\expandafter\bxtb at forei@do\expandafter{\bxtb at forei@x}}}%
+ \afterassignment\bxtb at forei@b \def\bxtb at forei@do##1}
+
+%%<+> \bxWithArgExpd{<arg1>}\do{<repl-text>}
+%%<+> \bxWithArgFullExpd{<arg1>}\do{<repl-text>}
+\newcommand*\bxWithArgExpd{}
+\def\bxWithArgExpd#1\do#{%
+ \expandafter\bxtb at with@arg at expd@a#1\@nil}
+\def\bxtb at with@arg at expd@a#1\@nil{%
+ \def\bxtb at with@args at expd@do{\bxtb at do{#1}}%
+ \afterassignment\bxtb at with@args at expd@do
+ \def\bxtb at do##1}
+\newcommand*\bxWithArgFullExpd{}
+\def\bxWithArgFullExpd#1\do#{%
+ \edef\bxtb at args{{#1}}%
+ \def\bxtb at with@args at expd@do{\expandafter\bxtb at do\bxtb at args}%
+ \afterassignment\bxtb at with@args at expd@do
+ \def\bxtb at do##1}
+
+%%<+> \bxWithArgsExpd{<arg1>}...\do{<repl-text>}
+%%<+> \bxWithArgsFullExpd{<arg1>}...\do{<repl-text>}
+\newcommand*\bxWithArgsExpd{%
+ \begingroup
+ \count@=\z@ \let\do\bxtb at uniq
+ \let\bxtb at l@tmpa\@empty
+ \bxtb at with@args at expd@gth at a}
+\def\bxtb at with@args at expd@gth at a{%
+ \futurelet\bxtb at tok\bxtb at with@args at expd@gth at b}
+\def\bxtb at with@args at expd@gth at b{%
+ \bxIfx{\bxtb at tok\bxtb at uniq}%
+ {\bxtb at with@args at expd@pst at a}%
+ {\bxtb at with@args at expd@gth at c}}
+\def\bxtb at with@args at expd@gth at c#1{%
+ \expandafter\bxtb at with@args at expd@gth at d#1\@nil}
+\def\bxtb at with@args at expd@gth at d#1\@nil{%
+ \ifnum\count@<9
+ \appto\bxtb at l@tmpa{{#1}}%
+ \advance\count@\@ne
+ \fi
+ \bxtb at with@args at expd@gth at a}
+\def\bxtb at with@args at expd@pst at a#1{%
+ \@whilenum\count@<9 \do{%
+ \appto\bxtb at l@tmpa{{}}\advance\count@\@ne}%
+ \expandafter\def\expandafter\bxtb at l@tmpa\expandafter{%
+ \expandafter{\bxtb at l@tmpa}}%
+ \xpreto\bxtb at l@tmpa{\noexpand\bxtb at with@args at expd@ppst at a}%
+ \expandafter\endgroup\bxtb at l@tmpa}
+\newcommand*\bxWithArgsFullExpd{%
+ \bxtb at with@args at fexpd@a\@nil}
+\def\bxtb at with@args at fexpd@a\@nil#1\do{%
+ \bxtb at with@args at fexpd@b#1{}{}{}{}{}{}{}{}{}\do}
+\def\bxtb at with@args at fexpd@b#1#2#3#4#5#6#7#8#9{%
+ \edef\bxtb at with@args at fexpd@d{%
+ \noexpand\bxtb at with@args at expd@ppst at a
+ {{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}}%
+ \bxtb at with@args at fexpd@c}
+\def\bxtb at with@args at fexpd@c#1\do#{%
+ \bxtb at with@args at fexpd@d}
+\def\bxtb at with@args at expd@ppst at a#1{%
+ \def\bxtb at with@args at expd@do{\bxtb at do#1}%
+ \afterassignment\bxtb at with@args at expd@do
+ \def\bxtb at do##1##2##3##4##5##6##7##8##9}
+
+%%<+> \bxAssign <assignment>\relax
+% Do an assignment and checks if the assignment statement is
+% free of garbage and returns the result to \ifbxOk.
+\newcommand*\bxAssign{%
+ \bxOkfalse\afterassignment\bx at b@assign at a}
+\def\bx at b@assign at a#1\relax{%
+ \def\bx at tmpa{#1}\ifx\bx at tmpa\@empty\bxOktrue\fi}
+
+%%<+> \bxChompComma\CS
+\newcommand*\bxChompComma[1]{%
+ \expandafter\bxtb at chomp@comma at a#1\bxtb at chomp@comma at end#1}
+\def\bxtb at chomp@comma at a{%
+ \futurelet\bxtb at tmpa\bxtb at chomp@comma at b}
+\def\bxtb at chomp@comma at b{%
+ \bxIfx{,\bxtb at tmpa}{\bxtb at chomp@comma at c}%
+ {\bxtb at chomp@comma at skip}}
+\def\bxtb at chomp@comma at c#1\bxtb at chomp@comma at end#2{%
+ \expandafter\def\expandafter#2\expandafter{\@gobble#1}}
+\def\bxtb at chomp@comma at skip#1\bxtb at chomp@comma at end#2{}
+
+%% \bxProcessOptions[*]
+\newcommand*\bxProcessOptions{%
+ \@ifstar{\@tempswatrue\bxtb at process@options}%
+ {\@tempswafalse\bxtb at process@options}}
+\def\bxtb at process@options{%
+ \let\bxtb at org@@removeelement\@removeelement
+ \let\@removeelement\bxtb@@removeelement
+ \if at tempswa \ProcessOptions*%
+ \else \ProcessOptions\relax \fi
+ \let\@removeelement\bxtb at org@@removeelement}
+\def\bxtb@@removeelement#1#2#3{%
+ \bxtb at rem@elt at check#1\relax{}\bxtb at rem@elt at end
+ \if at tempswa \bxtb at org@@removeelement{#1}{#2}#3\fi}
+\def\bxtb at rem@elt at check#1#{\bxtb at rem@elt at check@a}
+\def\bxtb at rem@elt at check@a#1#2\bxtb at rem@elt at end{%
+ \ifstrempty{#2}{\@tempswatrue}{\@tempswafalse}}
+
+%--------------------------------------- character tokens
+
+%%<+> \ifbxHasUcsChar
+\newbool{bxHasUcsChar}
+\ifbxinOmega \bxHasUcsChartrue \fi
+\ifbxinXeTeX \bxHasUcsChartrue \fi
+\ifbxinLuaTeX \bxHasUcsChartrue \fi
+\ifbxinupTeX \bxHasUcsChartrue \fi
+\csletcs{ifbx at hx@bigchar}{ifbxHasUcsChar}
+
+%%<+> \ifbxHasAlUcsChar
+\newbool{bxHasAlUcsChar}
+\ifbxinOmega \bxHasAlUcsChartrue \fi
+\ifbxinXeTeX \bxHasAlUcsChartrue \fi
+\ifbxinLuaTeX \bxHasAlUcsChartrue \fi
+
+%%<+> \bxToChar{<num>}
+% Makes \bxRes expand to a single character token with character
+% code <num>. Note that in (u)pTeX this is valid only for 'alphabet'
+% characters.
+\newcommand*\bxToChar[1]{%
+ \bgroup \lccode`!=#1\relax
+ \lowercase{\xdef\bx at tch@g at temp{!}}%
+ \egroup \let\bxRes\bx at tch@g at temp}
+
+%%<+> \bxToJaChar{<num>}
+% Makes \bxRes expand to a single CJK character token with
+% character code <num> (in internal CJK encoding).
+\ifbxinpTeX
+ \newcommand*\bxToJaChar[1]{%
+ \bgroup \bxtb at forcecjktoken
+ \kansujichar\@ne=#1\relax
+ \xdef\bx at tch@g at temp{\kansuji\@ne}%
+ \egroup \let\bxRes\bx at tch@g at temp}
+ \ifdef{\forcecjktoken}%
+ {\let\bxtb at forcecjktoken\forcecjktoken}%
+ {\let\bxtb at forcecjktoken\relax}%
+\fi
+
+%%<+> \bxToUcsChar{<num>}
+% Makes \bxRes expand to a single character token with
+% character code <num> (in Unicode); valid for Unicode-aware
+% engines plus upTeX.
+\ifbxinupTeX
+\let\bxToUcsChar\bxToJaChar
+\else\ifbxHasAlUcsChar
+\let\bxToUcsChar\bxToChar
+\fi\fi
+
+%%<+> \bxToUcsCharDual{<jis>}{<ucs>}
+% Makes \bxRes expand to a single character token with the following
+% character code: (1) on pTeX, <jis> in internal CJK encoding; and
+% (2) on Unicode-aware engines, <ucs> in Unicode.
+\ifdef{\bxToUcsChar}
+ {\newcommand*\bxToUcsCharDual[2]{\bxToUcsChar{#2}}}%
+ {\newcommand*\bxToUcsCharDual[2]{\bxToJaChar{\jis#1}}}
+
+%%<+> \bxToUcsCharSeq{<jis>:<ucs>,...}
+\newcommand*\bxToUcsCharSeq[1]{%
+ \let\bx at tch@temp\@empty
+ \bxForEachIn#1\do{\bxtb at toucs@charseq at a##1\bxtb at end}%
+ \let\bxRes\bx at tch@temp}
+\def\bxtb at toucs@charseq at a#1:#2\bxtb at end{%
+ \bxToUcsCharDual{"#1}{"#2}%
+ \eappto\bx at tch@temp{\bxRes}}
+
+%--------------------------------------- number to hex-string
+% All public commands put their result in \bxHex.
+
+%%<+> \bxToHexTiny
+% For one-to-two-digit hex strings.
+\newcommand*\bxToHexTiny[1]{%
+ \chardef\bxHex=#1\relax
+ \expandafter\bx at hx@tohextiny at a\meaning\bxHex\@nil}
+\def\bx at hx@tohextiny at a#1"#2\@nil{\def\bxHex{#2}}
+
+%%<+> \bxToHexSmall
+% For one-to-three-digit hex strings.
+\newcommand*\bxToHexSmall[1]{%
+ \mathchardef\bxHex=#1\relax
+ \expandafter\bx at hx@tohexsmall at a\meaning\bxHex\@nil}
+\def\bx at hx@tohexsmall at a#1"#2\@nil{\def\bxHex{#2}}
+
+%%<+> \bxToHexTwo
+% For zero-padded two-digit hex strings.
+\newcommand*\bxToHexTwo[1]{%
+ \chardef\bxHex=#1\relax
+ \expandafter\bx at hx@tohextwo at a\meaning\bxHex"0\@nil}
+\def\bx at hx@tohextwo at a#1"#2#3#4#5\@nil{\bx at hx@tohextwo at b#2#3#4\@nil}
+\def\bx at hx@tohextwo at b#1"#2\@nil{\def\bxHex{#2#1}}
+
+%%<+> \bxToHexThree
+% For zero-padded three-digit hex strings.
+\newcommand*\bxToHexThree[1]{%
+ \mathchardef\bxHex=#1\relax
+ \expandafter\bx at hx@tohexthree at a\meaning\bxHex"00\@nil}
+\def\bx at hx@tohexthree at a#1"#2#3#4#5#6\@nil{\bx at hx@tohexthree at b#2#3#4#5\@nil}
+\def\bx at hx@tohexthree at b#1"#2\@nil{\def\bxHex{#2#1}}
+
+%%<+> \bxToHexFour
+% For zero-padded four-digit hex strings.
+\ifbx at hx@bigchar %----<*bigchar>
+\newcommand*\bxToHexFour[1]{%
+ \chardef\bxHex=#1\relax
+ \expandafter\bx at hx@tohexfour at a\meaning\bxHex"000\@nil}
+\def\bx at hx@tohexfour at a#1"#2#3#4#5#6#7\@nil{\bx at hx@tohexfour at b#2#3#4#5#6\@nil}
+\def\bx at hx@tohexfour at b#1"#2\@nil{\def\bxHex{#2#1}}
+\else %----<*!bigchar>
+\mathchardef\bx at hx@fzzz="4000
+\newcommand*\bxToHexFour[1]{\bgroup
+ \@tempcnta=#1\relax\@tempcntb\@tempcnta\divide\@tempcntb\bx at hx@fzzz
+ \ifcase\@tempcntb \advance\@tempcnta\bx at hx@fzzz \or \or
+ \advance\@tempcnta-\bx at hx@fzzz \or \advance\@tempcnta-"8000 \or
+ \@tempcnta\z@ \fi
+ \mathchardef\bx at hx@tmp\@tempcnta
+ \expandafter\bx at hx@tohexfour at a\meaning\bx at hx@tmp\@nil
+ \egroup \let\bxHex\bx at hx@gtmp}
+\def\bx at hx@tohexfour at a#1"#2#3\@nil{%
+ \expandafter\let\expandafter\bx at hx@tmp
+ \csname bxhx at X/\the\@tempcntb#2\endcsname
+ \ifx\bx at hx@tmp\relax \bxtb at err@oorng \global\let\bx at hx@gtmp\@empty
+ \else \xdef\bx at hx@gtmp{\bx at hx@tmp#3}\fi}
+\def\bx at hx@nxt#1#2#3{\bgroup\catcode`#3=12
+ \global\expandafter\def\csname bxhx at X/#1#2\endcsname{#3}\egroup}
+\@for\bx at hx@tmp:={040,051,062,073,144,155,166,177,248,259,26A,27B,%
+ 34C,35D,36E,37F}\do{\expandafter\bx at hx@nxt\bx at hx@tmp}
+\fi %----</bigchar>
+
+%%<+> \bxToHexFive
+%%<+> \bxToHexFiveX
+% For zero-padded five-digit hex strings.
+\newcommand*\bxToHexFive{\bx at tohexfive@aa\relax}
+\newcommand*\bxToHexFiveX{\bx at tohexfive@aa
+ {\ifnum\@tempcnta>\bx at hx@vdmax \@tempcnta=\bx at hx@vdmax\fi}}
+\ifbx at hx@bigchar %----<*bigchar>
+\chardef\bx at hx@vdmax="FFFFF
+\def\bx at tohexfive@aa#1#2{%
+ {\@tempcnta=#2\relax#1\global\chardef\bx at hx@gtmp=\@tempcnta}%
+ \expandafter\bx at hx@tohexfivex at a\meaning\bx at hx@gtmp"0000\@nil}
+\def\bx at hx@tohexfivex at a#1"#2#3#4#5#6#7#8\@nil{%
+ \bx at hx@tohexfivex at b#2#3#4#5#6#7\@nil}
+\def\bx at hx@tohexfivex at b#1"#2\@nil{\edef\bxHex{#2#1}}
+\else %----<*!bigchar>
+\edef\bx at hx@vdmax{"FFFFF\space}
+\def\bx at tohexfive@aa#1#2{%
+ \bgroup \@tempcnta=#2\relax#1%
+ \@tempcntb=\@tempcnta \divide\@tempcnta\bx at hx@m\relax
+ \bxToHexTwo\@tempcnta \let\bx at hx@tmp\bxHex
+ \multiply\@tempcnta-\bx at hx@m\advance\@tempcnta\@tempcntb\relax
+ \bxToHexThree\@tempcnta \xdef\bx at hx@gtmp{\bx at hx@tmp\bxHex}%
+ \egroup \let\bxHex\bx at hx@gtmp}
+\fi %----</bigchar>
+
+%%<+> \bxToHexEight
+% For zero-padded eight-digit hex strings.
+\newcommand*\bxToHexEight[1]{%
+ \bgroup \@tempcnta=#1\relax
+ \@tempcntb=\@tempcnta\divide\@tempcnta\p@\relax
+ \bxToHexFour\@tempcnta \let\bx at hx@tmp\bxHex
+ \multiply\@tempcnta-\p@\advance\@tempcnta\@tempcntb\relax
+ \bxToHexFour\@tempcnta \xdef\bx at hx@gtmp{\bx at hx@tmp\bxHex}%
+ \egroup \let\bxHex\bx at hx@gtmp}
+
+%%<+> \bxToHexUC
+% For zero-padded four-to-six-digit hex strings.
+\ifbx at hx@bigchar %----<*bigchar>
+\newcommand*\bxToHexUC[1]{%
+ \chardef\bxHex=#1\relax
+ \expandafter\bx at hx@tohexuc at a\meaning\bxHex"\@empty\@empty000\@nil}
+\def\bx at hx@tohexuc at a#1"#2#3#4#5#6#7#8#9\@nil{%
+ \bx at hx@tohexuc at b#2#3#4#5#6#7#8\@nil}
+\def\bx at hx@tohexuc at b#1"#2\@nil{\edef\bxHex{#2#1}}
+\else %----<*!bigchar>
+\mathchardef\bx at hx@m="1000
+\newcommand*\bxToHexUC[1]{%
+ \bgroup \@tempcnta=#1\relax
+ \@tempcntb=\@tempcnta \divide\@tempcnta\bx at hx@m\relax
+ \bxToHexSmall\@tempcnta \let\bx at hx@tmp\bxHex
+ \multiply\@tempcnta-\bx at hx@m\advance\@tempcnta\@tempcntb\relax
+ \bxToHexThree\@tempcnta \xdef\bx at hx@gtmp{\bx at hx@tmp\bxHex}%
+ \egroup \let\bxHex\bx at hx@gtmp}
+\fi %----</bigchar>
+
+%%<+> \bxToDecFour
+\newcommand*\bxToDecFour[1]{%
+ \expandafter\bx at hx@todecfour at a\number#1"000\@nil}
+\def\bx at hx@todecfour at a#1#2#3#4#5#6\@nil{\bx at hx@todecfour at b#1#2#3#4#5\@nil}
+\def\bx at hx@todecfour at b#1"#2\@nil{\def\bxHex{#2#1}}
+
+%%<+> \bxToDecFive
+\newcommand*\bxToDecFive[1]{%
+ \expandafter\bx at hx@todecfive at a\number#1"0000\@nil}
+\def\bx at hx@todecfive at a#1#2#3#4#5#6#7\@nil{\bx at hx@todecfive at b#1#2#3#4#5#6\@nil}
+\def\bx at hx@todecfive at b#1"#2\@nil{\def\bxHex{#2#1}}
+
+%--------------------------------------- case conversion
+
+%%<+> \bxToLower{<string>}
+% Sets to \bxRes <string> converted to lowercase.
+\newcommand*\bxToLower[1]{%
+ \edef\bxRes{\lowercase{\def\noexpand\bxRes{#1}}}\bxRes}
+
+%%<+> \bxToUpper{<string>}
+\newcommand*\bxToUpper[1]{%
+ \edef\bxRes{\uppercase{\def\noexpand\bxRes{#1}}}\bxRes}
+
+%--------------------------------------- document-level specials
+% Such specials must come before any typeset commands in DVI.
+
+%%<+> \bxDocumentSpecial{<text>}
+% Appends \special{<text>} to the list of 'document-level specials'.
+% A simple use of \AtBeginDvi will do in this case.
+\bxPreamble\newcommand*\bxDocumentSpecial[1]{%
+ \bxAtBeginDviX{\special{#1}}}
+
+%%%% \bxDocumentSpecialUrgent{<text>}
+% Similar to the above, but it demands that the given special be
+% placed as early as possible.
+\bxPreamble\newcommand*\bxDocumentSpecialUrgent[1]{%
+ \bx at docspec@urgent at init
+ \bx at prepend@box\bx at dsu@box{\special{#1}}}
+\def\bx at prepend@box#1#2{%
+ \global\setbox#1\vbox{\bxToYokoDir#2\unvbox#1}}
+\bxPreamble\def\bx at docspec@urgent at init{%
+ \newbox\bx at dsu@box
+ \AtBeginDocument{%
+ \ifx\AtBeginShipoutFirst\@undefined
+ \bx at prepend@box\@begindvibox{\unvbox\bx at dsu@box}%
+ \else % 'atbegshi' package is in use
+ {\toks@{\unvbox\bx at dsu@box}%
+ \toks\tw@\expandafter{\AtBegShi at HookFirst}%
+ \xdef\AtBegShi at HookFirst{\the\toks@\the\toks\tw@}}
+ \fi}%
+ \bxNullify\bx at docspec@urgent at init}
+
+%--------------------------------------- "shadow map" module
+
+%%<+> \bxUseShadowMap\CS{<map_tfm>}
+\bxPreamble\newcommand*\bxUseShadowMap[2]{%
+ \global\font#1=#2\relax}
+
+%%<+> \bxMap\CS
+\mathchardef\bx at m@cc=256
+\bxPreamble\newcommand*\bxMap[1]{%
+ \begingroup\count@\bxUcv\divide\count@\bx at m@cc
+ \chardef\bx at m@hb\count@ \multiply\count@\bx at m@cc
+ \advance\bxUcv-\count@ \setbox\z@\hbox{#1\bx at m@hb\char\bxUcv}%
+ \global\bxUcv\wd\z@ \endgroup}
+
+%--------------------------------------- module name
+
+%%<+> \bxSetModuleName{<name>}
+\newcommand*\bxSetModuleName[1]{%
+ \csxdef{bx at modname/\@currname.\@currext}{#1}}
+\let\bxtb at modname@default\bx at pkgname % name of this bundle
+
+%%<+> \bxModuleName
+\@ifpackageloaded{ifptex}{\undef\bxModuleName}{}
+\newcommand*\bxModuleName{%
+ \bxIfcsundefX{bx at modname/\@currname.\@currext}%
+ {\bxIfx{\@currname\@empty}{\bxtb at modname@default}%
+ {\@currname}}%
+ {\@nameuse{bx at modname/\@currname.\@currext}}}
+
+%%<+> \bxCurrentError / \bxCurrentWarning
+%%<+> \bxCurrentWarningNoLine / \bxCurrentInfo
+\newcommand*\bxCurrentError{\PackageError\bxModuleName}
+\newcommand*\bxCurrentWarning{\PackageWarning\bxModuleName}
+\newcommand*\bxCurrentWarningNoLine{%
+ \PackageWarningNoLine\bxModuleName}
+\newcommand*\bxCurrentInfo{\PackageInfo\bxModuleName}
+
+%--------------------------------------- keyval extension
+
+%%<+> \bxPrepareSetKeysSafe
+\bxPreamble\newcommand*\bxPrepareSetKeysSafe{%
+ \IfFileExists{xkeyval.sty}{\@tempswatrue}{\@tempswafalse}%
+ \if at tempswa
+ \RequirePackage{xkeyval}%
+ \def\bxtb at setkeys@safe##1##2{%
+ \setkeys*{##1}{##2}%
+% \bxDebug{\XKV at rm}%
+ \bxForEachIn\XKV at rm\do{\bxtb at setkeys@safe at a####1=\@nil}}%
+ \def\bxtb at setkeys@safe at a##1=##2\@nil{%
+ \bxtb at setkeys@safe at b{##1}}%
+ \else
+ \RequirePackage{keyval}%
+ \def\bxtb at setkeys@safe##1##2{%
+ \let\bxtb at KV@errx\KV at errx
+ \let\KV at errx\bxtb at setkeys@safe at a
+ \setkeys{##1}{##2}%
+ \let\KV at errx\bxtb at KV@errx}%
+ \def\bxtb at setkeys@safe at a##1{%
+ \expandafter\bxtb at setkeys@safe at b\expandafter{\@tempa}}%
+ \fi
+ \let\bxPrepareSetKeysSafe\relax}
+
+%%<+> \bxSetKeysSafe
+\newcommand*\bxSetKeysSafe[2]{%
+ \let\bxRestKeys\@empty
+ \bxtb at setkeys@safe{#1}{#2}%
+ \edef\bxRestKeys{\expandafter\@gobble\bxRestKeys\@empty}}
+\def\bxtb at setkeys@safe at b#1{%
+ \edef\bxRestKeys{\bxRestKeys,#1}}
+\def\bxtb at setkeys@safe#1#2{\bxCurrentError
+ {\string\bxSetKeysSafe\space not enabled}\@ehc}
+
+%--------------------------------------- driver handling
+
+%%<+> \bxDriverList
+\providecommand*\bxDriverList{dvips,dvipdfmx,dviout}
+
+%%<+> \bxDriverInherent
+\newcommand*\bxDriverInherent{}
+\bxIfinXeTeX{\def\bxDriverInherent{xetex}}{}
+\bxIfPdfOutput{\def\bxDriverInherent{pdftex}}{}
+
+%%<+> \bxDriver
+\newcommand*\bxDriver{%
+ \bxIfx{\bxDriverInherent\@empty}%
+ {\bxIfcsundefX{bx at driver/\@currname.\@currext}{default}%
+ {\@nameuse{bx at driver/\@currname.\@currext}}}%
+ {\bxDriverInherent}}
+
+%%<+> \bxSetDriver[<file>]{<driver>}
+\newcommand*\bxSetDriver{%
+ \@ifnextchar[%
+ {\bxtb at set@driver at a}{\bxtb at set@driver at a[\@currname.\@currext]}}
+\def\bxtb at set@driver at a[#1]#2{%
+ \bxIfx{\bxDriverInherent\@empty}{}{\bx at warn@ivdrv{#2}}%
+% \bxDebug{set driver for #1 to #2}%
+ \csxdef{bx at driver/#1}{#2}}
+\def\bx at warn@ivdrv#1{\bxCurrentWarningNoLine
+ {Driver specification '#1' ignored;\MessageBreak
+ driver is inherently set to '\bxDriverInherent'}}
+
+%%<+> \bxDriverSpecifiedFor{<file>}
+\newcommand*\bxDriverSpecifiedFor[1]{%
+ \bxCsuseX{bx at driver/#1}}
+
+%%<+> \bxDefineDDProcess{<name>}{<driver>}{<text>}
+%%<+> \bxDefineDDProcessDefault{<name>}{<text>}
+\newcommand*\bxDefineDDProcess[2]{%
+ \csdef{#1@@#2}}
+\newcommand*\bxDefineDDProcessDefault[1]{%
+ \csdef{#1@@default}}
+
+%%<+> \bxDoDDProcess{<name>}
+\bxNewrobustcmd*\bxDoDDProcess[1]{%
+ \edef\bxtb at drv{\bxDriver}%
+ \def\bxtb at do@ddproc at try{\bxtb at do@ddproc at try@a{#1}}%
+ \bxtb at do@ddproc at try\bxtb at drv
+ \bxCsuse{bxtb at do@ddproc at fb@@\bxtb at drv}%
+ \bxtb at do@ddproc at try{default}%
+ \bxtb at do@ddproc at try@end}
+\def\bxtb at do@ddproc at try@a#1#2{%
+% \bxDebug{try #1@@#2}%
+ \bxIfcsundefX{#1@@#2}{}%
+ {\csname#1@@#2\endcsname
+ \bxtb at do@ddproc at skip}}
+\def\bxtb at do@ddproc at skip#1\bxtb at do@ddproc at try@end{}
+\let\bxtb at do@ddproc at try@end\@empty
+\def\do{\noexpand\bxtb at do@ddproc at try}
+% fallback setup
+\edef\bxtb at do@ddproc at fb@@xetex{\do{dvipdfmx}}
+
+%%<+> \bxDeclareDriverOptions
+\newcommand*\bxDeclareDriverOptions{%
+ \bxForEachIn\bxDriverList\do{%
+ \DeclareOption{##1}{\bxSetDriver{##1}}}}
+
+%--------------------------------------- all done
+\endinput
+%% EOF
Property changes on: trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ext.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ja.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ja.def (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ja.def 2017-06-05 23:15:19 UTC (rev 44481)
@@ -0,0 +1,186 @@
+%%
+%% This is file 'bxtoolbox-ja.def'.
+%%
+
+%% file declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bxtoolbox-ja.def}[2017/05/29 v1.1]
+
+%% check intergrity
+\edef\bxtb at tmpa{\@currname.\@currext}\def\bxtb at tmpb{bxtoolbox-ja.def}
+\ifx\bxtb at tmpa\bxtb at tmpb\else
+ \PackageError\bxtb at pkgname{Illegal load sequence}\@eha
+\expandafter\endinput\fi\relax
+
+%% load submodule
+\providecommand*\bxRequireDefinition[1]{%
+ \def\bx@@def{def}\@onefilewithoptions{#1}[][]\bx@@def}
+\bxRequireDefinition{bxtoolbox-ext}
+
+%% code guards
+\edef\bxtb at j@restore at codes{%
+ \catcode34=\the\catcode34%
+ \catcode45=\the\catcode45%
+ \catcode46=\the\catcode46%
+ \catcode47=\the\catcode47%
+ \catcode58=\the\catcode58%
+ \catcode59=\the\catcode59%
+ \catcode63=\the\catcode63%
+ \catcode96=\the\catcode96%
+\relax}
+\catcode34=12 % <">
+\catcode45=12 % <->
+\catcode46=12 % <.>
+\catcode47=12 % </>
+\catcode58=12 % <:>
+\catcode59=12 % <;>
+\catcode63=12 % <?>
+\catcode96=12 % <`>
+\AtEndOfPackage{%
+ \bxtb at j@restore at codes
+ \undef\bxtb at j@restore at codes}
+
+%--------------------------------------- pTeX something
+
+%% switch 'bxtb at pxbase@ok'
+\newbool{bxtb at pxbase@ok}
+\ifbxinpTeX
+ \IfFileExists{pxbase.sty}{%
+ \bxtb at pxbase@oktrue
+ }{}
+\fi
+
+%%<+> \bxToYokoDir
+% Switches to horizontal(yoko) writing direction
+% when using pTeX.
+\ifbxinpTeX %----<*pTeX>
+\newcommand*\bxToYokoDir{%
+ \bxIfydir{}{\yoko}}
+\else %----<*!pTeX>
+\newcommand*\bxToYokoDir{}
+\fi %----</pTeX>
+
+%%<+> \bxAtBeginDviX
+% \AtBeginDvi that is safe to use in pTeX.
+\newcommand\bxAtBeginDviX[1]{%
+ \global\setbox\@begindvibox\vbox{%
+ \bxToYokoDir\unvbox\@begindvibox#1}}
+
+%--------------------------------------- Japanese something
+
+%%<+> \bxGetZenkakuWidth
+% Assigns 1zw to \bxResDim
+\ifbxinpTeX
+ \bxNewrobustcmd*\bxGetZenkakuWidth{%
+ \bxResDim=1zw\relax}
+\else\ifbxHasAlUcsChar
+ \bxToUcsChar{"4E00}\let\bx at jan@onekanji\bxRes
+ \bxNewrobustcmd*\bxGetZenkakuWidth{%
+ \begingroup \setbox\z@\hbox{\bx at jan@onekanji}%
+ \xdef\bx at jan@g at next{\bxResDim=\the\wd\z@\relax}%
+ \endgroup \bx at jan@g at next}
+ \AtBeginDocument{%
+ \ifdef\jsZw{%
+ \bxRenewrobustcmd*\bxGetZenkakuWidth{%
+ \bxResDim=1\jsZw}}{}%
+ \ifdef\zw{%
+ \bxRenewrobustcmd*\bxGetZenkakuWidth{%
+ \bxResDim=1\zw}}{}%
+ }
+\fi\fi
+
+%%<+> \bxIfCharToken{<token>}{<yes>}{<no>}
+% Tests if the token is a character token with catcode 11 or 12.
+\newcommand*\bxIfCharToken[1]{%
+ \bxIfcat{\relax\noexpand#1}{\@secondoftwo}%
+ {\expandafter\bxtb at ifchartok@a\meaning#1\bxtb at end}}
+\def\bxtb at ifchartok@a#1{%
+ \bxIfcsundefX{bxtb at ICTF/#1}{\bxtb at ifchartok@false}%
+ {\bxtb at ifchartok@b#1}}
+\def\bxtb at ifchartok@b#1#2#3#4#5#6{%
+ \bxIfcsundefX{bxtb at ICT/#1#2#3#4#5#6}{\bxtb at ifchartok@false}%
+ {\bxtb at ifchartok@true}}
+\def\bxtb at ifchartok@true#1\bxtb at end#2#3{#2}
+\def\bxtb at ifchartok@false#1\bxtb at end#2#3{#3}
+\def\do#1#2:{\cslet{bxtb at ICTF/#1}{t}\cslet{bxtb at ICT/#1#2}{t}}
+\do thelet:% 11
+\do thecha:% 12
+\do kanjic:% 16-19(upTeX)
+
+%--------------------------------------- kanji-encoding something
+
+%%<+> \bxInternalJaEncoding
+\let\bxInternalJaEncoding=?
+\ifbxHasAlUcsChar
+ \let\bxInternalJaEncoding=u
+\else\ifbxinpdfTeX
+ \let\bxInternalJaEncoding=b
+\else\ifbxinpTeX
+ \ifnum\jis"2121="8140 \let\bxInternalJaEncoding=s\else
+ \ifnum\jis"2121="A1A1 \let\bxInternalJaEncoding=e\else
+ \ifnum\jis"2121="3000 \let\bxInternalJaEncoding=u\fi\fi\fi
+\fi\fi\fi
+
+%%<+> \bxInputJaEncoding
+\let\bxInputJaEncoding=?
+\ifbxHasAlUcsChar
+ \let\bxInputJaEncoding=u
+\else\ifbxinpdfTeX
+ \let\bxInputJaEncoding=b
+\else\ifbxtb at pxbase@ok
+ \@@input pxbsjc.def\relax
+ \def\bxtb at tmpb#1#2\@nil{%
+ \ifnum `#1=\jis"723F \let\bxInputJaEncoding=s\else
+ \ifnum `#1=\jis"693D \let\bxInputJaEncoding=e\else
+ \ifnum `#1=\jis"7379 \let\bxInputJaEncoding=u\fi\fi\fi}
+ \expandafter\bxtb at tmpb\bxtb at tmpa\@nil
+ \ifx e\bxInputJaEncoding
+ \@@input pxbsjc1.def\relax
+ \def\bxtb at tmpb#1#2\@nil{%
+ \ifnum `#1=\jis"723F \let\bxInputJaEncoding=a\fi}
+ \expandafter\bxtb at tmpb\bxtb at tmpa\@nil
+ \fi
+\fi\fi\fi
+
+%%<+> \bxOutputJaEncoding
+\let\bxOutputJaEncoding=?
+% if input is 'auto', output should not be equal to it,
+% but I don't know what to do then.
+\let\bxOutputJaEncoding=\bxInputJaEncoding
+
+%% \bxtb at jaencname
+\def\bxtb at jaencname#1#2{%
+ \ifx u#1#2\else
+ \ifx s#1sjis\else
+ \ifx e#1euc\else
+ \ifx a#1auto\else
+ \ifx b#1byte\else
+ (unknown)\fi\fi\fi\fi\fi}
+
+%%<*> \internaljaencodingname
+\newcommand*\internaljaencodingname{}
+\edef\internaljaencodingname{%
+ \bxtb at jaencname\bxInternalJaEncoding{unicode}}
+
+%%<*> \inputjaencodingname
+\newcommand*\inputjaencodingname{}
+\edef\inputjaencodingname{%
+ \bxtb at jaencname\bxInputJaEncoding{utf8}}
+
+%%<*> \outputjaencodingname
+\newcommand*\outputjaencodingname{}
+\edef\outputjaencodingname{%
+ \bxtb at jaencname\bxOutputJaEncoding{utf8}}
+
+%%<*> \infojenc
+\newcommand*\infojenc{%
+ \typeout{%
+ Kanji encoding:
+ input=\inputjaencodingname;
+ output=\outputjaencodingname;
+ internal=\internaljaencodingname}%
+}
+
+%--------------------------------------- all done
+\endinput
+%% EOF
Property changes on: trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox-ja.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.def (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.def 2017-06-05 23:15:19 UTC (rev 44481)
@@ -0,0 +1,1078 @@
+%%
+%% This is file 'bxtoolbox.def'.
+%%
+
+%% file declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bxtoolbox.def}[2017/05/29 v1.1]
+\providecommand*\bxtb at pkgname{BXtoolbox}% bundle name
+
+%% check intergrity
+\edef\bxtb at tmpa{\@currname.\@currext}\def\bxtb at tmpb{bxtoolbox.def}
+\ifx\bxtb at tmpa\bxtb at tmpb\else
+ \PackageError\bxtb at pkgname{Illegal load sequence}\@eha
+\expandafter\endinput\fi\relax
+
+%% code guards
+\edef\bxtb at restore@codes{%
+ \catcode33=\the\catcode33%
+ \catcode34=\the\catcode34%
+ \catcode39=\the\catcode39%
+ \catcode45=\the\catcode45%
+ \catcode46=\the\catcode46%
+ \catcode47=\the\catcode47%
+ \catcode58=\the\catcode58%
+ \catcode60=\the\catcode60%
+ \catcode62=\the\catcode62%
+ \catcode63=\the\catcode63%
+ \catcode96=\the\catcode96%
+\relax}
+\catcode33=12 % <!>
+\catcode34=12 % <">
+\catcode39=12 % <'>
+\catcode45=12 % <->
+\catcode46=12 % <.>
+\catcode47=12 % </>
+\catcode58=12 % <:>
+\catcode60=12 % <<>
+\catcode62=12 % <>>
+\catcode63=12 % <?>
+\catcode96=12 % <`>
+\AtEndOfPackage{%
+ \bxtb at restore@codes
+ \let\bxtb at restore@codes\@undefined}
+
+%--------------------------------------- 0. Prologue
+
+%% variables
+\newif\ifbxOk % general-purpose switch
+\let\bxRes\relax % result container
+
+%% unique tokens
+\def\bxtb at uniq{\bxtb at uniq@}
+
+%% error messages
+\def\bxtb at error{\PackageError\bxtb at pkgname}
+\def\bxtb at warn{\PackageWarningNoLine\bxtb at pkgname}
+
+%--------------------------------------- 1. Engine-independent stuffs
+
+%% \bxtb@@bs
+\let\bxtb@@bs\@backslashchar
+
+%%<+> \bxIfcsundefX{<csname>}{<T>}{<F>}
+\newcommand*\bxIfcsundefX{}
+\let\bxIfcsundefX\@ifundefined
+
+%%<+> \bxCsuseX{<csname>}
+\newcommand*\bxCsuseX[1]{%
+ \@ifundefined{#1}{}{\csname#1\endcsname}}
+
+%% \bxtb at listmake@do
+\def\bxtb at listmake@do{\let\do\bxtb at lm@do}
+\def\bxtb at lm@do{\noexpand\do\noexpand}
+\def\bxtb at csdo#1{\expandafter\do\csname#1\endcsname}
+
+%% \bxtb at letcs\CSA{<csnameB>}
+%% \bxtb at cslet{<csnameA>}\CSB
+%% \bxtb at csletcs{<csnameA>}{<csnameB>}
+% Same as \letcs, \cslet, \csletcs in etoolbox.
+% They are defined here since subsequent stuffs use them.
+\def\bxtb at letcs#1#2{%
+ \expandafter\let\expandafter#1\csname #2\endcsname}
+\def\bxtb at cslet#1#2{%
+ \expandafter\let\csname #1\endcsname#2}
+\def\bxtb at csletcs#1#2{%
+ \expandafter\let\csname #1\expandafter\endcsname\csname #2\endcsname}
+
+%% \bxtb at ifprimitive\CS{<T>}{<F>}
+% Core of \bxIfPrimitive.
+\def\bxtb at ifprimitive#1{%
+ \edef\bxtb at tmpa{\string#1}\edef\bxtb at tmpb{\meaning#1}%
+ \ifx\bxtb at tmpa\bxtb at tmpb \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo \fi}
+
+%% \bxtb at ifstrempty{<str>}{<T>}{<F>}
+% Core of \ifstrempty.
+\def\bxtb at ifstrempty#1{%
+ \ifx\bxtb at empty@uniq#1\bxtb at empty@uniq
+ \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo \fi}
+\def\bxtb at empty@uniq{\bxtb at empty@uniq@}
+
+%%<+> \ifbxineTeX (if-token)
+%%<+> \bxIfineTeX{<T>}{<F>}
+%%<+> \ifbxinpdfTeX / \ifbxinLuaTeX / \ifbxinOmega / \ifbxinAleph
+%%<+> \ifbxinXeTeX / \ifbxinpTeX / \ifbxinupTeX / \ifbxinjTeX
+%%<+> \bxIfinpdfTeX / \bxIfinLuaTeX / \bxIfinOmega / \bxIfinAleph
+%%<+> \bxIfinXeTeX / \bxIfinpTeX / \bxIfinupTeX / \bxIfinjTeX
+%% Engine check.
+\def\bxtb at do#1#2{%
+ \bxtb at ifprimitive#2%
+ {\let\bxtb at tmpa\@firstoftwo}{\let\bxtb at tmpa\@secondoftwo}%
+ \bxtb at cslet{bxIfin#1}\bxtb at tmpa
+ \bxtb at csletcs{ifbxin#1}{if\bxtb at tmpa{true}{false}}}
+\bxtb at do{eTeX}{\eTeXversion}
+\bxtb at do{pdfTeX}{\pdftexversion}
+\bxtb at do{LuaTeX}{\luatexversion}
+\bxtb at do{Omega}{\OmegaVersion}
+\bxtb at do{Aleph}{\AlephVersion}
+\bxtb at do{XeTeX}{\XeTeXversion}
+\bxtb at do{pTeX}{\kanjiskip}
+\bxtb at do{upTeX}{\enablecjktoken}
+\bxtb at do{jTeX}{\jintercharskip}
+
+%%<+> \bxPreamble\CSX[*]\CSY
+% Prefix used for preamble-only commands.
+% \CSX can be \def, \newcommand, \DeclareRobustCommand, etc.
+\@onlypreamble\bxPreamble
+\newcommand*\bxPreamble[2]{%
+ \ifx *#2\def\bxtb at args{{#1*}}%
+ \else \def\bxtb at args{#1#2}%
+ \fi \expandafter\bxtb at preamble@a\bxtb at args}
+\@onlypreamble\bxtb at preamble@a
+\def\bxtb at preamble@a#1#2{%
+ \@onlypreamble#2#1#2}
+
+%%<+> \bxConstBool
+\newcommand*\bxConstIfToken[2]{%
+ \bxtb at cslet{if#1}{if#2}}
+
+%% \bxtb at skip@new at cmd...{<text>}
+% Gobbles a following whole macro definition sentence.
+\def\bxtb at skip@new at cmd#1#{\@gobble}
+
+%% \bxtb at name@cs\CS
+\def\bxtb at name@cs{%
+ \expandafter\bxtb at name@cs at a\string\$\@gobble\@empty\@nil}
+\def\bxtb at name@cs at a#1#2#3#4\@nil#5{%
+ \expandafter#3\string#5}
+
+%% \bxtb at let@name\CSX\CSY
+\def\bxtb at let@name#1#2{%
+ \edef#1{\bxtb at name@cs#2}}
+
+%%<+> \bxIf{<test>}{<T>}{<F>}
+%%<+> \bxIfcat{<test>}{<T>}{<F>}
+%%<+> \bxIfx{<test>}{<T>}{<F>}
+%%<+> \bxIfdim{<test>}{<T>}{<F>}
+%%<+> \bxIfnum{<test>}{<T>}{<F>}
+% Primitive if-tests rendered in LaTeX format.
+\let\bxtb at bumper\noindent % primitive other than \relax
+\bxPreamble\def\bxtb at defifmacro@noarg#1#2#3{%
+ \@gobble{\if}% if-match hack
+ \def#1{#2\expandafter\@firstoftwo
+ \else\expandafter\@secondoftwo\fi}}
+\bxPreamble\def\bxtb at defifmacro#1#2#3{%
+ \@gobble{\if}% if-match hack
+ \def#1##1{#2##1\expandafter\@firstoftwo
+ \else\expandafter\@secondoftwo\fi}}
+\bxPreamble\def\bxtb at defifmacro@val#1#2#3{%
+ \@gobble{\if}% if-match hack
+ \def#1##1{\expandafter\@gobble
+ #2##1\bxtb at bumper\expandafter\@firstoftwo
+ \else \bxtb at bumper\expandafter\@secondoftwo \fi}}
+\bxtb at defifmacro\bxIf\if\fi
+\bxtb at defifmacro\bxIfcat\ifcat\fi
+\bxtb at defifmacro\bxIfx\ifx\fi
+\bxtb at defifmacro@val\bxIfdim\ifdim\fi
+\bxtb at defifmacro@val\bxIfnum\ifnum\fi
+
+%%<+> \bxIfInMovingArg{<T>}{<F>}
+% Moving argument check. Note that it actually expands to <T> or
+% <F> prepended with some unexpandable garbles with no effect.
+% For that reason, this macro is not suitable for switching
+% implementation. Instead it is intended for error check for
+% use in moving arguments.
+\long\def\bxIfInMovingArg#1#2{%
+ \let\bxtb at ifinmovarg@a\bxtb at ifinmovarg@a\bxtb at ifinmovarg@c{#1}%
+ #2\bxtb at ifinmovarg@end}
+\def\bxtb at ifinmovarg@a#1{%
+ \bxtb at ifinmovarg@dummy\relax \bxtb at ifinmovarg@b}
+\def\bxtb at ifinmovarg@b#1#2#3\bxtb at ifinmovarg@end{#2}
+\def\bxtb at ifinmovarg@c#1#2\bxtb at ifinmovarg@end{#2}
+\let\bxtb at ifinmovarg@end\@empty
+\let\bxtb at ifinmovarg@dummy\relax
+
+%%<+> \bxMessageToken{<str>}{<text>}
+% Executes <text> where #1 is replaced by control sequence \<str>.
+% The meaning of \<str> is unchanged.
+% (In <text> # must be doubled.)
+\def\bxMessageToken#1{%
+ \begingroup
+ \xdef\bxtb at g@tmpa{\noexpand\bxtb at tmpa
+ \expandafter\noexpand\csname #1\endcsname}%
+ \endgroup
+ \afterassignment\bxtb at g@tmpa \long\def\bxtb at tmpa##1}
+
+%%<+> \bxCheckForMovingArg{<text>}
+% When in moving arguments, it raises an error in the form of
+% undefined conrol sequence; otherwise expands to <text>.
+%%<+> \bxCheckForMovingArgForTest{\SOMETEST{<arg>}}{<T>}{<F>}
+% When in moving arguments, it raises an error in the form of
+% undefined conrol sequence and expands to <F>; otherwise
+% it expands to \SOMETEST{<arg>}{<T>}{<F>}.
+\bxMessageToken{ ERROR: Use in wrong place!}{%
+ \def\bxCheckForMovingArg{\bxIfInMovingArg{#1}}%
+ \def\bxCheckForMovingArgForTest{%
+ \bxIfInMovingArg{#1\@secondoftwo}}%
+}
+
+%% \bxtb at ifnewdefok\CS{<T>}{<F>}
+%% \bxtb at ifrenewdefok\CS{<T>}{<F>}
+%% \bxtb at ifprovidedefok\CS{<T>}{<F>}
+\def\bxtb at ifnewdefok#1{%
+ \newcommand#1{\bxtb at uniq}\bxtb at ifnewdefok@a#1}
+\def\bxtb at ifrenewdefok#1{% <F> is never executed
+ \renewcommand#1{\bxtb at uniq}\let#1\@undefined \@firstoftwo}
+\def\bxtb at ifprovidedefok#1{%
+ \providecommand#1{\bxtb at uniq}\bxtb at ifnewdefok@a#1}
+\def\bxtb at ifnewdefok@a#1{%
+ \ifx#1\bxtb at ifdefok@probe
+ \let#1\@undefined \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi}
+\long\def\bxtb at ifdefok@probe{\bxtb at uniq}
+
+%% \bxtb at detokenize{<text>}
+% Resource consuming version of \detokenize ;)
+%% \bxtb at stringify{<text>}
+% Expands <text> and then detokenizes the result.
+\def\bxtb at detokenize{%
+ \romannumeral-`a\bxtb at detok@pre at a\bxtb at detok@lop at a}
+\def\bxtb at stringify{%
+ \romannumeral-`a\bxtb at detok@pre at a\bxtb at edetok@lop at a}
+\def\bxtb at detok@pre at a#1#2{%
+ \expandafter\bxtb at detok@ppst at a
+ \csname\bxtb at nonce@pfx"#1#2\bxtb at detok@enda
+ {} \bxtb at detok@endb\endcsname}
+\def\bxtb at detok@enda{\bxtb at detok@enda@}
+\def\bxtb at detok@endb{\bxtb at detok@endb@}
+\begingroup
+ \catcode`\(=12 \lccode`\(=`\{ \catcode`\)=12 \lccode`\)=`\}
+ \lowercase{\gdef\bxtb at detok@brc at a#1#2{(#1#2)}}
+\endgroup
+\def\bxtb at detok@lop at a#1 #2\bxtb at detok@endb{%
+ \bxtb at ifstrempty{#1}%
+ { \bxtb at detok@lop at a}{\bxtb at detok@lop at b#1 }%
+ #2\bxtb at detok@endb}
+\def\bxtb at detok@lop at b#1#{%
+ \bxtb at ifstrempty{#1}%
+ {\bxtb at detok@brc at a\bxtb at detok@lop at a}{\bxtb at detok@lop at c#1}}
+\def\bxtb at detok@lop at c#1{%
+ \bxIfx{#1\bxtb at detok@enda}{\bxtb at detok@pst at a}{%
+ \bxIfcat{\noexpand#1\relax}{\bxtb at format@cs#1}{\string#1}%
+ \bxtb at detok@lop at a}}
+\def\bxtb at edetok@lop at a#1 #2\bxtb at detok@endb{%
+ \bxtb at ifstrempty{#1}%
+ { \bxtb at edetok@lop at a}{\bxtb at edetok@lop at b#1 }%
+ #2\bxtb at detok@endb}
+\def\bxtb at edetok@lop at b#1#{%
+ \bxtb at ifstrempty{#1}%
+ {\bxtb at detok@brc at a\bxtb at edetok@lop at a}{\bxtb at edetok@lop at c#1}}
+\def\bxtb at edetok@lop at c#1{%
+ \bxIfx{#1\bxtb at detok@enda}{\bxtb at detok@pst at a}%
+ {\bxtb at edetok@lop at d#1}}
+\def\bxtb at edetok@lop at d#1{%
+ \bxtb at ifdefmacro#1{\expandafter\bxtb at edetok@lop at a#1}%
+ {\expandafter\bxtb at edetok@lop at e\romannumeral-`\a#1}}
+\def\bxtb at edetok@lop at e#1{%
+ \bxIfcat{\noexpand#1\relax}{\bxtb at format@cs#1}{\string#1}%
+ \bxtb at edetok@lop at a}
+\def\bxtb at detok@pst at a#1\bxtb at detok@endb{}
+\def\bxtb at detok@ppst at a#1{%
+ \expandafter\bxtb at detok@ppst at b\string#1\@nil}
+\def\bxtb at detok@ppst at b#1#2"#3\@nil{\space#3}
+
+%% \bxtb at format@cs\CS
+% Detokenizes control sequence \CS with an optional space
+% appended just in \write.
+\def\bxtb at format@cs{%
+ \expandafter\bxtb at format@cs at a\string\$%
+ \bxtb at format@cs at c\bxtb at format@cs at b\@nil}
+\def\bxtb at format@cs at a#1#2#3#4\@nil#5{%
+ \expandafter#3\string#5\@nil}
+\def\bxtb at format@cs at b{\bxtb at format@cs at c\@empty}
+\def\bxtb at format@cs at c#1#2#3\@nil{%
+ #1#2#3\ifcat_#3_\ifnum\catcode`#2=11 \space \fi\else\space\fi}
+
+%% \bxtb at return@true
+\def\bxtb at return@true#1\bxtb at esac{%
+ \fi\@firstoftwo}
+\def\bxtb at return@false#1\bxtb at esac{%
+ \fi\@secondoftwo}
+
+
+%--------------------------------------- 2. Dummy if-token definitions.
+
+%% \bxtb at make@dummy at if@setter
+\bxPreamble\def\bxtb at make@dummy at if@setter#1#2{%
+ \begingroup
+ \def\bxtb at bval{#1}%
+ \@for\bxtb at bname:=#2\do{\bxtb at make@dummy at if@setter at a}%
+ \endgroup}
+\bxPreamble\def\bxtb at make@dummy at if@setter at a{%
+ \expandafter\ifx\csname if\bxtb at bname\endcsname\relax
+ \bxtb at make@dummy at if@setter at appto\bxtb at set@dummy at ifs{%
+ \let \expandafter\noexpand\csname if\bxtb at bname\endcsname
+ \expandafter\noexpand\csname if\bxtb at bval\endcsname}%
+ \bxtb at make@dummy at if@setter at appto\bxtb at unset@dummy at ifs{%
+ \let \expandafter\noexpand\csname if\bxtb at bname\endcsname
+ \noexpand\@undefined}%
+ \fi}
+\bxPreamble\def\bxtb at make@dummy at if@setter at appto#1#2{%
+ \edef\bxtb at tmpx{#2}%
+ \expandafter\g at addto@macro\expandafter#1%
+ \expandafter{\bxtb at tmpx}}
+\let\bxtb at set@dummy at ifs\@empty
+\let\bxtb at unset@dummy at ifs\@empty
+\bxtb at make@dummy at if@setter{false}{%
+ % e-TeX if-tokens
+ fontchar,defined,csname,incsname,%
+ % pdfTeX if-tokens
+ pdfprimitive,pdfabsdim,pdfabsnum,%
+ % LuaTeX if-tokens
+ absdim,absnum,primitive,%
+ % pTeX if-tokens
+ tdir}
+\bxtb at make@dummy at if@setter{true}{%
+ % pTeX if-tokens
+ ydir}
+
+%%<+> \bxSetDummyIfs
+%%<+> \bxUnsetDummyIfs
+\newcommand*\bxSetDummyIfs{}
+\let\bxSetDummyIfs\bxtb at set@dummy at ifs
+\newcommand*\bxUnsetDummyIfs{}
+\let\bxUnsetDummyIfs\bxtb at unset@dummy at ifs
+
+%% dummy-ifs are enabled in this file
+\bxSetDummyIfs
+
+\bxPreamble\def\bxtb at defifmacro@engdep#1{%
+ \expandafter\bxtb at defifmacro@engdep at a
+ \csname bxIf#1\expandafter\endcsname
+ \csname if#1\expandafter\endcsname
+ \csname iftrue\expandafter\endcsname\csname iffalse\endcsname}
+\bxPreamble\def\bxtb at defifmacro@engdep at a#1#2#3#4{%
+ % be careful that #2,#3,#4 are \if-tokens
+ \bxtb at defifmacro@noarg#1#2\relax \chardef\bxtb at tmpa\z@
+ \ifx#2#3\chardef\bxtb at tmpa\@ne \fi
+ \ifx#2#4\chardef\bxtb at tmpa\tw@ \fi
+ \ifcase\bxtb at tmpa\relax
+ \or \let#1\@firstoftwo
+ \or \let#1\@secondoftwo
+ \fi}
+\bxPreamble\def\bxtb at make@engdep at test#1{%
+ \@for\bxtb at bname:=#1\do{%
+ \bxtb at defifmacro@engdep\bxtb at bname}}
+% this must be done in \bxSetDummyIfs effective
+\bxtb at make@engdep at test{%
+ ydir,tdir%
+}
+
+%--------------------------------------- 3. Macrodef prefix operations
+
+%% \bxtb at all@prefix
+\def\bxtb at all@prefix{\do{protected}\do{long}\do{outer}}
+
+%% \bxtb at set@prefix{<name>}
+%% \bxtb at unset@prefix{<name>}
+%% \bxtb at unset@all at prefix{<name>}
+\def\bxtb at set@prefix#1{\bxtb at cslet{bxtb at PFX/#1}{T}}
+\def\bxtb at unset@prefix#1{\bxtb at cslet{bxtb at PFX/#1}{F}}
+\def\do{\noexpand\bxtb at unset@prefix}
+\edef\bxtb at unset@all at prefix{\bxtb at all@prefix}
+
+%% \bxtb at clear@prefix
+\def\bxtb at clear@prefix{%
+ \def\bxtb at savepfx@dummy{}\let\bxtb at savepfx@dummy\relax}
+
+%% \bxtb at render@prefix
+\def\do{\noexpand\bxtb at render@prefix at a}
+\edef\bxtb at render@prefix{\bxtb at all@prefix}
+\def\bxtb at render@prefix at a#1{%
+ \bxIf{\csname bxtb at PFX/#1\endcsname T}{\csname #1\endcsname}{}}
+
+%% \bxtb at save@prefix
+\def\bxtb at save@prefix{%
+ \def\bxtb at savepfx@dummy{}% prefixes applied to this definition
+ \bxtb at unset@all at prefix
+ \begingroup \escapechar`\\
+ \expandafter\bxtb at savepfx@prs at a\meaning\bxtb at savepfx@dummy\@nil
+ %\endgroup already done
+}
+
+%% some internal stuffs
+\begingroup \escapechar\m at ne
+\xdef\bxtb at g@args{{\string\macro:}{\space}{\string\\}}
+\endgroup
+\def\bxtb at do#1#2#3{%
+ \def\bxtb at savepfx@prs at a##1#1##2\@nil{%
+ \endgroup
+ \let\bxtb at savepfx@dummy\relax
+ \bxIfcat{_##1_}{}{\bxtb at savepfx@prs at b##1\@nil}}
+ \def\bxtb at savepfx@prs at b##1##2#2##3\@nil{%
+ \bxtb at savepfx@prs at c##2#3#3}
+ \def\bxtb at savepfx@prs at c##1#3{%
+ \bxIfcat{_##1_}{}%
+ {\bxtb at set@prefix{##1}\bxtb at savepfx@prs at c}}
+ \def\bxtb at ifdefmacro##1{%
+ \expandafter\bxtb at ifdefmacro@a\meaning##1#1\@nil}
+ \def\bxtb at ifdefmacro@a##1#1##2\@nil##3##4{%
+ \bxIfcat{_##2_}{##4}{##3}}
+}
+\expandafter\bxtb at do\bxtb at g@args
+
+%--------------------------------------- 4. pdfTeX primitives
+
+%%<+> \ifbxPrimitive
+% The primitive equivalent to pdfTeX's \ifpdfprimitive; if the
+% primitive is not available, this is \let'd to \iffalse.
+%%<+> \bxIfHasIfPrimitive{<T>}{<F>}
+% Whether \ifbxPrimitive has a valid definition.
+\bxtb at cslet{ifbxPrimitive}\@undefined
+\expandafter\bxtb at ifprimitive\csname ifpdfprimitive\endcsname{%then
+ \let\bxIfHasIfPrimitive\@firstoftwo
+ \bxtb at csletcs{ifbxPrimitive}{ifpdfprimitive}%
+}{%else
+ \expandafter\bxtb at ifprimitive\csname ifprimitive\endcsname{%then
+ \let\bxIfHasIfPrimitive\@firstoftwo
+ \bxtb at csletcs{ifbxPrimitive}{ifprimitive}%
+ }{%else
+ \let\bxIfHasIfPrimitive\@secondoftwo
+ \bxtb at csletcs{ifbxPrimitive}{iffalse}%
+}}
+
+%%<+> \bxPrimitive
+% The primitive equivalent to pdfTeX's \pdfprimitive; if the
+% primitive is not available, this is defined to be empty.
+\bxtb at ifprimitive\pdfprimitive{%then
+ \let\bxPrimitive\pdfprimitive
+}{%else
+ \bxtb at ifprimitive\primitive{%then
+ \let\bxPrimitive\primitive
+ }{%else
+ \let\bxPrimitive\@empty
+}}
+
+%%<+> \bxStrcmp
+% The primitive equivalent to pdfTeX's \pdfstrcmp; if the
+% primitive is not available, this is left undefined.
+\let\bxStrcmp\@undefined
+\bxtb at ifprimitive\pdfstrcmp{%then
+ \let\bxStrcmp\pdfstrcmp
+}{%else
+ \bxtb at ifprimitive\strcmp{%then
+ \let\bxStrcmp\strcmp
+ }{%else
+}}
+\ifbxinLuaTeX %----<*LuaTeX>
+ \ifdefined\luatexluaescapestring
+ \unless\ifdefined\bxStrcmp
+ \directlua0{%
+ function bxtoolbox_strcmp(A, B)
+ if A == B then tex.write("0")
+ elseif A < B then tex.write("-1")
+ else tex.write("1")
+ end
+ end
+ }
+ \long\def\bxStrcmp#1#2{\directlua0{%
+ bxtoolbox_strcmp("\luatexluaescapestring{#1}",
+ "\luatexluaescapestring{#2}")
+ }}
+ \fi
+ \fi
+\fi %----</LuaTeX>
+
+%--------------------------------------- 5. non etoolbox stuffs
+
+%%<+> \bxRobustdef\CS
+%%<+> \bxRobustgdef\CS
+%%<+> \bxRobustedef\CS
+%%<+> \bxRobustxdef\CS
+\ifbxineTeX %<*etex>
+\def\bxRobustdef{\protected\def}
+\def\bxRobustgdef{\protected\gdef}
+\def\bxRobustedef{\protected\edef}
+\def\bxRobustxdef{\protected\xdef}
+\else %<*!etex>
+\def\bxRobustdef{\bxtb at robustdef\def}
+\def\bxRobustgdef{\bxtb at robustdef\gdef}
+\def\bxRobustedef{\bxtb at robustdef\edef}
+\def\bxRobustxdef{\bxtb at robustdef\xdef}
+\def\bxtb at robustdef#1#2{%
+ \bxtb at save@prefix
+ \let#2\@undefined \DeclareRobustCommand*#2{}%
+ \bxtb at let@name\bxtb at tmpb#2%
+ \bxtb at render@prefix
+ \expandafter#1\csname \bxtb at tmpb\space \endcsname}
+\fi %</etex>
+
+%% \bxtb at robustlet\CSA\CSB
+\ifbxineTeX %<*etex>
+\def\bxtb at robustlet#1#2{%
+ \protected\def#1{#2}}
+\else %<*!etex>
+\def\bxtb at robustlet#1{%
+ \expandafter\bxtb at robustlet@a
+ \csname\bxtb at name@cs#1\space\endcsname#1}
+\def\bxtb at robustlet@a#1#2#3{%
+ \DeclareRobustCommand*#2{}\let#1#3}
+\fi
+
+%%<+> \bxIfPdfOutput{<T>}{<F>}
+%%<+> \bxIfPdfOutputNow{<T>}{<F>}
+\newcommand*\bxIfPdfOutputNow{%
+ \ifx\pdfoutput\@undefined \bxtb at return@false \fi
+ \ifx\pdfoutput\relax \bxtb at return@false \fi
+ \ifnum\pdfoutput>\z@ \bxtb at return@true
+ \else \bxtb at return@false \fi
+ \bxtb at esac}
+\newcommand*\bxIfPdfOutput{}
+\bxIfPdfOutputNow
+{\let\bxIfPdfOutput\@firstoftwo
+ \bxtb at letcs\ifbxPdfOutput{iftrue}}%
+{\let\bxIfPdfOutput\@secondoftwo
+ \bxtb at letcs\ifbxPdfOutput{iffalse}}%
+
+%%<+> \bxIfPrimitive\CS
+%%<+> \bxCSIfPrimitive{<csname>}
+\newcommand*\bxIfPrimitive{}
+\bxtb at robustlet\bxIfPrimitive\bxtb at ifprimitive
+\def\bxtb at ifcsprimitive@a#1{%
+ \expandafter\bxIfPrimitive\csname #1\endcsname}
+\ifbxineTeX %<*etex>
+\def\bxIfCsPrimitive#1{%
+ \unless\ifcsname#1\endcsname \let\bxtb at tmpx\@secondoftwo
+ \else \def\bxtb at tmpx{\bxtb at ifcsprimitive@a{#1}}%
+ \fi \bxtb at tmpx}
+\else %<*!etex>
+\def\bxIfCsPrimitive#1{%
+ \begingroup\expandafter\endgroup
+ \expandafter\ifx\csname #1\endcsname\@undefined
+ \let\bxtb at tmpx\@secondoftwo
+ \else \def\bxtb at tmpx{\bxtb at ifcsprimitive@a{#1}}%
+ \fi \bxtb at tmpx}
+\fi %</etex>
+% use \ifbxPrimitive if available
+\bxIfHasIfPrimitive{%
+\bxtb at defifmacro\bxIfPrimitive\ifbxPrimitive\fi
+}{}
+
+%%<+> \bxIfPrimitiveX\CS
+%% TODO: for e-TeX, TeX
+% use \ifpdfprimitive if available
+\bxIfHasIfPrimitive\@tempswatrue\@tempswafalse
+\if at tempswa %----
+\let\bxIfPrimitiveX\bxIfPrimitive
+\else %----
+\def\bxIfPrimitiveX#1{%
+ \bxIfcat{\noexpand#1\relax}%
+ {\bxtb at ifdefmacro#1{\@secondoftwo}{\bxtb at ifprimitive@x at a#1}}%
+ {\@secondoftwo}}
+\def\bxtb at ifprimitive@x at a#1{%
+ \expandafter\bxtb at ifprimitive@x at b\meaning#1\bxtb at cmp@endb#1}
+\def\bxtb at ifprimitive@x at b#1\bxtb at cmp@endb#2{%
+ \expandafter\bxtb at ifprimitive@x at c\string#1\@bxtb at cmp@enda
+ #2\bxtb at cmp@endb}
+\def\bxtb at do#1{%
+ \def\bxtb at ifprimitive@x at b##1\bxtb at cmp@endb##2{%
+ \expandafter\bxtb at ifprimitive@x at c\string##1\@bxtb at cmp@enda
+ ##2\bxtb at cmp@endb#1\@nil}}
+\def\bxtb at ifprimitive@x at c#1 #2\@nil{%
+ \bxtb at ifstrempty{#2}{\bxtb at ifeq@pstr#1}%
+ {\@secondoftwo}}
+\fi %----
+
+%%<+> \bxIfExpToEqual{<text1>}{<text2>}{<T>}{<F>}
+\newcommand*\bxIfExpToEqual{}
+\bxRobustdef\bxIfExpToEqual#1#2{%
+ \bxCheckForMovingArgForTest{%
+ \bxtb at edef@detokenized\bxtb at tmpx{#1}%
+ \bxtb at edef@detokenized\bxtb at tmpy{#2}%
+ \bxIfx{\bxtb at tmpx\bxtb at tmpy}}}
+% use \bxStrcmp if available
+\ifx\bxStrcmp\@undefined\else
+\def\bxIfExpToEqual#1#2{%
+ \bxIfnum{\bxStrcmp{#1}{#2}=\z@}}
+\fi
+
+%%<+> \bxIfExpToEqualX{<text1>}{<text2>}{<T>}{<F>}
+\def\bxIfExpToEqualX#1#2{%
+ \bxtb at ifeq@text#1\bxtb at cmp@enda#2\bxtb at cmp@endb}
+% use \bxStrcmp if available
+\ifx\bxStrcmp\@undefined\else
+\let\bxIfExpToEqualX\bxIfExpToEqual
+\fi
+
+%% \bxtb at ifstrequal@pdftex{<str1>}{<str2>}{<T>}{<F>}
+% a version of \ifstrequal using \bxStrcmp
+\ifx\bxStrcmp\@undefined\else
+\def\bxtb at ifstrequal@pdftex#1#2{%
+ \bxIfnum{\bxStrcmp{\detokenize{#1}}{\detokenize{#2}}=\z@}}
+\AtEndOfPackage{% override the definition in etoolbox
+ \let\bxIfstrequal\bxtb at ifstrequal@pdftex}
+\fi
+
+%% \bxIfstrequalX{<str1>}{<str2>}{<T>}{<F>}
+\newcommand*\bxIfstrequalX{}
+\def\bxIfstrequalX#1#2{%
+ \bxtb at ifeq@str#1\bxtb at cmp@enda#2\bxtb at cmp@endb}
+% use \bxStrcmp if available
+\ifx\bxStrcmp\@undefined\else
+\let\bxIfstrequalX\bxtb at ifstrequal@pdftex
+\fi
+
+%% \bxtb at nonce@pfx
+\def\bxtb at nonce@pfx{bxtb@?@\string\$}
+
+%%<+> \bxDetokenize{<text>}
+\bxIfineTeX
+{\let\bxDetokenize\detokenize}
+{\let\bxDetokenize\bxtb at detokenize}
+%%<+> \bxStringify{<text>}
+\let\bxStringify\bxtb at stringify
+
+%% \bxtb at def@detokenized\CS{<text>}
+%% \bxtb at edef@detokenized\CS{<text>}
+\ifbxineTeX %<*etex>
+\def\bxtb at def@detokenized#1#2{%
+ \edef#1{\detokenize{#2}}}
+\def\bxtb at edef@detokenized#1#2{%
+ \edef\bxtb at args{\noexpand#1{#2}}%
+ \expandafter\bxtb at def@detokenized\bxtb at args}
+\else %<*!etex>
+\def\bxtb at def@detokenized{\bxtb at defdetok@a\def}
+\def\bxtb at edef@detokenized{\bxtb at defdetok@a\edef}
+\def\bxtb at defdetok@a#1#2#3{%
+ #1\bxtb at tmpa{#3}%
+ \expandafter\bxtb at defdetok@b\meaning\bxtb at tmpa\@nil#2}
+\def\bxtb at defdetok@b#1>#2\@nil#3{\def#3{#2}}
+\fi %</etex>
+
+%% \bxtb at ifeq@text
+\def\bxtb at ifeq@text#1\bxtb at cmp@enda#2\bxtb at cmp@endb{%
+ \expandafter\expandafter\expandafter\bxtb at ifeqtx@a
+ \bxtb at stringify@ss{#2}\bxtb at cmp@endb#1\bxtb at cmp@enda}
+\def\bxtb at ifeqtx@a#1\bxtb at cmp@endb#2\bxtb at cmp@enda{%
+ \expandafter\expandafter\expandafter\bxtb at ifeq@pstr
+ \bxtb at stringify@ss{#2}\bxtb at cmp@enda#1\bxtb at cmp@endb}
+
+%% \bxtb at ifeq@str#1#2
+\def\bxtb at ifeq@str#1\bxtb at cmp@enda#2\bxtb at cmp@endb{%
+ \expandafter\expandafter\expandafter\bxtb at ifeqstr@a
+ \bxtb at detokenize@ss{#2}\bxtb at cmp@endb#1\bxtb at cmp@enda}
+\def\bxtb at ifeqstr@a#1\bxtb at cmp@endb#2\bxtb at cmp@enda{%
+ \expandafter\expandafter\expandafter\bxtb at ifeq@pstr
+ \bxtb at detokenize@ss{#2}\bxtb at cmp@enda#1\bxtb at cmp@endb}
+
+%% \bxtb at ifeq@pstr
+\def\bxtb at ifeq@pstr#1\bxtb at cmp@enda#2\bxtb at cmp@endb{%
+ \bxtb at ifstrempty{#1}%
+ {\bxtb at ifstrempty{#2}}%
+ {\bxtb at ifstrempty{#2}{\@secondoftwo}%
+ {\bxtb at ifeqps@a#1\bxtb at cmp@enda#2\bxtb at cmp@endb}}}
+\def\bxtb at ifeqps@a#1#2\bxtb at cmp@enda#3#4\bxtb at cmp@endb{%
+ \bxIfx{#1#3}%
+ {\bxtb at ifeq@pstr#2\bxtb at cmp@enda#4\bxtb at cmp@endb}%
+ {\@secondoftwo}}
+\def\bxtb at cmp@enda{\bxtb at cmp@enda@}
+\def\bxtb at cmp@endb{\bxtb at cmp@endb@}
+
+%% \bxtb at space@subst
+\def\bxtb at space@subst#1 #2\bxtb at ss@endb{%
+ \bxtb at ifstrempty{#2}{\bxtb at spcsub@a#1\bxtb at ss@endb}%
+ {\bxtb at space@subst#1\space#2\bxtb at ss@endb}}
+\def\bxtb at spcsub@a#1\bxtb at ss@enda#2\bxtb at ss@endb{\space#1}
+\def\bxtb at ss@enda{\bxtb at ss@enda@}
+\def\bxtb at ss@endb{\bxtb at ss@endb@}
+
+%% \bxtb at combine@ss
+\def\bxtb at combine@ss#1#2{%
+ \expandafter\expandafter\expandafter\bxtb at space@subst
+ #1{#2}\bxtb at ss@enda{} \bxtb at ss@endb}
+\def\bxtb at detokenize@ss{%
+ \romannumeral-`\a\bxtb at combine@ss\bxDetokenize}
+\def\bxtb at stringify@ss{%
+ \romannumeral-`\a\bxtb at combine@ss\bxStringify}
+
+%%<+> \bxCsNoexpand{<csname>}
+\newcommand*\bxCsNoexpand[1]{%
+ \expandafter\noexpand\csname#1\endcsname}
+
+%--------------------------------------- 6. Import from etoolbox
+
+%% \bxtb at import{\CSA \CSB ...}
+% [e-TeX] Aliases each of macros to a new name with 'bx' prefixed.
+% [non-e-TeX] Adds the prefixed name to the function check list.
+\bxPreamble\def\bxtb at import#1{%
+ \bxtb at listmake@do
+ \@tfor\bxtb at tmpa:=#1\do{\expandafter\bxtb at importcmd\bxtb at tmpa}}
+\bxPreamble\def\bxtb at importcmd#1{%
+ \begingroup
+ \expandafter\bxtb at importcmd@a\string#1\@nil
+ \endgroup}
+\bxPreamble\def\bxtb at importcmd@a#1#2#3\@nil{%
+ \@tempcnta`#2 \@tempcntb\@tempcnta
+ \ifnum 96<\@tempcntb \ifnum 123>\@tempcntb
+ \advance\@tempcntb-32 \fi\fi
+ \uccode\@tempcnta\@tempcntb
+ \uppercase{\edef\bxtb at tmpa{#2}}%
+ \expandafter\bxtb at importcmd@b\csname bx\bxtb at tmpa#3%
+ \expandafter\endcsname\csname #2#3\endcsname}
+
+%% \bxtb at provide{\CSA \CSB ...}
+% [e-TeX] Does nothing.
+% [non-e-TeX] Adds the name to the function check list.
+\bxPreamble\def\bxtb at provide#1{%
+ \bxtb at listmake@do
+ \@tfor\bxtb at tmpa:=#1\do{\expandafter\bxtb at providecmd\bxtb at tmpa}}
+
+\ifbxineTeX %<*etex>
+%% Load etoolbox.
+\RequirePackage{etoolbox}\relax
+%%
+\bxPreamble\def\bxtb at importcmd@b#1#2{\global\let#1#2}
+\bxPreamble\def\bxtb at providecmd#1{}
+
+\else %<*!etex>
+%%
+\bxPreamble\let\bxtb at provided\@empty
+\bxPreamble\def\bxtb at importcmd@b#1#2{%
+ \xdef\bxtb at provided{\bxtb at provided\do#1}}
+\bxPreamble\def\bxtb at providecmd#1{%
+ \xdef\bxtb at provided{\bxtb at provided\do#1}}
+
+\fi %</etex>
+
+\bxtb at import{%
+%%==== Here is a list of commands imported to bx* namespace.
+%% For such commands, bxtoolbox provides compatible but not equivalent
+%% commands when e-TeX extension is not available, under the same
+%% 'bx'-prefixed name.
+ \newrobustcmd \renewrobustcmd \providerobustcmd %2.1
+ \robustify %2.2
+ \csuse \csshow %3.1.1
+ \ifcsdef \ifcsundef %3.6.1
+}
+\bxtb at provide{%
+%% For the following commands, bxtoolbox provides equivalent commands
+%% for non-e-TeX environment under the same name as in etoolbox.
+ \AfterPreamble \AtEndPreamble \AfterEndPreamble %2.5
+ \AfterEndDocument
+ \csdef \csgdef \csedef \csxdef %3.1.1
+ \cslet \letcs \csletcs \undef \csundef
+ \appto \gappto \eappto \xappto %3.3.1
+ \csappto \csgappto \cseappto \csxappto
+ \preto \gpreto \epreto \xpreto %3.3.2
+ \cspreto \csgpreto \csepreto \csxpreto
+ \newbool \providebool \booltrue \boolfalse %3.5.1
+ \setbool \ifbool \notbool
+ \newtoggle \providetoggle \toggletrue \togglefalse %3.5.2
+ \settoggle \iftoggle \nottoggle
+ \ifdef \ifundef %3.6.1
+ \ifstrequal \ifstrempty %3.6.2
+}
+
+\ifbxineTeX %<*etex>
+%% When the engine is eTeX, stop reading here.
+\bxUnsetDummyIfs
+\expandafter\endinput
+\fi %</etex>
+%--------------------------------------- 7. etoolbox compatible functions
+
+%% error messages
+\def\bxtb at err@ukbool#1{\bxtb at error
+ {\bxtb@@bs if#1 undefined}\@eha}
+\def\bxtb at err@ukbval#1{\bxtb at error
+ {Invalid boolean value '#1'}\@eha}
+\def\bxtb at err@aetgl#1{\bxtb at error
+ {Toggle '#1' already defined}\@eha}
+\def\bxtb at err@uktgl#1{\bxtb at error
+ {Toggle '#1' undefined}\@eha}
+\def\bxtb at err@nomcr#1{\bxtb at error
+ {\string#1 is not a macro}\@eha}
+
+%%<+> \cslet
+%%<+> \letcs
+%%<+> \csletcs
+\bxtb at robustlet\cslet\bxtb at cslet
+\bxtb at robustlet\letcs\bxtb at letcs
+\bxtb at robustlet\csletcs\bxtb at csletcs
+
+%%<+> \bxNewrobustcmd
+%%<+> \bxRenewrobustcmd
+%%<+> \bxProviderobustcmd
+\newcommand\bxNewrobustcmd{}
+\DeclareRobustCommand*\bxNewrobustcmd{%
+ \bxtb at dclrobustcmd@a\bxtb at ifnewdefok}
+\def\bxtb at dclrobustcmd@a#1{%
+ \@ifstar{\bxtb at dclrobustcmd@b#1{*}}{\bxtb at dclrobustcmd@b#1{}}}
+\def\bxtb at dclrobustcmd@b#1#2#3{%
+ #1#3{\DeclareRobustCommand#2#3}{\bxtb at skip@new at cmd}}
+\bxNewrobustcmd*\bxRenewrobustcmd{%
+ \bxtb at dclrobustcmd@a\bxtb at ifrenewdefok}
+\bxNewrobustcmd*\bxProviderobustcmd{%
+ \bxtb at dclrobustcmd@a\bxtb at ifprovidedefok}
+
+%%<+> \bxRobustify
+\bxNewrobustcmd*\bxRobustify[1]{%
+ \ifundef{#1}{\bxtb at err@nomcr#1}
+ {\bxtb at ifdefmacro{#1}%
+ {\begingroup
+ \expandafter\bxtb at robustify@a
+ \csname\bxtb at name@cs#1\space\endcsname#1}%
+ {\bxtb at err@nomcr#1}}}
+\def\bxtb at robustify@a#1#2{%
+ \global\let\bxtb at rbf@do\@empty
+ \let\bxtb at tmpa#2\let#2\@undefined
+ \let\bxtb at tmpb#1\let#1\@undefined
+ \DeclareRobustCommand*#2{}%
+ \ifx#2\bxtb at tmpa
+ \bxtb at warn{\string#2 is already robust}%
+ \else\ifx\bxtb at tmpb\relax
+ \global\let\bxtb at rbf@tmpa#2%
+ \gdef\bxtb at rbf@do{\let#1#2\let#2\bxtb at rbf@tmpa}%
+ \else \bxtb at error{Failed to robustify \string#1}\@ehc
+ \fi\fi
+ \endgroup \bxtb at rbf@do}
+
+%%<+> \csdef
+%%<+> \csedef
+%%<+> \csgdef
+%%<+> \csxdef
+\bxNewrobustcmd*\csdef[1]{\expandafter\def\csname #1\endcsname}
+\bxNewrobustcmd*\csedef[1]{\expandafter\edef\csname #1\endcsname}
+\bxNewrobustcmd*\csgdef[1]{\expandafter\gdef\csname #1\endcsname}
+\bxNewrobustcmd*\csxdef[1]{\expandafter\xdef\csname #1\endcsname}
+
+%%<+> \undef
+%%<+> \csundef
+\bxNewrobustcmd*\undef[1]{\let#1\@undefined}
+\bxNewrobustcmd*\csundef[1]{%
+ \expandafter\let\csname #1\endcsname\@undefined}
+
+%%<+> \ifdef\CS{<T>}{<F>}
+%%<+> \ifundef\CS{<T>}{<F>}
+%%<+> \bxIfcsdef{<csname>}{<T>}{<F>}
+%%<+> \bxIfcsundef{<csname>}{<T>}{<F>}
+\newcommand*\ifdef[1]{%
+ \ifx#1\@undefined \expandafter\@secondoftwo
+ \else \expandafter\@firstoftwo
+ \fi}
+\newcommand*\ifundef[1]{%
+ \ifx#1\@undefined \expandafter\@firstoftwo
+ \else \expandafter\bxtb at ifundef@a\expandafter#1%
+ \fi}
+\def\bxtb at ifundef@a#1{%
+ \ifx#1\relax \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi}
+\newcommand*\bxIfcsdef[1]{%
+ \bxCheckForMovingArgForTest{%
+ \begingroup\expandafter\endgroup
+ \expandafter\ifx\csname #1\endcsname\@undefined
+ \expandafter\@secondoftwo
+ \else \expandafter\@firstoftwo
+ \fi}}
+\newcommand*\bxIfcsundef[1]{%
+ \bxCheckForMovingArgForTest{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi}}
+
+%%<+> \bxCsuse
+\bxNewrobustcmd*\bxCsuse[1]{%
+ \bxIfcsdef{#1}{\csname #1\endcsname}{}}
+
+%%<+> \bxCsshow
+\bxNewrobustcmd*\bxCsshow[1]{%
+ \bxIfcsdef{#1}{\expandafter\show\csname #1\endcsname}{}}
+
+%%<+> \appto
+%%<+> \gappto
+%%<+> \eappto
+%%<+> \xappto
+\bxNewrobustcmd*\appto{\bxtb at appto\@empty}
+\bxNewrobustcmd*\gappto{\bxtb at appto\global}
+\bxNewrobustcmd*\eappto{\bxtb at eappto\@empty}
+\bxNewrobustcmd*\xappto{\bxtb at eappto\global}
+\bxNewrobustcmd*\csappto[1]{\expandafter\appto\csname#1\endcsname}
+\bxNewrobustcmd*\csgappto[1]{\expandafter\gappto\csname#1\endcsname}
+\bxNewrobustcmd*\cseappto[1]{\expandafter\eappto\csname#1\endcsname}
+\bxNewrobustcmd*\csxappto[1]{\expandafter\xappto\csname#1\endcsname}
+\def\bxtb at eappto#1#2#3{%
+ \edef\bxtb at args{\noexpand#1\noexpand#2{#3}}%
+ \expandafter\bxtb at appto\bxtb at args}
+\def\bxtb at appto#1#2#3{%
+ \begingroup
+ \ifx#2\@undefined \let#2\@empty \fi
+ \toks@\expandafter{#2#3}\xdef\bxtb at g@tmpa{\the\toks@}%
+ \endgroup #1\let#2\bxtb at g@tmpa}
+
+%%<+> \preto
+%%<+> \gpreto
+%%<+> \epreto
+%%<+> \xpreto
+\bxNewrobustcmd*\preto{\bxtb at preto\@empty}
+\bxNewrobustcmd*\gpreto{\bxtb at preto\global}
+\bxNewrobustcmd*\epreto{\bxtb at epreto\@empty}
+\bxNewrobustcmd*\xpreto{\bxtb at epreto\global}
+\bxNewrobustcmd*\cspreto[1]{\expandafter\preto\csname#1\endcsname}
+\bxNewrobustcmd*\csgpreto[1]{\expandafter\gpreto\csname#1\endcsname}
+\bxNewrobustcmd*\csepreto[1]{\expandafter\epreto\csname#1\endcsname}
+\bxNewrobustcmd*\csxpreto[1]{\expandafter\xpreto\csname#1\endcsname}
+\toksdef\bxtb at toksa=2
+\def\bxtb at epreto#1#2#3{%
+ \edef\bxtb at args{\noexpand#1\noexpand#2{#3}}%
+ \expandafter\bxtb at preto\bxtb at args}
+\def\bxtb at preto#1#2#3{%
+ \begingroup
+ \ifx#2\@undefined \let#2\@empty \fi
+ \toks@\expandafter{#2}\bxtb at toksa{#3}%
+ \xdef\bxtb at g@tmpa{\the\bxtb at toksa\the\toks@}%
+ \endgroup #1\let#2\bxtb at g@tmpa}
+
+%%<+> \newbool
+%%<+> \providebool
+\bxNewrobustcmd*\newbool[1]{%
+ \expandafter\bxtb at newbool@a\csname if#1\endcsname}
+\def\bxtb at newbool@a#1{\@ifdefinable#1{\newif#1}}
+\bxNewrobustcmd*\providebool[1]{%
+ \@ifundefined{if#1}%
+ {\expandafter\newif\csname if#1\endcsname}{}}
+
+%%<+> \booltrue
+%%<+> \boolfalse
+%%<+> \setbool
+% NB: Here \bxIfcsundef cannot be used because otherwise the use
+% with \global would fail.
+\bxNewrobustcmd*\booltrue[1]{%
+ \bxIfcsundefX{if#1}{\bxtb at clear@prefix\bxtb at err@ukbool{#1}}%
+ {\csname #1true\endcsname}}
+\bxNewrobustcmd*\boolfalse[1]{%
+ \bxIfcsundefX{if#1}{\bxtb at clear@prefix\bxtb at err@ukbool{#1}}%
+ {\csname #1false\endcsname}}
+\bxNewrobustcmd*\setbool[2]{%
+ \bxIfcsundefX{if#1}{\bxtb at clear@prefix\bxtb at err@ukbool{#1}}%
+ {\bxIfcsundefX{#1#2}{\bxtb at clear@prefix\bxtb at err@ukbval{#2}}%
+ {\csname #1#2\endcsname}}}
+
+%%<+> \ifbool
+%%<+> \notbool
+\@gobble{\if\if}% if-match hack
+\newcommand*\ifbool[1]{%
+ \bxIfcsundefX{if#1}{\bxtb at err@ukbool{#1}\@gobbletwo}%
+ {\csname if#1\endcsname\expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi}}
+\newcommand*\notbool[1]{%
+ \bxIfcsundefX{if#1}{\bxtb at err@ukbool{#1}\@gobbletwo}%
+ {\csname if#1\endcsname\expandafter\@secondoftwo
+ \else \expandafter\@firstoftwo
+ \fi}}
+
+%%<+> \newtoggle
+%%<+> \providetoggle
+\bxNewrobustcmd*\newtoggle[1]{%
+ \bxIfcsdef{bxtb at TG/#1}{\bxtb at err@aetgl{#1}}%
+ {\cslet{bxtb at TG/#1}\bxtb at tgl@@false}}
+\bxNewrobustcmd*\providetoggle[1]{%
+ \bxIfcsdef{bxtb at TG/#1}{}{\cslet{bxtb at TG/#1}\bxtb at tgl@@false}}
+\let\bxtb at tgl@@true\@firstoftwo
+\let\bxtb at tgl@@false\@secondoftwo
+
+%%<+> \toggletrue
+%%<+> \togglefalse
+%%<+> \settoggle
+% NB: Here \bxIfcsdef cannot be used because otherwise the use
+% with \global would fail.
+\bxNewrobustcmd*\toggletrue[1]{%
+ \bxIfcsundefX{bxtb at TG/#1}{\bxtb at clear@prefix\bxtb at err@uktgl{#1}}%
+ {\cslet{bxtb at TG/#1}\bxtb at tgl@@true}}
+\bxNewrobustcmd*\togglefalse[1]{%
+ \bxIfcsundefX{bxtb at TG/#1}{\bxtb at clear@prefix\bxtb at err@uktgl{#1}}%
+ {\cslet{bxtb at TG/#1}\bxtb at tgl@@false}}
+\bxNewrobustcmd*\settoggle[2]{%
+ \bxIfcsundefX{bxtb at TG/#1}{\bxtb at clear@prefix\bxtb at err@uktgl{#1}}%
+ {\bxIfcsundefX{bxtb at tgl@@#2}{\bxtb at clear@prefix\bxtb at err@ukbval{#2}}%
+ {\csletcs{bxtb at TG/#1}{bxtb at tgl@@#2}}}}
+
+%%<+> \iftoggle
+%%<+> \nottoggle
+\newcommand*\iftoggle[1]{%
+ \bxIfcsundefX{bxtb at TG/#1}{\bxtb at err@uktgl{#1}\@gobbletwo}%
+ {\csname bxtb at TG/#1\endcsname}}
+\newcommand*\nottoggle[1]{%
+ \bxIfcsundefX{bxtb at TG/#1}{\bxtb at err@uktgl{#1}\@gobbletwo}%
+ {\csname bxtb at TG/#1\endcsname\@secondoftwo\@firstoftwo}}
+
+%%<+> \ifstrequal{<str1>}{<str2>}{<T>}{<F>}
+\newcommand*\ifstrequal{}
+\bxRobustdef\ifstrequal#1#2{%
+ \bxCheckForMovingArgForTest{%
+ \bxtb at def@detokenized\bxtb at tmpx{#1}%
+ \bxtb at def@detokenized\bxtb at tmpy{#2}%
+ \bxIfx{\bxtb at tmpx\bxtb at tmpy}}}
+
+%%<+> \ifstrempty{<str>}{<T>}{<F>}
+\newcommand*\ifstrempty{}
+\let\ifstrempty\bxtb at ifstrempty
+
+%% internal stuffs needed for hook commands
+\bxPreamble\def\bxtb at prepare@bdhook#1#2{%
+ \bxNewrobustcmd*#1{\gappto#2}%
+ \newcommand*#2{}}
+\def\bxtb at dispatch@bdhook#1#2{%
+ \let#1\@firstofone #2%
+ \bxRobustdef#1{\@notprerr\@gobble}\undef#2}
+
+%%<+> \AtEndPreamble
+%%<+> \AfterPreamble
+%%<+> \AfterEndPreamble
+%%<+> \AfterEndDocument
+\bxtb at prepare@bdhook\AtEndPreamble\@endpreamblehook
+\bxtb at prepare@bdhook\AfterEndPreamble\@afterendpreamblehook
+\bxtb at prepare@bdhook\AfterEndDocument\@afterenddocumenthook
+\bxNewrobustcmd*\AfterPreamble{\AtBeginDocument}
+\AtEndPreamble{\let\AfterPreamble\@firstofone}
+\AfterEndPreamble{\undef\bxtb at dispatch@bdhook}
+%
+\preto\document{\endgroup
+ \bxtb at dispatch@bdhook\AtEndPreamble\@endpreamblehook
+ \begingroup}
+\appto\document{%
+ \bxtb at dispatch@bdhook\AfterEndPreamble\@afterendpreamblehook
+ \ignorespaces}
+% patch to \enddocument
+\bxPreamble\def\bxtb at patch@enddocument{%
+ \expandafter\bxtb at patch@ed at a\enddocument\deadcycles\bxtb at end}
+\bxPreamble\def\bxtb at patch@ed at a#1\deadcycles#2\bxtb at end{%
+ \bxtb at ifstrempty{#2}{\bxtb at patch@ed at fail}%
+ {\def\bxtb at tmpa{#1}\bxtb at patch@ed at b#2\bxtb at end}}
+\bxPreamble\def\bxtb at patch@ed at b#1\deadcycles#2\bxtb at end{%
+ \bxtb at ifstrempty{#2}{\bxtb at patch@ed at c{#1}}%
+ {\bxtb at patch@ed at fail}}
+\bxPreamble\def\bxtb at patch@ed at c#1{%
+ \appto\bxtb at tmpa{\let\AfterEndDocument\@firstofone
+ \@afterenddocumenthook
+ \deadcycles#1}%
+ \let\bxtb at org@enddocument\enddocument
+ \let\enddocument\bxtb at tmpa}
+\bxPreamble\def\bxtb at patch@ed at fail{%
+ \bxtb at warn{\string\AfterEndDocument\space is set disabled}%
+ \bxRobustdef\AfterEndDocument##1{\bxtb at error
+ {\string\AfterEndDocument\space is now disabled}\@eha}}
+\bxtb at patch@enddocument
+
+%--------------------------------------- 8. Epilogue
+\def\do#1{%
+ \ifx#1\@undefined \bxtb at warn{\string#1 not yet implemented}\fi}
+\bxtb at provided
+\bxUnsetDummyIfs
+\endinput
+%% EOF
Property changes on: trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.sty 2017-06-05 23:15:19 UTC (rev 44481)
@@ -0,0 +1,27 @@
+%%
+%% This is file 'bxtoolbox.sty'.
+%%
+%% Copyright (c) 2017 Takayuki YATO (aka. "ZR")
+%% GitHub: https://github.com/zr-tex8r
+%% Twitter: @zr_tex8r
+%%
+%% This package is distributed under the MIT License.
+%%
+
+%% file declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bxtoolbox}[2017/05/29 v1.1 BX developers' toolbox]
+\def\bxtb at pkgname{bxtoolbox}
+
+%--------------------------------------- main
+
+%% load submodules
+\providecommand*\bxRequireDefinition[1]{%
+ \def\bx@@def{def}\@onefilewithoptions{#1}[][]\bx@@def}
+\bxRequireDefinition{bxtoolbox}
+\bxRequireDefinition{bxtoolbox-ext}
+\bxRequireDefinition{bxtoolbox-ja}
+
+%--------------------------------------- all done
+\endinput
+%% EOF
Property changes on: trunk/Master/texmf-dist/tex/latex/bxbase/bxtoolbox.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/tex/latex/bxbase/bxucs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxucs.sty 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxucs.sty 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,109 +0,0 @@
-%
-% bxucs.sty
-%
-
-%%%% package declaration
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxucs}[2008/03/28 v0.2 BX Unicode output]
-
-%%%% preparation
-\RequirePackage{bxbase}
-
-%%%% error messages
-\def\bxus at pkgname{bxucs}
-\def\bxus at error{\PackageError\bxus at pkgname}
-\def\bxus at err@inf#1{\bxus at error
- {extra characters after number}%
- {I ignore such characters}}
-\def\bxus at err@nousf{\bxus at error
- {Unicode subfont encoding not declared\MessageBreak
- for family '\f at family'}\@ehc}
-
-%%%% declare encoding 'USF'
-% There must be at least one valid font shape in USF encoding and is set
-% in \DeclareFontSubstitution properly; otherwise an error will occur at
-% the beginning of document. Here we use the value of 'error font' as
-% dummy default font of USF encoding.
-\DeclareFontEncoding{USF}{}{}
-\bgroup \escapechar\m at ne \error at fontshape
- \DeclareFontFamily{USF}{\f at family}{}
- \global\expandafter\let
- \csname USF/\f at family/\f at series/\f at shape\expandafter\endcsname
- \csname \f at encoding/\f at family/\f at series/\f at shape\endcsname
- \xdef\bx at nxt{\noexpand\DeclareFontSubstitution
- {USF}{\f at family}{\f at series}{\f at shape}}
-\egroup \bx at nxt
-
-%%%% \USFDeclareFontShape{<family>}{<list>}
-% <list> is a range list of available Unicode-row-numbers.
-\def\USFDeclareFontShape#1#2{%
- \edef\bx at nxt{\uppercase{\def\noexpand\bxus at dfs@range{#2}}}%
- \edef\bxus at dfs@fam{#1}\bx at nxt
- \ifx\bxus at dfs@range\@empty \def\bxus at dfs@range{00-FF}\fi
- \afterassignment\bxus at decl@fontshape\def\bxus at dfs@body##1}
-\def\bxus at decl@fontshape{%
- \DeclareFontFamily{USF}{\bxus at dfs@fam}{\relax}% make last arg non-empty
- {\let\bxus at do\bxus at dfs@do\bxus at hexrange\bxus at dfs@range}}
-\def\bxus at dfs@do{%
- \bxToHexTwo\@tempcnta \bxToLower\bxHex\edef\guz{\bxRes}%
- \global\expandafter\let
- \csname bxus at U/\bxus at dfs@fam/\bxRes\endcsname=t%
- \DeclareFontFamily{USF}{\bxus at dfs@fam=U\bxRes}{}%
- \bxDebug{font family \bxus at dfs@fam=U\bxRes\space loaded}%
- \edef\USFShape{%
- \noexpand\DeclareFontShape{USF}{\bxus at dfs@fam=U\bxRes}}%
- \bxus at dfs@body\bxRes}
-
-%%%% \bx at Ux@ucs
-\def\bx at Ux@ucs{% code value is given in \bxUcv
- \bxus at loadfontdef
- \ifnum\bxUcv<\p@% \p@ equals 65536
- \bxToHexFour\bxUcv \expandafter\bxus at uxh@a\bxHex\@nil
- \else \expandafter\bx at UI \fi}
-
-%%%% \bx at Uxh@ucs
-\def\bx at Uxh@ucs#1{%
- \bxus at loadfontdef\edef\bxHex{#1}%
- \expandafter\bxus at uxh@a\bxHex\@nil}
-\def\bxus at uxh@a#1#2#3#4\@nil{%
- \bxDebug{char "\bxHex}%
- \lowercase{\bxus at uxh@b{#1#2}}{#3#4}}
-\def\bxus at uxh@b#1#2{%
- \bgroup
- \expandafter\ifx\csname bxus at U/\f at family/#1\endcsname\relax\else
- \fontencoding{USF}\fontfamily{\f at family=U#1}\selectfont
- \@tempcnta="#2\relax\bxus at chkchr
- \ifbxOk \char\@tempcnta \aftergroup\@gobble \fi
- \fi
- \egroup \bxus at uxh@x} % this \bxus at uxh@x may be gobbled
-\def\bxus at uxh@x{%
- \bxDebug{fallback}\bx at UIh\bxHex}
-
-%%%% \bxus at chkchr
-\def\bxus at chkchr{%
- \iffontchar\font\@tempcnta \bxOktrue \else \bxOkfalse \fi}
-\ifnum\bxEngineTypeY=\z@
-\def\bxus at chkchr{\bxOktrue}
-\fi
-
-%%%% \bxus at loadfontdef
-\def\bxus at loadfontdef{%
- \expandafter\ifx\csname USF+\f at family\endcsname\relax
- \begingroup \let\typeout\@font at info \escapechar\m at ne
- \def\f at encoding{USF}\try at load@fontshape
- \endgroup\fi
- \expandafter\ifx\csname USF+\f at family\endcsname\@empty
- \bxus at err@nousf \expandafter\bxus at skiptonil\fi}
-\def\bxus at skiptonil#1\@nil{}
-
-%%%% \bxus at hexrange{<range-list>}
-\def\bxus at hexrange#1{%
- \@for\bxus at u:=#1\do{\expandafter\bxus at hexrange@a\bxus at u--\@nil}}
-\def\bxus at hexrange@a#1-#2-#3\@nil{%
- \if-#2-\@tempcnta"#1\relax\bxus at do
- \else\@tempcnta"#1\@tempcntb"#2\relax\expandafter\bxus at hexrange@b\fi}
-\def\bxus at hexrange@b{%
- \@whilenum\@tempcnta<\@tempcntb\do{\bxus at do\advance\@tempcnta\@ne}%
- \bxus at do}
-
-%% EOF
Modified: trunk/Master/texmf-dist/tex/latex/bxbase/bxutf8.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxutf8.def 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxutf8.def 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,34 +1,58 @@
+%%
+%% This is file 'bxutf8.def'.
+%%
%
-% bxutf8.def
+%% file declaration
+\ProvidesFile{bxutf8.def}[2017/05/29 v1.1 BX UTF-8 input encoding]
%
-%%%% package declarations
-\ProvidesFile{bxutf8.def}[2010/05/05 v0.5 BX UTF-8 input encoding]
-%
% Note: All definitions in this file should be local.
+% This file should not spill any spaces or \par.
%
-%%%% preparation
-% Here spaces are set back to valid. So great care must be taken
+%% code guards
+% Here spaces are set back to effective. So great care must be taken
% so spaces should not be spilt out (in horizontal mode).
\catcode32=10\relax
-\expandafter\edef\csname bx at b@resetcatcodes\endcsname{% " . : @
- \catcode34=\the\catcode34\catcode46=\the\catcode46%
- \catcode58=\the\catcode39\catcode64=\the\catcode64\relax}%
-\catcode34=12 \catcode46=12 \catcode58=12 \catcode64=11 %
+\edef\bxus at i@restore at codes{%
+ \catcode33=\the\catcode33%
+ \catcode34=\the\catcode34%
+ \catcode39=\the\catcode39%
+ \catcode45=\the\catcode45%
+ \catcode46=\the\catcode46%
+ \catcode47=\the\catcode47%
+ \catcode58=\the\catcode58%
+ \catcode63=\the\catcode63%
+ \catcode96=\the\catcode96%
+\relax}
+\catcode33=12 % <!>
+\catcode34=12 % <">
+\catcode39=12 % <'>
+\catcode45=12 % <->
+\catcode46=12 % <.>
+\catcode47=12 % </>
+\catcode58=12 % <:>
+\catcode63=12 % <?>
+\catcode96=12 % <`>
+\g at addto@macro\bxus at i@restore at codes{%
+ \let\bxus at i@restore at codes\@undefined}%
+%
+%--------------------------------------- dynamic part
+%
% abort when this is first loaded after \begin{document}
\def\bxus at i@error{\PackageError{inputenc}}%
\ifx\@nodocument\relax
\ifx\bxus at bxutf@loaded\@undefined
- \bxus at i@error{cannot load `bxutf8' after \string\begin{document}}%
- \@eha \bx at b@resetcatcodes\endinput\fi\fi
+ \bxus at i@error
+ {cannot load `bxutf8' after \string\begin{document}}\@eha
+ \bxus at i@restore at codes\endinput\fi\fi
%
-%%%% load 'utf8' encoding
+%% load 'utf8' encoding
\InputIfFileExists{utf8.def}{}%
- {\bxus at i@error{input encoding `utf8' unavailable}%
- \@eha \bx at b@resetcatcodes\endinput}%
-\makeatletter
+ {\bxus at i@error{input encoding `utf8' unavailable}\@eha
+ \bxus at i@restore at codes\endinput}%
+\makeatletter % is this needed??
%\@inpenc at test % This is done in utf8.def
%
-%%%% attach the hook
+%% attach the hook
\def\UTFviii at two@octets#1#2{\expandafter\bxus at choice
\csname u8:#1\string#2\endcsname#1#2.@}%
\def\UTFviii at three@octets#1#2#3{\expandafter\bxus at choice
@@ -36,33 +60,21 @@
\def\UTFviii at four@octets#1#2#3#4{\expandafter\bxus at choice@four
\csname u8:#1\string#2\string#3\string#4\endcsname#1#2#3#4@}%
%
-%%%% attach the hook (old version)
-% * This hook was found to fail in pTeX.
-% Here #1 is a control word of form \u8:<UTF-8_bytes>. If it is
-% defined in standard way of utf8.def, then it is dispatched;
-% otherwise it is passed to \bxus at preproc.
-%\def\UTFviii at defined#1{%
-% \ifx#1\relax \bxus at preproc#1%
-% \else\expandafter#1\fi}%
-%%%% \bxus at preproc\CS
-%\def\bxus at preproc#1{%
-% \expandafter\bxus at preproc@a\string#1..\@nil}%
-%\def\bxus at preproc@a#1:#2#3#4#5#6\@nil{%
-% \if.#5\bxus at proc#2#3#4\else\bxus at err@uknbc\fi}%
-%
% When this file is reloaded, the 'static' part will be skipped.
\ifx\bxus at bxutf@loaded\@undefined\else
- \bx at b@resetcatcodes\endinput \fi
+ \bxus at i@restore at codes\endinput \fi
\let\bxus at bxutf@loaded=t%
%
-%%---------- Beginning of static part
+%--------------------------------------- static part
%
-%%%% error messages
-\def\bxus at err@uknbc{\bxus at i@error{Unknown non-BMP character found}%
+%% error messages
+\def\bxus at err@uknbc{\bxus at i@error
+ {Unknown non-BMP character found}%
{bxutf8 cannot handle non-BMP characters.}}%
-\def\bxus at err@nodrv{\bxus at i@error{Unicode driver not found}\@ehb}%
+\def\bxus at err@nodrv{\bxus at i@error
+ {Unicode driver not found}\@ehb}%
%
-%%%% make tables
+%% make tables for 'nybble conversion'
\def\bxus at fornbl{%
\bxus at fornbl@a00001102203310411512613720821922A23B30C31D32E33FXXX}%
\def\bxus at fornbl@a#1#2#3{%
@@ -78,26 +90,26 @@
\lowercase{\expandafter\gdef\csname bxus@@!\endcsname{#2}}}}%
\bxus at fornbl \@namedef{bxus@@.}{}%
%
-%%%% \bxcs at choice
-%% Called in the form
-%% \bxus at choice[\u8:??]??.@ (2-byte) or
-%% \bxus at choice[\u8:???]???@ (3-byte)
-%% where ?? is a (TF-8 byte string and [\u8:...] denotes a single
-%% control word. This macro expands to the control word if it is
-%% defined; otherwise expands to \bxus at proc.
+%% \bxcs at choice
+% Called in the form
+% \bxus at choice[\u8:??]??.@ (2-byte) or
+% \bxus at choice[\u8:???]???@ (3-byte)
+% where ?? is a (TF-8 byte string and [\u8:...] denotes a single
+% control word. This macro expands to the control word if it is
+% defined; otherwise expands to \bxus at proc.
\def\bxus at choice#1#2@{%
\ifx#1\relax \bxus at proc#2%
\else\expandafter#1\fi}%
%
-%%%% \bxus at choice@four
+%% \bxus at choice@four
\def\bxus at choice@four#1#2@{%
\ifx#1\relax \bxus at prociv#2%
\else\expandafter#1\fi}%
%
-%%%% \bxus at proc
-%% When ??? is the UTF-8 string of U+XXXX (padded to length 3 with
-%% a dot), then \bxus at proc@a??? fully expands to \bxUHex{XXXX}.
-%% (\bxUHex should be robust.)
+%% \bxus at proc
+% When ??? is the UTF-8 string of U+XXXX (padded to length 3 with
+% a dot), then \bxus at proc@a??? fully expands to \bxUHex{XXXX}.
+% (\bxUHex should be robust.)
\def\bxus at proc#1#2#3{%
\expandafter\bxus at proc@b\csname bxus@@\string#1\expandafter\endcsname
\csname bxus@@\string#2\expandafter\endcsname
@@ -123,6 +135,8 @@
\def\bxus at proc@g#1\@nil#2\@nil{%
\bxUHex{#2#1}}%
%
+%% \bxus at prociv
+% The variant of \bxus at proc that is adapted to 4-octet sequences.
\def\bxus at prociv#1#2#3#4{%
\expandafter\bxus at prociv@a\csname bxus@@\string#1\expandafter\endcsname
\csname bxus@@\string#2\expandafter\endcsname
@@ -130,39 +144,39 @@
\csname bxus@@\string#4\endcsname}%
\def\bxus at prociv@a#1#2#3#4{%
\expandafter\expandafter\expandafter\bxus at prociv@b
- \expandafter#3#4@#1#2}
+ \expandafter#3#4@#1#2}%
\def\bxus at prociv@b#1@#2#3{%
\expandafter\expandafter\expandafter\bxus at prociv@c
- \expandafter#2#3#1@@}
+ \expandafter#2#3#1@@}%
\def\bxus at prociv@c#1#2#3#4{%
\expandafter\bxus at prociv@d\csname bxus@*#1#2\expandafter\endcsname
- \csname bxus@*#3#4\endcsname}
+ \csname bxus@*#3#4\endcsname}%
\def\bxus at prociv@d#1#2{%
\expandafter\expandafter\expandafter\bxus at prociv@e
- \expandafter#1#2}
-\def\bxus at prociv@e#1#2#3@#4@{\bxus at prociv@f#3@#4#1#2@}
+ \expandafter#1#2}%
+\def\bxus at prociv@e#1#2#3@#4@{\bxus at prociv@f#3@#4#1#2@}%
\def\bxus at prociv@f#1#2#3#4{%
\expandafter\bxus at prociv@g\csname bxus@*#1#2\expandafter\endcsname
- \csname bxus@*#3#4\endcsname}
+ \csname bxus@*#3#4\endcsname}%
\def\bxus at prociv@g#1#2{%
\expandafter\expandafter\expandafter\bxus at prociv@h
- \expandafter#1#2}
-\def\bxus at prociv@h#1#2#3@#4@{\bxus at prociv@i#3@#4#1#2@}
+ \expandafter#1#2}%
+\def\bxus at prociv@h#1#2#3@#4@{\bxus at prociv@i#3@#4#1#2@}%
\def\bxus at prociv@i#1#2#3#4{%
\expandafter\bxus at prociv@j\csname bxus@*#1#2\expandafter\endcsname
- \csname bxus@*#3#4\endcsname}
+ \csname bxus@*#3#4\endcsname}%
\def\bxus at prociv@j#1#2{%
\expandafter\expandafter\expandafter\bxus at prociv@k
- \expandafter#1#2}
-\def\bxus at prociv@k#1#2@#3@{\bxUHex{#3#1#2}}
-
-
-
-
-%%%% default (useless) Unicode driver
-\providecommand*\bxUHex[1]{?\protect\bxus at err@nodrv}%
+ \expandafter#1#2}%
+\def\bxus at prociv@k#1#2@#3@{\bxUHex{#3#1#2}}%
%
-%%%% all done
-\bx at b@resetcatcodes
+%
+%% default (useless) Unicode driver
+% Note: this \bxUHex definition is used for check.
+\providecommand*\bxUHex{\bxUHexDummyBxutf}%
+\newcommand*\bxUHexDummyBxutf[1]{?\protect\bxus at err@nodrv}%
+%
+%--------------------------------------- all done
+\bxus at i@restore at codes
\endinput
%% EOF
Modified: trunk/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,40 +1,54 @@
+%%
+%% This is file 'bxutf8x.def'.
+%%
%
-% bxutf8x.def
+%% file declaration
+\ProvidesFile{bxutf8x.def}[2017/05/29 v1.1 BX extended utf8x input]
%
-%%%% package declarations
-\ProvidesFile{bxutf8x.def}[2008/04/06 v0.3
- BX UTF-8 input encoding (ucs ver.)]
-%
% Note: All definitions in this file should be local.
+% This file should not spill any spaces or \par.
%
-%%%% preparation
+%% code guards
\catcode32=10\relax
-\expandafter\edef\csname bx at b@resetcatcodes\endcsname{% " . : @
- \catcode34=\the\catcode34\catcode46=\the\catcode46%
- \catcode58=\the\catcode39\catcode64=\the\catcode64\relax}%
-\catcode34=12 \catcode46=12 \catcode58=12 \catcode64=11 %
+\expandafter\edef\csname bxus at i@restore at codes\endcsname{%
+ \catcode34=\the\catcode34% <">
+ \catcode46=\the\catcode46% <.>
+ \catcode58=\the\catcode58% <:>
+ \catcode64=\the\catcode64% <@>
+\relax}%
+\catcode34=12 %
+\catcode46=12 %
+\catcode58=12 %
+\catcode64=11 %
+\g at addto@macro\bxus at i@restore at codes{%
+ \let\bxus at i@restore at codes\@undefined}%
+%
+%--------------------------------------- dynamic part
+%
\def\bxus at i@error{\PackageError{inputenc}}%
\ifx\@nodocument\relax
\ifx\bxus at bxutfx@loaded\@undefined
- \bxus at i@error{cannot load `bxutf8x' after \string\begin{document}}%
- \@eha \bx at b@resetcatcodes\endinput\fi\fi
+ \bxus at i@error
+ {cannot load `bxutf8x' after \string\begin{document}}\@eha
+ \bxus at i@restore at codes\endinput\fi\fi
%
-%%%% load 'utf8x' encoding
+%% load 'utf8x' encoding
\InputIfFileExists{utf8x.def}{}%
{\PackageError{inputenc}{input encoding `utf8x' unavailable}%
{You must install `unicode' package to use it.}%
- \bx at b@resetcatcodes\endinput}%
+ \bxus at i@restore at codes\endinput}%
%\@inpenc at test % This is done in utf8.def
%
% When this file is reloaded, the 'static' part will be skipped.
\ifx\bxus at bxutfx@loaded\@undefined\else
- \bx at b@resetcatcodes \endinput \fi
+ \bxus at i@restore at codes \endinput \fi
\let\bxus at bxutfx@loaded=t%
%
-%%---------- Beginning of static part
+%--------------------------------------- Static part
%
-%%%% error messages
-\def\bxus at err@nodrv{\bxus at i@error{Unicode driver not found}\@ehb}%
+%% error messages
+\def\bxus at err@nodrv{\bxus at i@error
+ {Unicode driver not found}\@ehb}%
%
%%%% \bxus at uc@char at notloaded
% Hooked version of \uc at char@notloaded
@@ -58,13 +72,13 @@
\def\bxus at uc@notloaderr#1#2#3{%
\bxUInt{#1}}% \bxUInt should be robust
%
-%%%% attach the hook
+%% attach the hook
% Note that ucs.sty could be loaded after utf8x.def.
\AtBeginDocument{%
\let\uc at notloaderr\bxus at uc@notloaderr
\let\uc at char@notloaded\bxus at uc@char at notloaded}%
%
-%%%% force ucs 'fasterrors' option switched on
+%% force ucs 'fasterrors' option switched on
% Heavy 'uninames' decoding process is of no use in presence of the hook,
% and it causes unexpected result in use of pTeX.
\AtBeginDocument{%
@@ -71,10 +85,12 @@
\let\UnicodeOptionfasterrorsfalse\UnicodeOptionfasterrorstrue
\UnicodeOptionfasterrorstrue}%
%
-%%%% default (useless) Unicode driver
-\providecommand*\bxUInt[1]{?\protect\bxus at err@nodrv}%
+%% default (useless) Unicode driver
+% Note: this \bxUHex definition is used for check.
+\providecommand*\bxUInt{\bxUIntDummyBxutfx}%
+\newcommand*\bxUIntDummyBxutfx[1]{?\protect\bxus at err@nodrv}%
%
-%%%% all done
-\bx at b@resetcatcodes
+%--------------------------------------- all done
+\bxus at i@restore at codes
\endinput
%% EOF
Modified: trunk/Master/texmf-dist/tex/latex/bxbase/zxbase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxbase/zxbase.sty 2017-06-05 23:14:56 UTC (rev 44480)
+++ trunk/Master/texmf-dist/tex/latex/bxbase/zxbase.sty 2017-06-05 23:15:19 UTC (rev 44481)
@@ -1,21 +1,27 @@
-%
-% zxbase.sty
-%
-%%%% package declaration
+%%
+%% This is file 'zxbase.sty'.
+%%
+%% Copyright (c) 2017 Takayuki YATO (aka. "ZR")
+%% GitHub: https://github.com/zr-tex8r
+%% Twitter: @zr_tex8r
+%%
+%% This package is distributed under the MIT License.
+%%
+
+%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{zxbase}[2009/11/16]
+\ProvidesPackage{zxbase}[2017/05/29 v1.1]
\RequirePackage{ifxetex}
\RequireXeTeX
-%%%% preparations
+%% preparations
\RequirePackage{bxbase}
\def\zx at pkgname{zxbase}
-\def\zx at error{\PackageError\zx at pkgname}
-\def\zx at warn{\PackageWarningNoLine\zx at pkgname}
-%%------ generic family detection
+%--------------------------------------- generic family detection
-%%%% constants \zxSpecFamily, \zxRMFamily, etc.
+%%<+> \zxSpecFamily / \zxRMFamily / \zxSFFamily / \zxTTFamily
+% The constants signifying each generic family.
% These values can be considered as fixed, so you can say i.e.
% "\ifnum\zxGFFlag<\zxSFFamily <non-sans> \else <sans> \fi"
\chardef\zxSpecFamily=0
@@ -23,7 +29,7 @@
\chardef\zxSFFamily=2
\chardef\zxTTFamily=3
-%%%% \zx at set@genfamflag
+%% \zx at set@genfamflag
% A patch to be inserted to \selectfont. This makes \selectfont
% set a right \zx..Family constant to \zxGFFlag.
\def\zx at set@genfamflag{%
@@ -40,7 +46,7 @@
\zx at set@gff at get\zx at genfam#1%
\ifx\zx at genfam\zx at curfam \let\zxGFFlag#2\fi}
-%%%% \zxBDHookGenFamFlag
+%%<+> \zxBDHookGenFamFlag
\def\zxBDHookGenFamFlag{\zx at bdhook@genfamflag at do}
\@onlypreamble\zx at bdhook@genfamflag at do
\def\zx at bdhook@genfamflag at do{%
@@ -51,8 +57,11 @@
\expandafter\def\expandafter#1\expandafter{%
\expandafter\zx at set@genfamflag#1}}
-%%------ Forging pTeX direction primitives
+%--------------------------------------- forge pTeX primitives
+% It is not totally safe, but is required so as to make
+% the 'ajmacros' package work.
+%%<+> \zxBDHookForgepTeXDir
\def\zxBDHookForgepTeXDir{\zx at bdhook@forgeptexdir at do}
\@onlypreamble\zx at bdhook@forgeptexdir at do
\def\zx at bdhook@forgeptexdir at do{%
@@ -65,14 +74,20 @@
\expandafter\let\csname if#1\expandafter\endcsname
\csname if#2\endcsname \fi}
-%%------ Forcing to read pLaTeX packages
+%--------------------------------------- load pLaTeX packages
+%%<+> switch 'zxPPInUTFEight'
\newif\ifzxPPInUTFEight
+
+%% variables
\newif\ifzx at jisenc
-\def\zx at err@ukenc#1{\zx at error{File '#1' is in unknown encoding}%
-{The file must be encoded in ISO-2022-JP or UTF-8.}}
-%%%% \zxRequirepLaTeXPackage
+%% errors
+\def\zx at err@ukenc#1{\PackageError\zx at pkgname
+ {File '#1' is in unknown encoding}%
+ {The file must be encoded in ISO-2022-JP or UTF-8.}}
+
+%%<+> \zxRequirepLaTeXPackage{<package>}
\@onlypreamble\zxRequirepLaTeXPackage
\def\zxRequirepLaTeXPackage#1{%
\ifzxPPInUTFEight \zx at jisencfalse
@@ -82,17 +97,17 @@
\fi
\let\NeedsTeXFormat\zx at mute@NeedsTeXFormat
\ifzx at jisenc \XeTeXdefaultencoding ISO-2022-JP\relax \fi
- \RequirePackage{#1}%
+ \RequirePackage{#1}\relax
\ifzx at jisenc \XeTeXdefaultencoding auto\relax \fi
\let\NeedsTeXFormat\zx at org@NeedsTeXFormat
}
-%%%% \zx at mute@NeedsTeXFormat
+%% \zx at mute@NeedsTeXFormat
\def\zx at mute@NeedsTeXFormat#1{\@ifnextchar[{\zx at mute@ntf at a}{\relax}}
\def\zx at mute@ntf at a[#1]{\relax}
\let\zx at org@NeedsTeXFormat\NeedsTeXFormat
-%%%% \zx at checkjisorutfeight{<file>}
+%% \zx at checkjisorutfeight{<file>}
% Decides whether <file> is encoded in JIS or UTF-8 and sets to \zx at joru.
% 0:binary; 1:JIS; 2:UTF-8; 3:US-ASCII
\def\zx at checkjisorutfeight#1{%
@@ -127,25 +142,8 @@
%%<*> \platexpackagesinunicode
\@onlypreamble\platexpackagesinunicode
-\let\platexpackagesinunicode\zxPPInUTFEight
+\newcommand*\platexpackagesinunicode{\zxPPInUTFEighttrue}
-%%------ trashed stuff
-
-%\def\zxRemoveFSSuffix#1{%
-% \edef\zx at tmpx{#1}\bxOkfalse
-% \let\bxRes\@empty \let\zx at chunk\@gobble
-% \expandafter\zx at rem@fssfx at a\zx at tmpx(@\@nil}
-%\def\zx at rem@fssfx at a#1(#2#3\@nil{%
-% \ifx @#2\edef\bxRes{\bxRes\zx at chunk\@empty}%
-% \def\zx at nxt{\zx at rem@fssfx at b#1@)@\@nil}%
-% \else \edef\bxRes{\bxRes\zx at chunk(}\def\zx at chunk{#1}%
-% \def\zx at nxt{\zx at rem@fssfx at a#2#3\@nil}%
-% \fi \zx at nxt}
-%\def\zx at rem@fssfx at b#1)@#2\@nil{%
-% \ifx\bxRes\@empty\else
-% \ifx @#2@\else \bxAssign\@tempcnta0#1\relax \fi \fi
-% \ifbxOk\else \let\bxRes\zx at tmpx \fi}
-
-%%------ all done
+%--------------------------------------- all done
\endinput
%% EOF
More information about the tex-live-commits
mailing list