summaryrefslogtreecommitdiff
path: root/language/japanese/BX
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-10-23 03:00:42 +0000
committerNorbert Preining <norbert@preining.info>2019-10-23 03:00:42 +0000
commit43e60b98142683b95336b9086ee52f4daefff93e (patch)
treec435859ab7275b2cb9f3c2f5ca83dafe20968ad6 /language/japanese/BX
parent7bf461efa5036b361e9500c4ed5c675cc819652c (diff)
CTAN sync 201910230300
Diffstat (limited to 'language/japanese/BX')
-rw-r--r--language/japanese/BX/bxcjkjatype/LICENSE21
-rw-r--r--language/japanese/BX/bxcjkjatype/README-ja.md284
-rw-r--r--language/japanese/BX/bxcjkjatype/README.md282
-rw-r--r--language/japanese/BX/bxcjkjatype/bxcjkjatype.sty1056
-rw-r--r--language/japanese/BX/bxcjkjatype/sample-bxcjkjatype-beamer.pdfbin0 -> 157803 bytes
-rw-r--r--language/japanese/BX/bxcjkjatype/sample-bxcjkjatype-beamer.tex76
-rw-r--r--language/japanese/BX/bxcjkjatype/sample-bxcjkjatype.pdfbin0 -> 101778 bytes
-rw-r--r--language/japanese/BX/bxcjkjatype/sample-bxcjkjatype.tex48
-rw-r--r--language/japanese/BX/bxjatoucs/LICENSE21
-rw-r--r--language/japanese/BX/bxjatoucs/README.md97
-rw-r--r--language/japanese/BX/bxjatoucs/bxjatoucs-cid.tfmbin0 -> 92388 bytes
-rw-r--r--language/japanese/BX/bxjatoucs/bxjatoucs-jis.tfmbin0 -> 31380 bytes
-rw-r--r--language/japanese/BX/bxjatoucs/bxjatoucs.sty292
13 files changed, 2177 insertions, 0 deletions
diff --git a/language/japanese/BX/bxcjkjatype/LICENSE b/language/japanese/BX/bxcjkjatype/LICENSE
new file mode 100644
index 0000000000..9e7e5a082c
--- /dev/null
+++ b/language/japanese/BX/bxcjkjatype/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2016 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
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/language/japanese/BX/bxcjkjatype/README-ja.md b/language/japanese/BX/bxcjkjatype/README-ja.md
new file mode 100644
index 0000000000..f92de5499f
--- /dev/null
+++ b/language/japanese/BX/bxcjkjatype/README-ja.md
@@ -0,0 +1,284 @@
+BXcjkjatype パッケージバンドル
+==============================
+
+LaTeX: pdfLaTeX と CJK パッケージを利用した日本語組版の支援
+
+本パッケージは、日本語組版に適した CJK パッケージの設定を提供する。その
+上で、pLaTeX ユーザにとって CJK パッケージの使用が容易にするために、
+pLaTeX カーネルや pLaTeX 用パッケージのものに類似した命令を提供する。
+
+なお、CJK パッケージ自体は多種の入力エンコーディングをサポートしている
+が、本パッケージでは UTF-8 のみをサポートすることに注意。
+
+### 前提環境
+
+ * フォーマット: LaTeX
+ * エンジン: pdfTeX(DVI・PDF モード共に可)
+ * DVIウェア: 不問
+ - 既定以外のフォント設定では dvipdfmx/pdfTeX が必須。
+ * 依存パッケージ:
+ - CJK、CJKutf8、CJKspace、CJKpunct、etoolbox
+ - ipaex-type1(既定のフォントマップ使用時)
+ - zhmetrics(既定以外のフォントマップ使用時)
+
+### インストール
+
+ - `*.sty` → $TEXMF/tex/latex/BXcjkjatype
+
+bxcjkjatype パッケージ
+----------------------
+
+### パッケージ読込
+
+ \usepackage[<option>,...]{bxcjkjatype}
+
+利用可能なオプションを以下で挙げる。
+
+#### 自動囲み込み
+
+文書本体を `CJK(*)` 環境で自動的かつ安全に囲うためのオプション。文書中に
+多量の CJK テキストが含まれる場合、或いは「動く引数」に CJK テキストが
+含まれる場合はこれを指定するのが適切である。
+
+ * `whole`、`wholeCJK*`: 文書全体を `CJK*` 環境で囲む。(厳密に言うと
+ `\begin{uCJK*}`~`\end{uCJK*}` で囲む。)
+ * `wholeCJK`: 文書全体を `CJK` 環境で囲む。(厳密に言うと
+ `\begin{uCJK}`~`\end{uCJK}` で囲む。)
+ * `nowhole`(既定): `wholeCJK*` 及び `wholeCJK` の否定。
+
+#### 「自動チルダ」
+
+`autotilde` オプションを指定すると、`\CJKtilde` が自動的に呼び出されて
+`~` が和欧文間空白(四分空き)の意味になる。なお、`\CJKtilde` 有効時は
+`\nbs` で非分割欧文空白(本来の `~` の意味)が挿入できる。また、
+`\standardtilde` は `\CJKtilde` の効力を打ち消す。(これらは CJK
+パッケージの機能である。)
+
+ * `autotilde`: 全ての `CJK(*)` 環境の先頭で `\autotilde` が呼び出され
+ るようにする。
+ * `noautotilde`(既定): `autotilde` の否定。
+
+#### フォントマップ設定
+
+[pxchfon パッケージ] と同等のフォントマップのプリセットが利用できる。
+詳細についてはそちらの解説文書を参照されたい。
+
+ * `oneweight`、`nooneweight`: pxchfon と同様。
+ * pxchfon で利用可能なプリセットオプション(`ms` 等)が利用できる。
+ (旧式のものを除く。)
+ * `ttfname=<パターン>`: TTC 代替(後述)を行う場合の TTF フォント名の
+ パターンを指定する。
+ * `ipaex-type1`: 本パッケージのフォント管理を無効にし、ipaex-type1
+ パッケージのファミリ(`ipxm` と `ipxg`)を直接用いる。この設定では
+ `\mcdefault` の値は `ipxm` に、`\gtdefault` の値は `ipxg` になる。
+
+[pxchfon パッケージ]: http://www.ctan.org/pkg/pxchfon
+
+#### CJK フォントスケール
+
+ * `scale=<実数>`: CJK フォントに対するスケール値を設定する。
+
+※0.3 版より、`ipaex-type1` 指定時も CJK フォントスケールが利用できるよう
+になった。
+
+#### その他のオプション
+
+ * `everypage`: フォントマップ情報を出力 DVI 文書の全てのページに出力
+ する。`dvipdfmx` ドライバでのみ有効。
+ * `noeverypage`(既定): `everypage` の否定。
+ * ドライバオプション:
+ `pdftex`、`dvipdfmx`、`dvips`、`none` が指定できる。ドライバ設定は
+ 既定(ipaex-type1)以外のフォントマップの使用時にのみ意味をもつ。
+ さらに、フォントマップ変更は `pdftex` と `dvipdfmx` でのみサポート
+ されまたこの 2 つの値は常に自動判定可能(PDF モードでは `pdftex`、
+ DVI モードでは `dvipdfmx` が既定)なので、実際にはドライバを指定する
+ 必要はない。
+ * `substmingoth`: CJK パッケージの日本語用総称ファミリとして慣習的に
+ 使われているファミリの `min`/`goth`/`maru` について、LaTeX レベル
+ で、本パッケージにおける標準ファミリである `mc`/`gt`/`mg` への代替
+ を設定する。これにより、`min` 等のファミリの使用を前提とした日本語湯
+ テンプレート等を使う場合においても、論理フォントレベルでの代替設定を
+ 行う必要がなくなる。
+ * `nosubstmingoth`(既定): `substmingoth` の否定。
+ * `boldbyembolden`(既定): CJK パッケージの“擬似太字”(`\CJKbold`)
+ の処理方法を“重ね打ち”から“合成太字”に変更する。
+ * `noboldbyembolden`: `boldbyembolden` の否定。
+
+#### TTC 代替
+
+pdfTeX エンジンは TTC 形式のフォントをサポートしていない(サポートして
+いる OpenType の形式は単体の TTF グリフのものだけである)。従って、
+`\setminchofont` 命令などで TTC フォントを使おうと望むなら、適当なツール
+を使って TTC フォントファイルを個々の TTF フォントファイルに分解する処理
+を行うことが必須になる。
+
+これはエンジン側の制限仕様のため仕方がないだろう。しかし本パッケージを
+用いる場合には他に問題がある。変換後の TTF フォントはファイル名が元のもの
+と異なるため、プリセット設定(`mobo-moga` 等のオプション)が使えないので
+ある。これを解決するために、0.3 版で `ttfname` オプションが新設された。
+
+例えば、パッケージ読込時に `ttfname=*_1` が指定されたとする。この状態で
+本パッケージの処理において「mogam.ttc の最初(0 番)」が要求された場合、
+代わりに「mogam_1.ttf」というファイルが使われる。同様に、「mogam.ttc の
+1 番、2 番、……」については「mogam_2.ttf」「mogam_3.ttf」……での代替が
+行われる。
+
+`ttfname` で指定するファイル名のパターンには「`*_1`」「`TEMP-*-00.TTF`」
+のように「`*` を 1 つ含み、数字列を含む文字列」が指定できる。この `*` の
+部分は要求の TTC ファイルのベース名(`mogam` 等)で置き換えられ、かつ、
+拡張子がない場合は `.ttf` が補われる。その結果の文字列が TTC の最初(0
+番)のフォントに対する代替ファイル名となる。後続(1 番、2 番、……)の
+代替ファイル名は数字部分をインクリメントしたものになる。
+
+### 機能
+
+#### CJK フォントの選択
+
+本パッケージでは、pLaTeX + [japanese-otf パッケージ] で用いられるものと
+同等の 3 つの「総称」CJK ファミリを用意する: 明朝(`\mcfamily`)、
+ゴシック(`\gtfamily`)、丸ゴシック(`\mgfamily`)。既定では ipaex-type1
+パッケージのフォントが割り当てられている:明朝→IPAex明朝、ゴシック→
+IPAexゴシック。この割り当ては変更可能である。
+
+ * `\mcfamily`: CJK ファミリを明朝ファミリに変更する。
+ `\CJKfamily{\mcdefault}` と等価である。
+ * `\gtfamily`: CJK ファミリをゴシックファミリに変更する。
+ `\CJKfamily{\gtdefault}` と等価である。
+ * `\mgfamily`: CJK ファミリを丸ゴシックファミリに変更する。
+ `\CJKfamily{\mgdefault}` と等価である。
+
+高度な命令:
+
+ * `\mcdefault`/`\gtdefault`/`\mgdefault`: 総称ファミリに対応する
+ CJK ファミリ名である。標準の割当ではこれらの値は `mc`/`gt`/`mg` で
+ ありこの割当が既定で用いられる。
+
+ * `\setCJKfamilydefault{<CJKファミリ>}`: 既定の CJK ファミリを設定
+ する。この既定値は、ある種の命令(例えば `\CJKfamily{}` や
+ `\begin{CJK}{UTF8}{}`)でファミリ名が省略された時に用いられる。
+ (再定義後の)`\normalfont` は CJK ファミリをこの命令で設定した既定
+ ファミリに変更する。
+
+ この既定ファミリの既定値は、文書の本体の先頭で有効である欧文ファミリ
+ の「対応ファミリ」となる。(次小節を参照。)
+
+[japanese-otf パッケージ]: http://www.ctan.org/pkg/japanese-otf
+
+#### CJK と欧文のファミリの連動
+
+CJK パッケージ(および pTeX エンジン)では CJK と欧文で別々の「現在
+ファミリ」を管理する。この取扱は利点もあるが、多くの場合はこの 2 つの
+「現在ファミリ」を連動させた方が都合がよい。この為、本パッケージでは現在
+欧文フォントを切り替える幾つかの LaTeX 命令について、CJK ファミリを欧文
+の「対応ファミリ」に切り替えるように再定義する。ここで「対応ファミリ」は
+以下のように定められる:
+
+ * `\rmfamily`(セリフ) → `\mcfamily`(明朝)
+ * `\sffamily`(サンセリフ) → `\gtfamily`(ゴシック)
+ * `\ttfamily`(等幅) → `\gtfamily`(ゴシック)
+ * その他のファミリについては、対応ファミリは `\mcfamily` とする。
+
+再定義される命令:
+
+ * `\rmfamily`/`\sffamily`/`\ttfamily`: 本来の動作の後、CJKファミリ
+ を欧文ファミリの「対応ファミリ」に変更する。
+ * `\normalfont`: CJK ファミリを、`\setCJKfamilydefault` 命令により
+ 指定された既定 CJK ファミリに変更する。
+
+`CJK`/`CJK*` 環境の省略系:
+
+ * `\begin{uCJK*}...\end{uCJK*}`: 次のものと等価:
+
+ \begin{CJK*}{UTF8}{対応ファミリ}...\end{CJK*}
+
+ ただし `対応ファミリ` は現在の欧文ファミリの対応ファミリを表す。
+
+ 次のものと等価ではないことに注意:
+
+ \begin{CJK*}{UTF8}{}...\end{CJK*}
+
+ こちらは既定の CJK ファミリを使用する。
+
+ * `\begin{uCJK}...\end{uCJK}`: 次のものと等価:
+
+ \begin{CJK}{UTF8}{対応ファミリ}...\end{CJK}
+
+#### フォントマップ設定
+
+これらの命令の使い方は pxchfon パッケージの時と同じであるので、詳細に
+ついてはそちらの解説文書を参照されたい。
+
+ * `\setminchofont[<ID>]{<フォントファイル名>}`
+ * `\setgothicfont[<ID>]{<フォントファイル名>}`
+ * `\setmarugothicfont[<ID>]{<フォントファイル名>}`
+ * `\setmediumminchofont[<ID>]{<フォントファイル名>}`
+ * `\setboldminchofont[<ID>]{<フォントファイル名>}`
+ * `\setmediumgothicfont[<ID>]{<フォントファイル名>}`
+ * `\setboldgothicfont[<ID>]{<フォントファイル名>}`
+ * `\setxboldgothicfont[<ID>]{<フォントファイル名>}`
+
+ところが、pdfTeX エンジンについてはフォントマップの仕様に関して重大な
+制限が存在する。TrueType グリフであってかつ TTC 形式でないフォントのみ
+が使用できる。(dvipdfmx 使用時は全ての種類の OpenType フォントが使用
+可能。)
+
+注意: 本パッケージは「明朝・細字」のフォントをサポートしない。従って、
+`\setlightminchofont` は動作しない。
+
+#### その他の命令
+
+ * `\UTF{<16進数字>}`: CJK 文字を Unicode 符号値で入力する。例えば、
+ `\UTF{5B57}` は `\Unicode{"5B}{"57}` と等価である。
+
+ * `\CJKforce{<character>...}`: 以降は引数の中にある各々の文字を CJK
+ 文字として扱う(CJK フォントで出力される)。
+
+ * `\CJKunforce{<character>...}`: `\CJKforce` の効果を打ち消す。
+
+ * `\@<character>`: 非 ASCII 文字の前に `\@` がある場合は、その文字
+ (その出現のみ)を CJK 文字として扱う。ASCII 文字の前の `\@` は
+ LaTeX 本来の意味を保持する。
+
+ * `\CJKecglue`: 和欧文間空白を挿入する。`\CJKtilde` が有効な時は `~`
+ はこの命令を呼び出す。この命令をユーザが再定義して和欧文間空白の量を
+ 調節することができる(和文間空白の `\CJKglue` と同様)。
+
+ 使用例:
+
+ \renewcommand{\CJKecglue}{\hspace{0.125em minus 0.125em}}
+
+### 補足事項
+
+ * 本パッケージで標準に用いられるフォントは、例えそれに ipaex-type1 の
+ フォントが割り当てられている場合でも、縦書きをサポートしない。しかし
+ ipaex-type1 が提供するファミリ(`ipxm` と `ipxg`)は縦書きをサポート
+ しており、`ipaex-type1` オプションを指定することでそれらのファミリを
+ 直接使うことができる。
+
+更新履歴
+--------
+
+ * Version 0.3 ‹2016/10/15›
+ - CJKvert パッケージによる縦組と共存を可能にした。
+ - hyperref での PDF 文字列の文字化けを防止し。
+ - `ipaex-type1` 指定時もフォントスケールを可能にした。
+ - `boldbyembolden` 機能を実装。
+ - `ttfname` オプションを追加。
+ - `substmingoth` オプションを追加。
+
+ * Version 0.2c ‹2013/10/18›
+ - CJK フォントスケールをサポートした。
+ - `\CJKforce`、`\CJKunforce`、`\@` を追加。
+
+ * Version 0.2b ‹2013/09/28›
+ - `\UTF`、`\CJKecglue` を追加。
+
+ * Version 0.2a ‹2013/08/08›
+ - `autotilde` オプションを追加。
+
+ * Version 0.2 ‹2013/08/08›
+ - 最初の公開版。
+
+--------------------
+Takayuki YATO (aka. "ZR")
+http://zrbabbler.sp.land.to/
diff --git a/language/japanese/BX/bxcjkjatype/README.md b/language/japanese/BX/bxcjkjatype/README.md
new file mode 100644
index 0000000000..1a2fe8242d
--- /dev/null
+++ b/language/japanese/BX/bxcjkjatype/README.md
@@ -0,0 +1,282 @@
+BXcjkjatype Package
+===================
+
+LaTeX: Support for Japanese typesetting with pdfLaTeX and CJK package
+
+This package provides working configuration of the CJK package suitable
+for Japanese typesetting of moderate quality. Moreover, it facilitates
+use of the CJK package for pLaTeX users, by providing commands that
+are similar to those used by the pLaTeX kernel and some other packages
+used with it.
+
+Note that while the CJK package supports many input encodings, this
+package supports only UTF-8.
+
+### System requirement
+
+ * TeX format: LaTeX.
+ * TeX engine: pdfTeX (DVI or PDF mode).
+ * DVI driver: Anything.
+ - Non-default font settings require dvipdfmx or pdfTeX.
+ * Dependent packages:
+ - CJK, CJKutf8, CJKspace, CJKpunct, etoolbox;
+ - ipaex-type1 (when using default font mapping);
+ - zhmetrics (when using non-default font mapping).
+
+### Installation
+
+ - `*.sty` → $TEXMF/tex/latex/BXcjkjatype
+
+### License
+
+This package is distributed under the MIT License.
+
+The bxcjkjatype Package
+-----------------------
+
+### Package Loading
+
+ \usepackage[<option>,...]{bxcjkjatype}
+
+The available options are described hereafter.
+
+#### Options for auto-wrapping
+
+These options enable one to wrap the document body with a `CJK(*)`
+environemnt automatically and safely. They are suitable when a document
+contains much amount of CJK text, or some “moving arguemnts” hold
+CJK text.
+
+ * `whole`, `wholeCJK*`: Wraps the whole document body with a `CJK*`
+ environment (precisely speaking, with
+ `\begin{uCJK*}` ... `\end{uCJK*}` ).
+ * `wholeCJK`: Wraps the whole document body with a `CJK` environment
+ (precisely speaking, with
+ `\begin{uCJK}` ... `\end{uCJK}` ).
+ * `nowhole` (default): Negation of `wholeCJK*` or `wholeCJK`.
+
+#### Options for “auto-tilde”
+
+The option `autotilde` triggers automatic invocation of `\CJKtilde`,
+which makes a tilde character (`~`) insert “shibuaki” (a thin space
+between alphabetic and ideographic letters) rather than a no-break
+space (standard). No-break spaces can still be inserted by the command
+`\nbs`, and `\standardtilde` cancels the effect of `\CJKtilde`. (The
+commands mentioned here belong to CJK package.)
+
+ * `autotilde`: Makes `\CJKtilde` invoked at the beginning of every
+ `CJK(*)` environemnt.
+ * `noautotilde` (default): Negation of `autotilde`.
+
+#### Options for font-mapping
+
+One can use preset font mappings in the same way as in the [pxchfon
+package]. Please refer to the manual of that package for detailed
+explanation of this feature.
+
+ * `oneweight`, `nooneweight`: The same as in pxchfon.
+ * One can use font preset options (such as `ms`) which are available
+ in pxchfon (except obsolete ones).
+ * `ttfname=<pattern>`: Specifies the pattern of the TTF font names
+ which are used when TTC substitution is employed. For example,
+ when `ttfname=*_1` is given, the font “index 0 of mogam.ttc” will
+ map to “mogam_1.ttf”, and similarly, “index 1” to “mogam_2.ttf”
+ and so on.
+ * `ipaex-type1`: Disables the font management of this package and
+ directly uses the families provided by the ipaex-type1 package,
+ namely `ipxm` and `ipxg`. In this setting the value of `\mcdefault`
+ is `ipxm` and the value of `\gtdefault` and `\mgdefault` is `ipxg`,
+ so that the higher level commands (such as `\sffamily` and
+ `\gtfamily`) can work correctly.
+
+[pxchfon package]: http://www.ctan.org/pkg/pxchfon
+
+#### Options for CJK font scaling
+
+ * `scale=<real>`: Sets the scaling factor for CJK fonts.
+
+(With version 0.3 or later, one can employ the scaling even with the
+`ipaex-type1` option.)
+
+#### Other options
+
+ * `everypage`: Outputs the font mapping information on every page of
+ the resulted DVI document. Available only with `dvipdfmx` driver.
+ * `noeverypage` (default): Negation of `everypage`.
+ * driver options:
+ `pdftex`, `dvipdfmx`, `dvips` and `none` are available. The driver
+ setting is relevant only when using font mappings other than the
+ default one (ipaex-type1 fonts), so one need not care of drivers
+ in using default fonts. Moreover, non-default font mappings are
+ supported only by `pdftex` and `dvipdfmx`, and these two values are
+ auto-detected (`pdftex` is default in PDF mode and `dvipdfmx` in
+ DVI mode). Thus one will never need to specify the driver.
+ * `substmingoth`: Applies the substituion of families `min`, `goth`
+ and `maru` (used conventionally for Japanese) with families `mc`,
+ `gt` and `mg` (standard in this package).
+ * `nosubstmingoth` (default): Negation of `substmingoth`.
+ * `boldbyembolden` (default): Changes the implemention of `\CJKbold`
+ (pseudo-bold) from “overstriking” to “synthetic emboldening”.
+ * `noboldbyembolden`: Negation of `boldbyembolden`.
+
+### Usage
+
+#### Selecting CJK fonts
+
+The present package provides three “generic” CJK families in the same
+way as pLaTeX plus the [japanese-otf package]: Mincho family
+(`\mcfamily`), Gothic family (`\gtfamily`), and Maru-gothic family
+(`\mgfamily`). In default setting, the font set from the ipaex-type1
+package are allocated; Mincho family uses IPAex Mincho font, and Gothic
+and Maru-gothic families use IPAex Gothic font. This allocation can be
+altered by users.
+
+ * `\mcfamily`: Changes the CJK family to Mincho family. Equivalent
+ to `\CJKfamily{\mcdefault}`.
+ * `\gtfamily`: Changes the CJK family to Gothic family. Equivalent
+ to `\CJKfamily{\gtdefault}`.
+ * `\mgfamily`: Changes the CJK family to Maru-gothic family.
+ Equivalent to `\CJKfamily{\mgdefault}`.
+
+More advanced commands:
+
+ * `\mcdefault`/`\gtdefault`/`\mgdefault`: The names of CJK families
+ corresponding to the three generic families. In the standard
+ allocation their values are `mc`/`gt`/`mg` respectively and the
+ allocation is used as default.
+
+ * `\setCJKfamilydefault{<CJK-family>}`: Declares the default CJK
+ family. This default value is used when family names are missing
+ in some commands, such as `\CJKfamily{}` and `\begin{CJK}{UTF8}{}`.
+ The (redefined) `\normalfont` also switches the CJK family to the
+ family specified by this command.
+
+ The default value of this default family is the “counterpart” of
+ the alphabetic font family which is in effect at the beginning of
+ the document body. (See the next subsection.)
+
+[japanese-otf package]: http://www.ctan.org/pkg/japanese-otf
+
+#### Synchronization of CJK and non-CJK families
+
+The CJK package (and pTeX engine) manages separate “current families”
+for CJK and alphabetic (non-CJK) families. While this treatment has its
+merit, synchronization of the two “current families” is convenient in
+many cases. Accordingly, tHe present package redefines some of the
+LaTeX commands that switches current alphabetic font families so that
+the CJK family will be switched to the counterpart of the current
+alphabetic family, where the “counterpart” is defined as follows:
+
+ * `\rmfamily` (Serif) → `\mcfamily` (Mincho)
+ * `\sffamily` (Sans-serif) → `\gtfamily` (Gothic)
+ * `\ttfamily` (Monospace) → `\gtfamily` (Gothic)
+ * The counterpart of the other families is `\mcfamily`.
+
+Redefined commands:
+
+ * `\rmfamily`/`\sffamily`/`\ttfamily`: Changes the CJK family to
+ the counterpart of the alphabetic font family after executing the
+ original function.
+ * `\normalfont`: Changes the CJK family to the default CJK family
+ specified by `\setCJKfamilydefault` command.
+
+There are shorthand forms of `CJK`/`CJK*` environemnts:
+
+ * `\begin{uCJK*}...\end{uCJK*}`: Equivalent to:
+
+ \begin{CJK*}{UTF8}{counterpart}...\end{CJK*}
+
+ where `counterpart` means the counterpart of the current alphabetic
+ font family.
+
+ Note that this is *not* equivalent to
+
+ \begin{CJK*}{UTF8}{}...\end{CJK*}
+
+ structure, which uses the default CJK family.
+
+ * `\begin{uCJK}...\end{uCJK}`: Equivalent to:
+
+ \begin{CJK}{UTF8}{counterpart}...\end{CJK}
+
+#### Font mapping
+
+The usage of these commands are the same as in the pxchfon package.
+Please refer to the manual of that package for detail.
+
+ * `\setminchofont[<id>]{<font-file>}`
+ * `\setgothicfont[<id>]{<font-file>}`
+ * `\setmarugothicfont[<id>]{<font-file>}`
+ * `\setmediumminchofont[<id>]{<font-file>}`
+ * `\setboldminchofont[<id>]{<font-file>}`
+ * `\setmediumgothicfont[<id>]{<font-file>}`
+ * `\setboldgothicfont[<id>]{<font-file>}`
+ * `\setxboldgothicfont[<id>]{<font-file>}`
+
+However there is a major limitation as to the use of font mapping with
+the pdfTeX engine. One can use only TrueType fonts and moreover
+TTC format is not allowed. (One can use any flavor of OpenType fonts
+when using dvipdfmx.)
+
+Note: The present package does not support the light-weight Mincho font,
+and thus `\setlightminchofont` does nothing useful.
+
+#### Other commands
+
+ * `\UTF{<hexadecimal-number>}`: Inputs a CJK character through Unicode
+ codepoint value. `\UTF{5B57}` is equivalent to `\Unicode{"5B}{"57}`.
+
+ * `\CJKforce{<character>...}`: Afterwards Treats the characters given
+ in the argument as CJK characters (printed using CJK fonts).
+
+ * `\CJKunforce{<character>...}`: Cancels the effect of the `\CJKforce`
+ command.
+
+ * `\@<character>`: Treats the next character (only that occurrence)
+ as a CJK character, when the character is outside ASCII; othersize
+ the normal meaning of `\@` is retained.
+
+ * `\CJKecglue`: Insers a “shibuaki” space. This will be invoked by
+ `~` when `\CJKtilde` is in effect. This command can be redefined by
+ users to adjust the value of shibuaki space, just as `\CJKglue` can
+ be redefined to adjust inter-ideographic space.
+
+ For example:
+
+ \renewcommand{\CJKecglue}{\hspace{0.125em minus 0.125em}}
+
+### Remarks
+
+ * The standard font families provided by this package does *not*
+ support vertical writing, even when using default ipaex-type1 font
+ set. However, the families provided by ipaex-type1 (`ipxm` and
+ `ipxg`) do support vertical writing, and one can utilize these
+ families directly by specifying `ipaex-type1` option.
+
+Revision History
+----------------
+
+ * Version 0.3 ‹2016/10/15›
+ - Made the vertical writing work well (with CJKvert).
+ - Avoided garbling of PDF strings created by hyperref.
+ - Allowed font scaling even when `ipaex-type1` is set.
+ - Added `boldbyembolden` feature.
+ - Added `ttfname` option.
+ - Added `substmingoth` option.
+
+ * Version 0.2c ‹2013/10/18›
+ - Added support of CJK font scaling.
+ - Added `\CJKforce`, `\CJKunforce`, `\@`.
+
+ * Version 0.2b ‹2013/09/28›
+ - Added `\UTF`, `\CJKecglue`.
+
+ * Version 0.2a ‹2013/08/08›
+ - Added `autotilde` option.
+
+ * Version 0.2 ‹2013/08/08›
+ - The first public version.
+
+--------------------
+Takayuki YATO (aka. "ZR")
+http://zrbabbler.sp.land.to/
diff --git a/language/japanese/BX/bxcjkjatype/bxcjkjatype.sty b/language/japanese/BX/bxcjkjatype/bxcjkjatype.sty
new file mode 100644
index 0000000000..f530e030e9
--- /dev/null
+++ b/language/japanese/BX/bxcjkjatype/bxcjkjatype.sty
@@ -0,0 +1,1056 @@
+%%
+%% This is file 'bxcjkjatype.sty'.
+%%
+%% Copyright (c) 2016 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{bxcjkjatype}[2016/10/15 v0.3]
+\def\bxjy@pkgname{bxcjkjatype}
+
+%% definitions
+\def\bxjy@error{\PackageError\bxjy@pkgname}
+\def\bxjy@warn{\PackageWarning\bxjy@pkgname}
+\def\bxjy@info{\PackageInfo\bxjy@pkgname}
+
+%--------------------------------------- helpers
+
+%% switches
+\newif\ifbxjy@ok
+\newif\ifbxjy@default@set
+\newif\ifbxjy@byembolden
+
+%% unique tokens
+\def\bxjy@mark{\bxjy@mark@}
+\def\bxjy@end{\bxjy@end@}
+
+%% \bxjy@ifprimitive\CS{<true>}{<false>}
+\@onlypreamble\bxjy@ifprimitive
+\def\bxjy@ifprimitive#1{%
+ \edef\bxjy@tmpa{\string#1}%
+ \edef\bxjy@tmpb{\meaning#1}%
+ \ifx\bxjy@tmpa\bxjy@tmpb \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo \fi
+}
+
+%% \bxjy@cond\ifXX...\fi{<true>}{<false>}
+\@gobbletwo\if\if \def\bxjy@cond#1\fi{%
+ #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+}
+
+%--------------------------------------- environment check
+
+%% engine check
+\bxjy@oktrue
+\bxjy@ifprimitive\kanjiskip{\bxjy@okfalse}{}
+\bxjy@ifprimitive\luatexversion{\bxjy@okfalse}{}
+\bxjy@ifprimitive\XeTeXversion{\bxjy@okfalse}{}
+\bxjy@ifprimitive\eTeXversion{}{\bxjy@okfalse}
+\ifbxjy@ok\else
+ \bxjy@error{The engine in use is not supported}%
+ {Only pdfTeX engine is supported.\MessageBreak
+ Package loading is aborted.}
+\expandafter\endinput\fi\relax
+
+%--------------------------------------- option handling
+
+%% using keyval
+\RequirePackage{keyval}
+
+%% Declares options
+\let\bxjy@driver\@undefined
+\let\bxjy@none=n
+\let\bxjy@pdftex=p
+\let\bxjy@dvipdfmx=d
+\DeclareOption{none}{\let\bxjy@driver\bxjy@none}
+\DeclareOption{dvips}{\let\bxjy@driver\bxjy@none}
+\DeclareOption{pdftex}{\let\bxjy@driver\bxjy@pdftex}
+\DeclareOption{dvipdfmx}{\let\bxjy@driver\bxjy@dvipdfmx}
+\let\bxjy@whole=f
+\DeclareOption{whole}{\let\bxjy@whole=t}
+\DeclareOption{wholeCJK*}{\let\bxjy@whole=t}
+\DeclareOption{wholeCJK}{\let\bxjy@whole=p}
+\DeclareOption{nowhole}{\let\bxjy@whole=f}
+\newif\ifbxjy@everypage
+\DeclareOption{everypage}{\bxjy@everypagetrue}
+\DeclareOption{noeverypage}{\bxjy@everypagefalse}
+\newif\ifbxjy@ipaex
+\let\bxjy@oneweight=f
+\DeclareOption{ipaex-type1}{\bxjy@ipaextrue}
+\DeclareOption{oneweight}{\let\bxjy@oneweight=t}
+\DeclareOption{nooneweight}{\let\bxjy@oneweight=f}
+\newif\ifbxjy@autotilde
+\DeclareOption{autotilde}{\bxjy@autotildetrue}
+\DeclareOption{noautotilde}{\bxjy@autotildefalse}
+\newif\ifbxjy@CJKpunct \bxjy@CJKpuncttrue
+\DeclareOption{CJKpunct}{\bxjy@CJKpuncttrue}
+\DeclareOption{noCJKpunct}{\bxjy@CJKpunctfalse}
+\newif\ifbxjy@CJKspace \bxjy@CJKspacetrue
+\DeclareOption{CJKspace}{\bxjy@CJKspacetrue}
+\DeclareOption{noCJKspace}{\bxjy@CJKspacefalse}
+\newif\ifbxjy@boldbyembolden \bxjy@boldbyemboldentrue
+\DeclareOption{boldbyembolden}{\bxjy@boldbyemboldentrue}
+\DeclareOption{noboldbyembolden}{\bxjy@boldbyemboldenfalse}
+\newif\ifbxjy@substmin
+\DeclareOption{substmingoth}{\bxjy@substmintrue}
+\DeclareOption{nosubstmingoth}{\bxjy@substminfalse}
+% preset spec options
+\def\bxjy@all@main@preset{%
+ %(uniweight)
+ ms,ipa,ipaex,%
+ %(multiweight)
+ ms-hg,ipa-hg,moga-mobo,moga-maruberi,%
+ kozuka-pro,kozuka-pr6,kozuka-pr6n,%
+ hiragino-pro,hiragino-pron,morisawa-pro,morisawa-pr6n}
+\let\bxjy@main@preset\relax
+\def\bxjy@do#1{\DeclareOption{#1}{\def\bxjy@main@preset{#1}}}
+\@for\bxjy@x:=\bxjy@all@main@preset\do{%
+ \expandafter\bxjy@do\expandafter{\bxjy@x}}
+% keyval-type
+\DeclareOption*{%
+ \expandafter\bxjy@setkey@a\expandafter{\CurrentOption}}
+\def\bxjy@setkey@a{\setkeys{bxjy}}
+% 'scale=<real>'
+\let\bxjy@scale\relax
+\define@key{bxjy}{scale}{%
+ \def\bxjy@scale{#1}}
+% 'verrtical=<val>'
+\let\bxjy@vertical\@empty
+\define@key{bxjy}{vertical}[true]{%
+ \def\bxjy@vertical{#1}}
+% 'ttfname=<val>'
+\let\bxjy@ttfname\@empty
+\define@key{bxjy}{ttfname}{%
+ \def\bxjy@ttfname{#1}}
+%% Dispatch options
+\ProcessOptions*
+
+%--------------------------------------- configuration check
+
+%% Check the driver specified
+\def\bxjy@tmpa#1#2{%
+ \bxjy@info{Driver auto-detected: #2}%
+ \let\bxjy@driver#1}
+\def\bxjy@tmpb#1#2{%
+ \bxjy@error{Wrong driver specified, changed to: #2}\@ehc%
+ \let\bxjy@driver#1}
+\ifnum\ifdefined\pdfoutput\pdfoutput\else\z@\fi>\z@
+ \unless\ifdefined\bxjy@driver
+ \bxjy@tmpa\bxjy@pdftex{pdftex}%
+ \else\unless\ifx\bxjy@driver\bxjy@pdftex
+ \bxjy@tmpb\bxjy@pdftex{pdftex}%
+ \fi\fi
+\else
+ \unless\ifdefined\bxjy@driver
+ \bxjy@tmpa\bxjy@dvipdfmx{dvipdfmx}%
+ \else\ifx\bxjy@driver\bxjy@pdftex
+ \bxjy@tmpb\bxjy@dvipdfmx{dvipdfmx}%
+ \fi\fi
+\fi
+
+%% Consistency check
+\ifbxjy@ipaex \unless\ifx\bxjy@main@preset\relax
+ \bxjy@error{Preset options cannot go with 'ipaex-type1'}\@ehc
+ \let\bxjy@main@preset\relax
+\fi\fi
+\ifx \bxjy@driver\bxjy@none \unless\ifx\bxjy@main@preset\relax
+ \bxjy@error{Preset options require a valid driver}\@ehc
+ \let\bxjy@main@preset\relax
+\fi\fi
+\ifx \bxjy@driver\bxjy@none
+ \bxjy@boldbyemboldenfalse
+\fi
+
+%% default scale value
+\ifx\bxjy@scale\relax
+ \ifx\Cjascale\@undefined
+ \ifx\jsScale\@undefined
+ \def\bxjy@scale{1}
+ \else \let\bxjy@scale\jsScale
+ \fi
+ \else \let\bxjy@scale\Cjascale
+ \fi
+\fi
+
+%--------------------------------------- preparations
+
+%% Load CJK package and friends
+\RequirePackage{CJK}
+\@namedef{opt@CJK.sty}{encapsulated}
+\let\CJK@global\relax
+\let\CJK@active\relax
+\let\CJK@local\relax
+\RequirePackage{CJKutf8}
+\ifbxjy@CJKspace
+\RequirePackage{CJKspace}
+\fi
+\ifbxjy@CJKpunct
+\RequirePackage{CJKpunct}
+\fi
+
+%% Load other packages
+\RequirePackage{etoolbox}
+\ifbxjy@everypage\ifx\bxjy@driver\bxjy@dvipdfmx
+ \RequirePackage{atbegshi}
+\fi\fi
+%%
+
+%%<+> \FirstCJKUse
+%%<+> \EveryCJKUse
+\appto\CJKhook{%
+ \bxjy@first@cjk@use@hook
+ \bxjy@every@cjk@use@hook}
+\def\bxjy@first@cjk@use@hook{%
+ \global\let\bxjy@first@cjk@use@hook\relax}
+\let\bxjy@every@cjk@use@hook\@empty
+\newcommand*\FirstCJKUse{%
+ \gappto\bxjy@first@cjk@use@hook}
+\newcommand*\EveryCJKUse{%
+ \gappto\bxjy@every@cjk@use@hook}
+
+%--------------------------------------- vertical
+
+%% constants
+\chardef\bxjy@vert@none=0
+\chardef\bxjy@vert@false=0
+\chardef\bxjy@vert@=0
+\chardef\bxjy@vert@sub=1
+\chardef\bxjy@vert@main=2
+\chardef\bxjy@vert@true=2
+
+%% \bxjy@vert
+\let\bxjy@vert\bxjy@vert@none
+\ifcsdef{bxjy@vert@\bxjy@vertical}{%
+ \letcs\bxjy@vert{bxjy@vert@\bxjy@vertical}
+}{%else
+ \bxjy@error{Invalid value of 'vertical': \bxjy@vertical}\@ehc
+}
+\ifcase\bxjy@vert %none
+ \AfterEndPreamble{\csuse{CJKhorz}}
+\or %sub
+ \RequirePackage{CJKvert}[]%
+ \AfterEndPreamble{\CJKhorz}
+\or %main
+ \RequirePackage{CJKvert}[]%
+ \AfterEndPreamble{\CJKvert}
+\fi
+\AtBeginDocument{%
+ \@ifpackageloaded{CJKvert}{%
+ \bxjy@patch@CJKsymbol@CJKvert
+ \patchcmd{\CJKvert}{\normalfont}{\bxjy@normalafont}{}{}%
+ \patchcmd{\CJKhorz}{\normalfont}{\bxjy@normalafont}{}{}%
+ }{}}
+
+%--------------------------------------- user interface
+
+%%%%<*> \setminchofont/\setgothicfont/etc.
+\newcommand*\setminchofont{\bxjy@setfont{mnl,mnr,mnb}}
+\newcommand*\setgothicfont{\bxjy@setfont{gtr,gtb,gtx,gtu}}
+\newcommand*\setlightminchofont{\bxjy@setfont{mnl}}
+\newcommand*\setmediumminchofont{\bxjy@setfont{mnr}}
+\newcommand*\setboldminchofont{\bxjy@setfont{mnb}}
+\newcommand*\setmediumgothicfont{\bxjy@setfont{gtr}}
+\newcommand*\setboldgothicfont{\bxjy@setfont{gtb}}
+\newcommand*\setxboldgothicfont{\bxjy@setfont{gtx}}
+\newcommand*\setoneweightgothicfont{\bxjy@setfont{gtu}}
+\newcommand*\setmarugothicfont{\bxjy@setfont{mgr}}
+\def\bxjy@setfont#1{\@ifnextchar[%]
+ {\bxjy@setfont@a{#1}}{\bxjy@setfont@a{#1}[]}}
+\def\bxjy@setfont@a#1[#2]#3{%
+ \ifx\bxjy@driver\bxjy@none
+ \bxjy@error{The command is invalid in dvips mode}\@eha
+ \else
+ \@for\bxjy@x:={#1}\do{%
+ \ifx @#2@\@namedef{bxjy@FS/\bxjy@x}{#3}%
+ \else \@namedef{bxjy@FS/\bxjy@x}{:#2:#3}%
+ \fi}%
+ \fi}
+\@for\bxjy@x:={%
+ mnr,mnb,gtr,gtb,gtx,gtu,mgr%
+}\do{\@namedef{bxjy@FS/\bxjy@x}{}}
+
+%%<*> \begin{uCJK}
+\@ifdefinable{\uCJK}{%
+ \def\uCJK{%
+ \bxjy@set@genfam
+ \CJK{UTF8}{\bxjy@genfam}}
+ \let\enduCJK\endCJK
+}
+%%<*> \begin{uCJK*}
+\@ifdefinable{\uCJK*}{%
+ \csdef{uCJK*}{%
+ \bxjy@set@genfam
+ \CJK{UTF8}{\bxjy@genfam}}
+ \cslet{enduCJK*}\endCJK
+}
+
+%%<*> \setCJKfamilydefault{<fam>}
+%\newif\ifbxjy@default@set
+\newrobustcmd*\setCJKfamilydefault[1]{%
+ \bxjy@default@settrue
+ \CJKencfamily{UTF8}{#1}}
+\AtEndOfPackage{%
+ \bxjy@default@setfalse}
+
+%% \bxjy@set@genfam
+\def\bxjy@set@genfam{%
+ \bxjy@okfalse
+ \edef\bxjy@tmpa{\f@family}%
+ \edef\bxjy@tmpb{\sfdefault}%
+ \ifx\bxjy@tmpa\bxjy@tmpb \bxjy@oktrue \fi
+ \edef\bxjy@tmpb{\ttdefault}%
+ \ifx\bxjy@tmpa\bxjy@tmpb \bxjy@oktrue \fi
+ \edef\bxjy@genfam{\ifbxjy@ok \gtdefault \else \mcdefault \fi}}
+
+%% autotilde
+\EveryCJKUse{%
+ \ifbxjy@autotilde \CJKtilde \fi}
+
+%%<*> \CJKecglue
+\unless\ifdefined\CJKecglue
+ \def\CJKtilde{%
+ \CJK@global\def~{\CJKecglue\ignorespaces}}
+ \def\CJKecglue{\hspace{0.25em plus 0.125em minus 0.08em}}
+\fi
+
+%%<*> \>
+\def\bxjy@tmpa{\mskip\medmuskip}
+\ifx\>\bxjy@tmpa
+ \def\>{\ifmmode\mskip\medmuskip\else \CJKecglue\ignorespaces \fi}
+\fi
+
+%--------------------------------------- something Unicode
+
+%% \bxjy@pick@char\CSnext\CSexit
+\def\bxjy@pick@char#1#2{%
+ \let\bxjy@pc@next#1\let\bxjy@pc@exit#2%
+ \futurelet\bxjy@pc@tok\bxjy@pick@char@a
+}
+\def\bxjy@pick@char@a{%
+ \bxjy@cond\ifcat\noexpand\bxjy@pc@tok\relax\fi{%
+ \bxjy@pick@char@b
+ }{\bxjy@pc@exit}%
+}
+\chardef\bxjy@csta="C0
+\def\bxjy@pick@char@b#1{%
+ \bxjy@cond{\ifnum0\ifcat\noexpand#1\noexpand~%
+ \ifnum`#1<\bxjy@csta\else1\fi\fi =\@ne}\fi{%
+ \begingroup
+ \let\UTFviii@two@octets\bxjy@pcseq@two
+ \let\UTFviii@three@octets\bxjy@pcseq@three
+ \let\UTFviii@four@octets\bxjy@pcseq@four
+ \let\CJK@@@\bxjy@pcseq@cjk
+ \expandafter\bxjy@pick@char@c\romannumeral-`>#1%
+ }{\bxjy@pc@exit#1}%
+}
+\def\bxjy@pick@char@c#1\bxjy@end{%
+ \endgroup
+ \edef\bxjy@tmpa{{#1}}%
+ \expandafter\bxjy@pc@next\bxjy@tmpa
+}
+
+%% \bxjy@pcseq@two
+\def\bxjy@pcseq@two#1#2{#1\string#2\bxjy@end}
+\def\bxjy@pcseq@three#1#2#3{#1\string#2\string#3\bxjy@end}
+\def\bxjy@pcseq@four#1#2#3#4{#1\string#2\string#3\string#4\bxjy@end}
+\def\bxjy@pcseq@cjk#1\expandafter#2#3#4#5#6#7#8#9\fi{%
+ \csname bxjy@X/\string#4\expandafter\endcsname\string#8}
+\@namedef{bxjy@X/\string\CJK@XX}{\bxjy@pcseq@two}
+\@namedef{bxjy@X/\string\CJK@XXX}{\bxjy@pcseq@three}
+\@namedef{bxjy@X/\string\CJK@XXXX}{\bxjy@pcseq@four}
+
+%% \bxjy@pick@cseq\CS
+\def\bxjy@pick@cseq#1#2{%
+ \def\bxjy@pcs@do##1{#1{##1}\bxjy@pick@cseq@a}%
+ \bxjy@pick@cseq@a#2\bxjy@pcs@end
+}
+\def\bxjy@pick@cseq@a{\bxjy@pick@char\bxjy@pcs@do\bxjy@pcs@exit}
+\def\bxjy@pcs@exit#1\bxjy@pcs@end{}
+
+%%<*> \UTF{<hex-number>}
+\newcommand*\UTF[1]{%
+ \edef\bxjy@tmpa{#1}%
+ \expandafter\bxjy@utf@a\bxjy@tmpa\bxjy@mark000000\bxjy@end}
+\def\bxjy@utf@a#1#2#3#4#5#6#7#8\bxjy@end{%
+ \bxjy@utf@b#1#2#3#4#5#6#7\bxjy@end}
+\def\bxjy@utf@b#1\bxjy@mark#2\bxjy@end{%
+ \uppercase{\bxjy@utf@c#2#1}\bxjy@end}
+\def\bxjy@utf@c#1#2#3#4#5#6\bxjy@end{%
+ \Unicode{"#1#2#3#4}{"#5#6}}
+
+%%<*> \CJKforce{<kanji>...}
+\newcommand*\CJKforce[1]{%
+ \let\bxjy@cjkforce@do\bxjy@cjkforce@a
+ \bxjy@pick@cseq\bxjy@cjk@force{#1}%
+}
+\def\bxjy@cjkforce@a#1#2#3{%
+ \ifx#1\relax\else \let#2#1\let#1\relax \fi
+}
+%%<*> \CJKunforce{<kanji>...}
+\newcommand*\CJKunforce[1]{%
+ \let\bxjy@cjkforce@do\bxjy@cjkunforce@a
+ \bxjy@pick@cseq\bxjy@cjk@force{#1}%
+}
+\def\bxjy@cjkunforce@a#1#2#3{%
+ \ifx#1\relax \let#1#2\fi
+}
+\def\bxjy@cjk@force#1{%
+ \expandafter\bxjy@cjkforce@do
+ \csname u8:#1\expandafter\endcsname
+ \csname bxjy@U/#1\endcsname{#1}%
+}
+
+%%<*> \CJKforced{<kanji>}
+\@ifdefinable{\CJKforced}{%
+ \protected\def\CJKforced#1{% drop braces
+ \bxjy@pick@char\bxjy@cjkforced\relax#1%
+ }
+ \def\bxjy@cjkforced#1{%
+ \scantokens{\def\x{#1}\relax}% make active again
+ \begingroup
+ \expandafter\let\csname u8:#1\endcsname\relax \x
+ \endgroup
+ }
+ \let\bxjy@org@at\@
+ \protected\def\@{\bxjy@at@a}
+}
+
+%%<*> \@
+\def\bxjy@at@a{%
+ \futurelet\bxjy@tok\bxjy@at@b
+}
+\def\bxjy@at@b{%
+ \bxjy@cond\ifcat\noexpand\bxjy@tok.\fi{\bxjy@org@at}{%
+ \bxjy@cond\ifcat\noexpand\bxjy@tok\@sptoken\fi{\bxjy@org@at}{%
+ \bxjy@cond\ifcat\noexpand\bxjy@tok\bgroup\fi{\CJKforced}{%
+ \bxjy@cond\ifcat\noexpand\bxjy@tok\relax\fi{\bxjy@at@c}{%
+ \bxjy@org@at
+ }}}}%
+}
+\def\bxjy@at@c#1{%
+ \bxjy@cond\ifcat\noexpand#1\noexpand~\fi{\CJKforced}{%
+ \bxjy@org@at
+ }#1%
+}
+
+%--------------------------------------- ttfname
+
+%% variables
+\let\bxjy@ttfname@ptn\relax
+\let\bxjy@ttc@info
+
+%% constants
+\begingroup \let\\\@backslashchar
+% The set of allowed characters, all ASCII but the followings:
+% [special in Windwos path name] \ / ? : * " > < |
+% [special in LaTeX] # % ^ { } ~
+\edef\x{[]!$&'()+,.0-9;=@A-Z_`a-z-]}
+\xdef\bxjy@Rx@tp@a{^(\x*)\\*(\x*)$}
+\xdef\bxjy@Rx@tp@b{^.*\\.[Tt][Tt][Ff]$}
+\xdef\bxjy@Rx@tp@c{^(|.*[^0-9])([0-9]{1,5})([^0-9]*)$}
+\xdef\bxjy@Rx@fn@a{^(.*)\\.\\w+$}
+\xdef\bxjy@Rx@fn@b{^.*\\.[Tt][Tt][Cc]$}
+\endgroup
+
+%% \bxjy@set@match\CS{<number>}
+\@onlypreamble\bxjy@set@match
+\def\bxjy@set@match#1#2{%
+ \expandafter\bxjy@set@match@a\pdflastmatch#2\relax#1}
+\@onlypreamble\bxjy@set@match@a
+\def\bxjy@set@match@a#1>#2\relax#3{\def#3{#2}}
+
+%% \bxjy@set@ttfname@ptn
+% Sets \bxjy@ttfname@ptn.
+\@onlypreamble\bxjy@set@ttfname@ptn
+\def\bxjy@set@ttfname@ptn{%
+ \begingroup
+ \let\bxjy@ttfname@ptn\relax
+ \ifnum\pdfmatch{\bxjy@Rx@tp@a}{\bxjy@ttfname}>\z@
+ \bxjy@set@match\bxjy@ptnA{1}\bxjy@set@match\bxjy@ptnBC{2}%
+ \ifnum\pdfmatch{\bxjy@Rx@tp@b}{\bxjy@ptnBC}=\z@
+ \edef\bxjy@ptnBC{\bxjy@ptnBC.ttf}%
+ \fi
+ \ifnum\pdfmatch{\bxjy@Rx@tp@c}{\bxjy@ptnBC}>\z@
+ \bxjy@set@match\bxjy@ptnB{1}\bxjy@set@match\bxjy@ptnC{3}%
+ \bxjy@set@match\bxjy@ptnN{2}%
+ \xdef\bxjy@ttfname@ptn{%
+ {\bxjy@ptnA}{\bxjy@ptnB}{\bxjy@ptnC}{\bxjy@ptnN}}%
+ \fi
+ \fi
+ \ifx\bxjy@ttfname@ptn\relax
+ \@latex@warning@no@line
+ {Option 'ttfname' has an invalid value:\MessageBreak
+ "\bxjy@ttfname"}%
+ \fi
+ \endgroup}
+
+%% \bxjy@make@ttfname\CS{<ttc-name>}{<number>}
+\@onlypreamble\bxjy@make@ttfname
+\def\bxjy@make@ttfname{%
+ \expandafter\bxjy@make@ttfname@a\bxjy@ttfname@ptn}
+\@onlypreamble\bxjy@make@ttfname@a
+\def\bxjy@make@ttfname@a#1#2#3#4#5#6#7{%
+ \numdef\bxjy@tmpa{#4+#7}\numdef\bxjy@tmpb{1#4-#4}%
+ \ifnum\bxjy@tmpa<\bxjy@tmpb
+ \numdef\bxjy@tmpa{\bxjy@tmpa+\bxjy@tmpb}%
+ \edef\bxjy@tmpa{\expandafter\@gobble\bxjy@tmpa}%
+ \fi
+ \edef\bxjy@tmpb{\detokenize{#6}}%
+ \ifnum\pdfmatch{\bxjy@Rx@fn@a}{\bxjy@tmpb}>\z@
+ \bxjy@set@match\bxjy@tmpb{1}%
+ \fi
+ \edef#5{#1\bxjy@tmpb#2\bxjy@tmpa#3}}
+
+%% set the pattern
+\unless\ifx\bxjy@ttfname\@empty
+ \ifdefined\pdfmatch
+ \bxjy@set@ttfname@ptn
+ \else
+ \bxjy@error
+ {Option 'ttfname' cannot be used because your\MessageBreak
+ pdfTeX engine is too old}\@ehc
+ \fi
+\fi
+
+%% \bxjy@modify@fontname
+\@onlypreamble\bxjy@modify@fontname
+\def\bxjy@modify@fontname{%
+ \bxly@check@ttc\FONT
+ \unless\ifx\bxjy@ttc@info\relax
+ \ifx\bxjy@ttfname@ptn\relax
+ \bxjy@error{pdfTeX does not support TTC}\@eha
+ \else
+ \edef\bxjy@tmpa{\noexpand\FONT\bxjy@ttc@info}%
+ \expandafter\bxjy@make@ttfname\bxjy@tmpa
+ \fi
+ \fi}
+
+%% \bxly@check@ttc{<name>}
+\@onlypreamble\bxly@check@ttc
+\ifdefined\pdfmatch
+\def\bxly@check@ttc#1{%
+ \ifnum\pdfmatch{^:([0-9]+):(.*)}{#1}>\z@
+ \bxjy@set@match\bxjy@tmpa{1}\bxjy@set@match\bxjy@tmpb{2}%
+ \edef\bxjy@ttc@info{{\bxjy@tmpb}{\bxjy@tmpa}}%
+ \else\ifnum\pdfmatch{\bxjy@Rx@fn@b}{#1}>\z@
+ \edef\bxjy@ttc@info{{#1}{0}}%
+ \else\let\bxjy@ttc@info\relax
+ \fi\fi}
+\else
+\def\bxjy@check@ttc#1{\let\bxjy@ttc@info\relax}
+\fi
+
+%--------------------------------------- fontmap internals
+
+%% \bxjy@noembed
+\def\bxjy@noembed{*}
+
+%% \bxjy@cmap@embed/\bxjy@cmap@noembed
+\def\bxjy@cmap@embed{unicode}
+\def\bxjy@cmap@noembed{UniJIS2004-UTF16-H}
+
+%% \bxjy@NEF/<sym>
+\def\bxjy@do#1#2{%
+ \def\bxjy@tmpb{#2}%
+ \@for\bxjy@tmpa:=#1\do{%
+ \cslet{bxjy@NEF/\bxjy@tmpa}\bxjy@tmpb}}
+\bxjy@do{mnr,mnb}{Ryumin-Light}
+\bxjy@do{gtr,gtb,gtx,gtu,mgr}{GothicBBB-Medium}
+
+%% \bxjy@addtospec{<id>}
+\@onlypreamble\bxjy@addtospec
+\def\bxjy@addtospec#1{%
+ \begingroup
+ \let\Entry\bxjy@Entry\let\ \space
+ \@nameuse{bxjy@ME/#1}%
+ \endgroup}
+\@onlypreamble\bxjy@Entry
+\def\bxjy@Entry#1{%
+ \letcs\FONT{bxjy@FS/#1}%
+ \ifx\FONT\bxjy@noembed
+ \let\unicode\bxjy@cmap@noembed
+ \edef\FONT{!\@nameuse{bxjy@NEF/#1}}%
+ \else\unless\ifx\FONT\@empty
+ \let\unicode\bxjy@cmap@embed
+ \fi\fi
+ \ifx\FONT\@empty \expandafter\@gobble
+ \else \expandafter\bxjy@entry@sub \fi}
+\ifx\bxjy@driver\bxjy@dvipdfmx
+ \def\bxjy@entry@sub#1{%<tfm-spec>
+ \xappto\bxjy@spec{%
+ \noexpand\special{pdf:mapline #1 \unicode\ \FONT}}}
+ \let\bxjy@spec\@empty
+\else\ifx\bxjy@driver\bxjy@pdftex
+ \def\bxjy@entry@sub#1{%<tfm-spec>
+ \bxjy@modify@fontname
+ \unless\ifx\FONT\relax \pdfmapline{=#1 <\FONT}\fi}
+\else % invalid in dvips
+\fi\fi
+
+%--------------------------------------- map entry definitions
+
+%% \bxjy@mapentry{<id>}{<text>}
+\def\bxjy@mapentry#1{%
+ \expandafter\bxjy@mapentry@a\csname bxjy@ME/#1\endcsname}
+\def\bxjy@mapentry@a#1{\@onlypreamble#1\def#1}
+
+%% the map entries
+\bxjy@mapentry{STDU}{% (uniweight)
+\Entry{mnr}{unisong@Unicode@}%
+\Entry{gtu}{unihei@Unicode@}%
+\Entry{mgr}{unikai@Unicode@}%
+}
+\bxjy@mapentry{STDM}{% (nouniweight)
+\Entry{mnr}{unisong@Unicode@}%
+\Entry{mnb}{unili@Unicode@}%
+\Entry{gtr}{unihei@Unicode@}%
+\Entry{gtb}{uniyou@Unicode@}%
+\Entry{gtx}{unifs@Unicode@}%
+\Entry{mgr}{unikai@Unicode@}%
+}
+
+%--------------------------------------- NFSS declarations
+
+%%<*> \mcdefault/\gtdefault/\mgdefault
+\providecommand{\mcdefault}{mc}
+\providecommand{\gtdefault}{gt}
+\providecommand{\mgdefault}{mg}
+
+%%<*> \mcfamily/\gtfamily/\mgfamily
+\newrobustcmd*{\mcfamily}{%
+ \not@math@alphabet\mcfamily\relax
+ \CJKfamily{\mcdefault}}
+\newrobustcmd*{\gtfamily}{%
+ \not@math@alphabet\mcfamily\relax
+ \CJKfamily{\gtdefault}}
+\newrobustcmd*{\mgfamily}{%
+ \not@math@alphabet\mcfamily\relax
+ \CJKfamily{\mgdefault}}
+
+%% \bxjy@normalafont
+\letcs\bxjy@normalafont{normalfont }
+
+%% Add patches to \rmfamily, etc.
+\csappto{rmfamily }{%
+ \CJKfamily{\mcdefault}}
+\csappto{sffamily }{%
+ \CJKfamily{\gtdefault}}
+\csappto{ttfamily }{%
+ \CJKfamily{\gtdefault}}
+\csappto{normalfont }{%
+ \CJKfamily{}}
+
+%%<*> \ebseries
+\ifx f\bxjy@oneweight
+ \providerobustcmd*{\ebseries}{%
+ \not@math@alphabet\ebseries\relax
+ \fontseries\ebdefault\selectfont}
+ \providecommand{\ebdefault}{eb}
+\fi
+\protected\def\CJKbold{\CJK@bold@true}
+\protected\def\CJKnormal{\CJK@bold@false}
+
+%% \bxjy@decl@series
+\@onlypreamble\bxjy@decl@series
+\def\bxjy@decl@series#1#2#3{%
+\DeclareFontShape{C70}{#1}{#2}{n}{<->#3}{\CJKnormal}%
+\DeclareFontShape{C70}{#1}{#2}{sl}{<->CJKssub*#1/#2/n}{\CJKnormal}%
+\DeclareFontShape{C70}{#1}{#2}{it}{<->CJKssub*#1/#2/n}{\CJKnormal}%
+\DeclareFontShape{C70}{#1}{#2}{sc}{<->CJKssub*#1/#2/n}{\CJKnormal}}
+%% \bxjy@decl@family
+\@onlypreamble\bxjy@decl@family
+\def\bxjy@decl@family#1#2#3#4{%
+\DeclareFontFamily{C70}{#1}{\hyphenchar\font\m@ne}%
+\bxjy@decl@series{#1}{m}{#2}%
+\bxjy@decl@series{#1}{bx}{#3}%
+\bxjy@decl@series{#1}{b}{CJKssub*#1/bx/n}%
+\bxjy@decl@series{#1}{eb}{#4}}
+
+%% the declarations
+\def\bxjy@sc{sCJK*[\bxjy@scale]}
+\ifx f\bxjy@oneweight
+\bxjy@decl@family{mc}{\bxjy@sc unisong}{\bxjy@sc unili}{CJKssub*mc/bx/n}
+\bxjy@decl@family{gt}{\bxjy@sc unihei}{\bxjy@sc uniyou}{\bxjy@sc unifs}
+\bxjy@decl@family{mg}{\bxjy@sc unikai}{CJKssub*mg/m/n}{CJKssub*mg/m/n}
+\else\ifx t\bxjy@oneweight
+\bxjy@decl@family{mc}{\bxjy@sc unisong}{CJKssub*gt/m/n}{CJKssub*gt/m/n}
+\bxjy@decl@family{gt}{\bxjy@sc unihei}{CJKssub*gt/m/n}{CJKssub*gt/m/n}
+\bxjy@decl@family{mg}{\bxjy@sc unikai}{CJKssub*mg/m/n}{CJKssub*mg/m/n}
+\fi\fi
+
+%% Set default CJK family
+\setCJKfamilydefault{\mcdefault}
+
+%% \bxjy@check@alldefined
+\@onlypreamble\bxjy@check@alldefined
+\def\bxjy@check@alldefined#1{%
+ \bxjy@oktrue
+ \@for\bxjy@x:={#1}\do{%
+ \expandafter\ifx\csname bxjy@FS/\bxjy@x\endcsname\@empty
+ \bxjy@okfalse \fi}}
+%% When no font is selected for a family by \set...font, then thm
+% must be switched to that of ipxex-type1.
+\FirstCJKUse{%
+\bxjy@check@alldefined{mnr,mnb}%
+\unless\ifbxjy@ok
+\bxjy@decl@family{mc}{\bxjy@sc ipxm-r-u}{CJKssub*gt/m/n}{CJKssub*gt/m/n}
+\fi
+\bxjy@check@alldefined{gtr,gtb,gtx}%
+\unless\ifbxjy@ok
+\bxjy@decl@family{gt}{\bxjy@sc ipxg-r-u}{CJKssub*gt/m/n}{CJKssub*gt/m/n}
+\fi
+\bxjy@check@alldefined{mgr}%
+\unless\ifbxjy@ok
+\bxjy@decl@family{mg}{\bxjy@sc ipxg-r-u}{CJKssub*gt/m/n}{CJKssub*gt/m/n}
+\fi
+}
+
+%% \bxjy@force@load@font@fam
+\@onlypreamble\bxjy@force@load@font@fam
+\def\bxjy@force@load@font@fam#1{%
+ \begingroup
+ \def\f@encoding{C70}\let\CJK@enc\f@encoding
+ \edef\f@family{#1}\let\CJK@family\f@family
+ \def\f@series{m}\def\f@shape{n}%
+ \xdef\font@name{\csname\curr@fontshape/\f@size\endcsname}%
+ \let\extract@font\relax \pickup@font
+ \endgroup}
+
+%--------------------------------------- ipaex-type1
+\ifbxjy@ipaex
+
+%% default changed
+\renewcommand{\mcdefault}{ipxm}
+\renewcommand{\gtdefault}{ipxg}
+\renewcommand{\mgdefault}{ipxg}
+
+%% scale applied
+\unless\ifdim\bxjy@scale\p@=\p@
+ \def\bxjy@tmpa#1#2#3{%
+ \bxjy@force@load@font@fam{#1}%
+ \expandafter\ifx\csname C70+#1\endcsname\@empty\else
+ \def\bxjy@tmpb{\DeclareFontShape{C70}{#1}}%
+ \bxjy@tmpb{m}{n}{<->sCJK*[\bxjy@scale]#3-r-u}{}%
+ \ifx t#2%
+ \bxjy@tmpb{m}{sl}{<->sCJK*[\bxjy@scale]#3-ro-u}{}%
+ \bxjy@tmpb{bx}{n}{<->sCJKb*[\bxjy@scale]#3-r-u}{\CJKbold}%
+ \bxjy@tmpb{bx}{sl}{<->sCJKb*[\bxjy@scale]#3-ro-u}{\CJKbold}%
+ \fi
+ \fi}
+ \bxjy@tmpa{ipxm}f{ipxm}%
+ \bxjy@tmpa{ipxg}f{ipxg}%
+ \bxjy@tmpa{ipxma}t{ipxm}%
+ \bxjy@tmpa{ipxga}t{ipxg}%
+\fi
+
+\fi
+%--------------------------------------- subst-mingoth
+\ifbxjy@substmin
+
+%% apply
+\def\bxjy@tmpa#1#2{%
+ \bxjy@force@load@font@fam{#1}%
+ \expandafter\ifx\csname C70+#1\endcsname\@empty\else
+ \def\bxjy@tmpb{\DeclareFontShape{C70}{#1}}%
+ \bxjy@tmpb{l}{n}{<->CJKssub*#2/m/n}{}%
+ \bxjy@tmpb{m}{n}{<->CJKssub*#2/m/n}{}%
+ \bxjy@tmpb{bx}{n}{<->CJKssub*#2/bx/n}{\CJKbold}%
+ \fi}
+\bxjy@tmpa{min}{mc}%
+\bxjy@tmpa{goth}{gt}%
+\bxjy@tmpa{maru}{mg}%
+
+\fi
+%--------------------------------------- bold-by-embolden
+\ifbxjy@boldbyembolden %<*boldbyembolden>
+
+%<*>\CJKboldbyembolden/\CJKnoboldbyembolden
+%\newif\ifbxjy@byembolden
+\newcommand*{\CJKboldbyembolden}{\bxjy@byemboldentrue}
+\newcommand*{\CJKnoboldbyembolden}{\bxjy@byemboldenfalse}
+\CJKboldbyembolden % initial value
+
+%% \bxjy@pdfliteraldirect{<pdf-text>}
+\ifx\bxjy@driver\bxjy@pdftex
+ \def\bxjy@pdfliteraldirect#1{\pdfliteral page {#1}}
+\else\ifx\bxjy@driver\bxjy@dvipdfmx
+ \def\bxjy@pdfliteraldirect#1{\special{pdf:literal direct #1}}
+\else
+ \bxjy@error{INTERNAL_ERROR(1)}
+\fi\fi
+
+%% \bxjy@embolden
+\def\bxjy@bsfactor{1.68}
+\def\bxjy@bswd;{\strip@pt\dimexpr\bxjy@bsfactor
+ \dimexpr\CJKboldshift\relax\relax}
+\def\bxjy@embolden{%
+ \bxjy@pdfliteraldirect{q 2 Tr \bxjy@bswd; w}}
+\def\bxjy@embolden@alt{%
+ \bxjy@pdfliteraldirect{2 Tr \bxjy@bswd; w}}
+%% \bxjy@noembolden
+\def\bxjy@noembolden{%
+ \bxjy@pdfliteraldirect{Q}}
+\def\bxjy@noembolden@alt{%
+ \bxjy@pdfliteraldirect{0 Tr}}
+
+%% \bxjy@patch@CJKsymbol@CJKvert
+% Patches to CJKvert version of \CJKsymbol.
+\@onlypreamble\bxjy@patch@CJKsymbol@CJKvert
+\def\bxjy@patch@CJKsymbol@CJKvert{%
+ \global\let\bxjy@patch@CJKsymbol@CJKvert\relax
+ \bxjy@oktrue
+ \expandafter\patchcmd\csname CJKsymbol \endcsname{%from
+ \ifCJK@bold@ \CJK@temp
+ \hbox to \z@{\hss \raise\CJKboldshift\hbox{\CJK@temp}}%
+ \hbox to \z@{\hss \raise-\CJKboldshift\hbox{\CJK@temp}}%
+ \else \CJK@temp
+ \fi
+ }{%to
+ \ifCJK@bold@\ifbxjy@byembolden
+ \bxjy@embolden@alt
+ \fi\fi
+ \CJK@temp
+ \ifCJK@bold@
+ \ifbxjy@byembolden
+ \bxjy@noembolden@alt
+ \else
+ \hbox to \z@{\hss \raise\CJKboldshift\hbox{\CJK@temp}}%
+ \hbox to \z@{\hss \raise-\CJKboldshift\hbox{\CJK@temp}}%
+ \fi
+ \fi
+ }{}{\bxjy@okfalse}%
+ \expandafter\patchcmd\csname CJKsymbol \endcsname{%from
+ \ifCJK@bold@ \CJK@temp
+ \hbox to \CJKboldshift{\hss\CJK@temp}%
+ \hbox to \CJKboldshift{\hss\CJK@temp}%
+ \else \CJK@temp
+ \fi
+ }{%to
+ \ifCJK@bold@\ifbxjy@byembolden
+ \bxjy@embolden@alt
+ \fi\fi
+ \CJK@temp
+ \ifCJK@bold@
+ \ifbxjy@byembolden
+ \bxjy@noembolden@alt
+ \else
+ \kern-\CJKboldshift\hb@xt@\z@{\hss\CJK@temp}%
+ \kern2\dimexpr\CJKboldshift\relax
+ \hb@xt@\z@{\hss\CJK@temp}\kern-\CJKboldshift\relax
+ \fi
+ \fi
+ }{}{\bxjy@okfalse}%
+ \unless\ifbxjy@ok
+ \bxjy@error{Failure in patching to CJKvert}\@ehc
+ \fi
+}
+%% redefine \CJKsymbol
+\@ifpackageloaded{CJKvert}{%
+ % CJKvert version
+ \bxjy@patch@CJKsymbol@CJKvert
+}{% non-CJKvert version
+ \@namedef{CJKsymbol }#1{%
+ \ifCJK@bold@\ifbxjy@byembolden
+ \bxjy@embolden
+ \fi\fi
+ \symbol{#1}%
+ \ifCJK@bold@
+ \ifbxjy@byembolden
+ \bxjy@noembolden
+ \else
+ \kern-\CJKboldshift\hb@xt@\z@{\hss\symbol{#1}}%
+ \kern2\dimexpr\CJKboldshift\relax
+ \hb@xt@\z@{\hss\symbol{#1}}\kern-\CJKboldshift\relax
+ \fi
+ \fi}%
+}
+
+\else %<*!boldbyembolden>
+% makes \CJK[no]boldbyembolden no-op
+\newcommand*{\CJKboldbyembolden}{}
+\newcommand*{\CJKnoboldbyembolden}{}
+\fi %</boldbyembolden>
+%--------------------------------------- begin-document hook
+
+\ifx\bxjy@driver\bxjy@dvipdfmx %<*dvipdfmx>
+
+%% \bxjy@set@page@hook{<text>}
+\ifbxjy@everypage
+\def\bxjy@set@page@hook#1{%
+ \AtBeginShipout{\setbox\AtBeginShipoutBox=\vbox{%
+ \baselineskip\z@skip\lineskip\z@skip\lineskiplimit\z@
+ #1\copy\AtBeginShipoutBox}}}
+\else
+\let\bxjy@set@page@hook\AtBeginDvi
+\fi
+
+\else %<!*dvipdfmx>
+\let\bxjy@set@page@hook\@gobble
+\fi %</dvipdfmx>
+
+%% The begin-document hook for font mapping
+\AtBeginDocument{%
+ \ifx f\bxjy@oneweight \bxjy@addtospec{STDM}%
+ \else\ifx t\bxjy@oneweight \bxjy@addtospec{STDU}%
+ \fi\fi
+ \bxjy@set@page@hook{\bxjy@spec}%
+}
+
+%% The document hooks for 'whole' option
+\AtBeginDocument{%
+ \unless\ifbxjy@default@set
+ \bxjy@set@genfam
+ \setCJKfamilydefault{\bxjy@genfam}%
+ \fi}
+\ifx t\bxjy@whole
+ \AtBeginDocument{\csuse{CJK*}{UTF8}{}}
+ \AtEndDocument{\clearpage\csuse{endCJK*}}
+\else\ifx p\bxjy@whole
+ \AtBeginDocument{\CJK{UTF8}{}}
+ \AtEndDocument{\clearpage\CJK}
+\fi\fi
+
+%% Invokes first-CJK hook at begin-document
+\AtBeginDocument{\bxjy@first@cjk@use@hook}
+
+%--------------------------------------- PDF-string hack
+
+%%<+> \bxcjkjatypeHyperrefPatchDone
+%% Informs that the patch is applied.
+\let\bxcjkjatypeHyperrefPatchDone=t
+
+%% prepare
+\begingroup
+ \CJK@input{UTF8.bdg}% emerge CJK@UTF8Binding
+\endgroup
+%% register to \pdfstringdefPreHook
+\g@addto@macro\pdfstringdefPreHook{%
+ \@nameuse{CJK@UTF8Binding}% enable UTF8 decoder
+ \ifx~\bxjy@@CJKtilde % \CJKtilde is effective
+ \let\bxjy@org@LetUnexpandableSpace\HyPsd@LetUnexpandableSpace
+ \let\HyPsd@LetUnexpandableSpace\bxjy@LetUnexpandableSpace
+ \let~\@empty
+ \fi
+}
+\def\bxjy@@CJKtilde{\CJKecglue\ignorespaces}
+%% patch to \HyPsd@LetUnexpandableSpace
+\def\bxjy@@tildecmd{~}
+\def\bxjy@LetUnexpandableSpace#1{%
+ \def\bxjy@tmpa{#1}\ifx\bxjy@tmpa\bxjy@@tildecmd\else
+ \bxjy@org@LetUnexpandableSpace#1%
+ \fi
+}
+
+%--------------------------------------- preset font mappings
+
+%% \bxjy@declare@preset{<name>}{<text>}
+\def\bxjy@declare@preset#1{%
+ \expandafter\bxjy@decl@preset@a\csname bxjy@the@preset@#1\endcsname}
+\def\bxjy@decl@preset@a#1{\@onlypreamble#1\def#1}
+
+%% \bxjy@declare@preset@alias{<name1>}{<name2>}
+\def\bxjy@declare@preset@alias#1#2{%
+ \expandafter\bxjy@decl@preset@alias@a\csname bxjy@the@preset@#1%
+ \expandafter\endcsname\csname bxjy@the@preset@#2\endcsname}
+\def\bxjy@decl@preset@alias@a#1#2{\@onlypreamble#1\let#1#2}
+
+%% \bxjy@uniweight{<font-mn>}{<font-gt>}
+\@onlypreamble\bxjy@uniweight
+\def\bxjy@uniweight#1#2{%
+ \setminchofont{#1}\setgothicfont{#2}\setmarugothicfont{#2}}
+
+%% \bxjy@multiweight{<font-mnl>}{<font-mnr>}{<font-mnb>}
+%% {<font-gtr>}{<font-gtb>}{<font-gtx>}{<font-gtu>}{<font-mgr>}
+\@onlypreamble\bxjy@multiweight
+\def\bxjy@multiweight#1#2#3#4#5#6#7#8{%
+ \setminchofont{#2}\setgothicfont{#7}\setmarugothicfont{#8}%
+ \ifx f\bxjy@oneweight
+ \setboldminchofont{#3}% #1 ignored
+ \setmediumgothicfont{#4}\setboldgothicfont{#5}\setxboldgothicfont{#6}%
+ \fi}
+
+%% \bxjy@use@preset{<name>}
+\def\bxjy@use@preset#1{%
+ \csname bxjy@the@preset@#1\endcsname}
+
+%% for compatibility
+\def\bxjy@MI{:0:}
+\let\bxjy@enable@switch@realfont\relax
+\let\usecmapforalphabet\relax
+
+%%%% definitions of main preset mappings
+%(uniweight)
+\bxjy@declare@preset{ms}{%
+ \bxjy@uniweight{:0:msmincho.ttc}{:0:msgothic.ttc}}
+\bxjy@declare@preset{ipa}{%
+ \bxjy@uniweight{ipam.ttf}{ipag.ttf}}
+\bxjy@declare@preset{ipaex}{%
+ \bxjy@uniweight{ipaexm.ttf}{ipaexg.ttf}}
+%(multiweight)
+\bxjy@declare@preset{ms-hg}{%
+ \bxjy@multiweight{:0:msmincho.ttc}{:0:msmincho.ttc}{:0:hgrme.ttc}%
+ {:0:hgrgm.ttc}{:0:hgrge.ttc}{:0:hgrsgu.ttc}{:0:msgothic.ttc}{hgrsmp.ttf}}
+\bxjy@declare@preset{ipa-hg}{%
+ \bxjy@multiweight{ipam.ttf}{ipam.ttf}{:0:hgrme.ttc}%
+ {:0:hgrgm.ttc}{:0:hgrge.ttc}{:0:hgrsgu.ttc}{ipag.ttf}{hgrsmp.ttf}}
+\bxjy@declare@preset{moga-mobo}{%
+ \bxjy@enable@switch@realfont
+ \bxjy@multiweight{\bxjy@MI mogam.ttc}{\bxjy@MI mogam.ttc}%
+ {\bxjy@MI mogamb.ttc}{\bxjy@MI mogag.ttc}{\bxjy@MI mogagb.ttc}%
+ {\bxjy@MI mogagb.ttc}{\bxjy@MI mogag.ttc}{\bxjy@MI mobog.ttc}}
+\bxjy@declare@preset{moga-maruberi}{%
+ \bxjy@enable@switch@realfont
+ \bxjy@multiweight{\bxjy@MI mogam.ttc}{\bxjy@MI mogam.ttc}%
+ {\bxjy@MI mogamb.ttc}{\bxjy@MI mogag.ttc}{\bxjy@MI mogagb.ttc}%
+ {\bxjy@MI mogagb.ttc}{\bxjy@MI mogag.ttc}{MTLmr3m.ttf}}
+\bxjy@declare@preset{kozuka-pro}{%
+ \usecmapforalphabet
+ \bxjy@multiweight{KozMinPro-Light.otf}{KozMinPro-Regular.otf}%
+ {KozMinPro-Bold.otf}{KozGoPro-Regular.otf}{KozGoPro-Bold.otf}%
+ {KozGoPro-Heavy.otf}{KozGoPro-Medium.otf}{KozGoPro-Heavy.otf}}
+\bxjy@declare@preset{kozuka-pr6}{%
+ \usecmapforalphabet
+ \bxjy@multiweight{KozMinProVI-Light.otf}{KozMinProVI-Regular.otf}%
+ {KozMinProVI-Bold.otf}{KozGoProVI-Regular.otf}{KozGoProVI-Bold.otf}%
+ {KozGoProVI-Heavy.otf}{KozGoProVI-Medium.otf}{KozGoProVI-Heavy.otf}}
+\bxjy@declare@preset{kozuka-pr6n}{%
+ \usecmapforalphabet
+ \bxjy@multiweight{KozMinPr6N-Light.otf}{KozMinPr6N-Regular.otf}%
+ {KozMinPr6N-Bold.otf}{KozGoPr6N-Regular.otf}{KozGoPr6N-Bold.otf}%
+ {KozGoPr6N-Heavy.otf}{KozGoPr6N-Medium.otf}{KozGoPr6N-Heavy.otf}}
+\bxjy@declare@preset{hiragino-pro}{%
+ \usecmapforalphabet
+ \bxjy@multiweight{HiraMinPro-W2.otf}{HiraMinPro-W3.otf}%
+ {HiraMinPro-W6.otf}{HiraKakuPro-W3.otf}{HiraKakuPro-W6.otf}%
+ {HiraKakuStd-W8.otf}{HiraKakuPro-W6.otf}{HiraMaruPro-W4.otf}}
+\bxjy@declare@preset{hiragino-pron}{%
+ \usecmapforalphabet
+ \bxjy@multiweight{HiraMinProN-W2.otf}{HiraMinProN-W3.otf}%
+ {HiraMinProN-W6.otf}{HiraKakuProN-W3.otf}{HiraKakuProN-W6.otf}%
+ {HiraKakuStdN-W8.otf}{HiraKakuProN-W6.otf}{HiraMaruProN-W4.otf}}
+\bxjy@declare@preset{morisawa-pro}{%
+ \usecmapforalphabet
+ \bxjy@multiweight{A-OTF-RyuminPro-Light.otf}{A-OTF-RyuminPro-Light.otf}%
+ {A-OTF-FutoMinA101Pro-Bold.otf}{A-OTF-GothicBBBPro-Medium.otf}%
+ {A-OTF-FutoGoB101Pro-Bold}{A-OTF-MidashiGoPro-MB31.otf}%
+ {A-OTF-GothicBBBPro-Medium.otf}{A-OTFJun101Pro-Light.otf}}
+\bxjy@declare@preset{morisawa-pr6n}{%
+ \usecmapforalphabet
+ \bxjy@multiweight{A-OTF-RyuminPr6N-Light.otf}{A-OTF-RyuminPr6N-Light.otf}%
+ {A-OTF-FutoMinA101Pr6N-Bold.otf}{A-OTF-GothicBBBPr6N-Medium.otf}%
+ {A-OTF-FutoGoB101Pr6N-Bold}{A-OTF-MidashiGoPr6N-MB31.otf}%
+ {A-OTF-GothicBBBPr6N-Medium.otf}{A-OTFJun101Pr6N-Light.otf}}
+
+%% ... and invokes the specified one!
+\ifx\bxjy@main@preset\relax\else
+\bxjy@use@preset{\bxjy@main@preset}
+\fi
+
+%--------------------------------------- all done
+\endinput
+%% EOF
diff --git a/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype-beamer.pdf b/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype-beamer.pdf
new file mode 100644
index 0000000000..cdc9b97afa
--- /dev/null
+++ b/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype-beamer.pdf
Binary files differ
diff --git a/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype-beamer.tex b/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype-beamer.tex
new file mode 100644
index 0000000000..9d73a96425
--- /dev/null
+++ b/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype-beamer.tex
@@ -0,0 +1,76 @@
+% This file is encoded in UTF-8.
+% To be typeset with pdflatex or latex + dvipdfmx.
+\documentclass[12pt]{beamer} % for pdfTeX
+%\documentclass[12pt,dvipdfmx]{beamer} % for dvipdfmx
+\hypersetup{unicode}%← needed to make bookmark text right
+\usepackage[whole]{bxcjkjatype}% needed 'whole'
+%% That's all! You can do 日本語 right now!
+\usetheme{Warsaw}
+%---------------------------------------
+\title{How to do 日本語 with pdf{\TeX}}
+\author{ZR 某}
+\date{某日 of August, 2013}
+%---------------------------------------
+\begin{document}
+
+\begin{frame}
+ \titlepage
+\end{frame}
+
+%---------------------------------------
+\section{日本語 with bxcjkjatype package}
+
+\begin{frame}[fragile]{First}
+ Load the \alert{bxcjkjatype} package in preamble.\par
+ Use of \structure{\texttt{whole}} option is often suitable.\par
+ \begin{exampleblock}{とある Example}
+\begin{verbatim}
+\documentclass[a4paper]{article}
+\usepackage[whole]{bxcjkjatype}
+\end{verbatim}
+ \end{exampleblock}
+\end{frame}
+
+\begin{frame}[fragile]{Second}
+ Write whatever 日本語 text you like in the document body.\par
+ You can use ひらがな, カタカナ, 漢字, and/or
+ any character available in the standard fonts
+ (\structure{IPAex明朝/ゴシック}).\par
+ \begin{exampleblock}{とある Example}
+\begin{verbatim}
+\documentclass[a4paper]{article}
+\usepackage[whole]{bxcjkjatype}
+\begin{document}
+私のホバークラフトは鰻でいっぱいです。
+\end{document}
+\end{verbatim}
+ \end{exampleblock}
+ \structure{※} Must use UTF-8.\par
+\end{frame}
+
+\begin{frame}[fragile]{Third}
+ Compile the document as usual.\par
+
+\begin{verbatim}
+pdflatex sample.tex
+\end{verbatim}
+\end{frame}
+
+\begin{frame}{Last}\relax
+ {\LARGE\alert{完成!}\par}
+ \begin{block}{とある Output}
+ \rmfamily
+ 私のホバークラフトは鰻でいっぱいです。
+ \end{block}
+\end{frame}
+
+%---------------------------------------
+\section{Conclusion (Not!)}
+
+\begin{frame}{おしまい}
+ \transdissolve[duration=0.5]
+ \centering\Large
+ \structure{Happy 日本語 {\TeX}ing!}
+\end{frame}
+
+\end{document}
diff --git a/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype.pdf b/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype.pdf
new file mode 100644
index 0000000000..960978c535
--- /dev/null
+++ b/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype.pdf
Binary files differ
diff --git a/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype.tex b/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype.tex
new file mode 100644
index 0000000000..a7561fbc33
--- /dev/null
+++ b/language/japanese/BX/bxcjkjatype/sample-bxcjkjatype.tex
@@ -0,0 +1,48 @@
+% This file is encoded in UTF-8.
+% (bxcjkjatype supports only UTF-8.)
+% To be typeset with pdflatex, latex + dvipdfmx, or latex + dvips
+\documentclass[a4paper]{article}
+% hyperref may require an explicit driver option
+% (bxcjkjatype does not.)
+%\documentclass[a4paper,dvipdfmx]{article}
+
+% The 'whole' option makes the whole document body wrapped with a
+% CJK* environment.
+\usepackage[whole]{bxcjkjatype}
+
+% After loading the package, you can write 日本語 text, even in the
+% preamble. You can define a macro which includes 日本語.
+\newcommand\Nihongo{日本語}
+
+% You can make PDF files which holds correct CJK text as document
+% information, such as boookmarks.
+\usepackage[unicode,% ←needed to make bookmark text right
+ bookmarks=true,colorlinks=true]{hyperref}
+
+% Here I use Standard fonts (IPAex fonts) for Mincho and Gothic
+% families. For Maru-gothic family, I use "Rounded M+ 1c Regular".
+% (available at http://d.hatena.ne.jp/itouhiro/20120226).
+\setmarugothicfont{rounded-mplus-1c-regular.ttf}
+
+\begin{document}
+% (Now already in a CJK* environment.)
+
+% You can safely put a section heading containing 日本語 letters!
+\section{Preparing 文書 in \Nihongo\ using pdf\TeX}
+The 文書 contains 日本語 and English.
+
+\section{Font selection}
+\begin{itemize}
+% \rmfamily designates Mincho family.
+\item \rmfamily Mincho (明朝) family.
+ % If you have specified a bold Mincho font with
+ % \setboldminchofont, then you will see it working.
+ % \textbf{And bold (太字) version.}
+% \sffamily designates Gothic family.
+\item \sffamily Gothic (ゴシック) family.
+% \mgfamily changes only CJK family, so the alphabetic font
+% family remains unchanged (i.e. in \sffamily).
+\item \mgfamily Maru-gothic (丸ゴシック) family.
+\end{itemize}
+
+\end{document}
diff --git a/language/japanese/BX/bxjatoucs/LICENSE b/language/japanese/BX/bxjatoucs/LICENSE
new file mode 100644
index 0000000000..534324b756
--- /dev/null
+++ b/language/japanese/BX/bxjatoucs/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2019 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
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/language/japanese/BX/bxjatoucs/README.md b/language/japanese/BX/bxjatoucs/README.md
new file mode 100644
index 0000000000..6e2c9bb7bc
--- /dev/null
+++ b/language/japanese/BX/bxjatoucs/README.md
@@ -0,0 +1,97 @@
+BXjatoucs Package
+=================
+
+LaTeX: To convert Japanese character code to Unicode
+
+This package provides function-like (fully-expandable) macros that
+convert a character code value in several Japanese encodings to
+a Unicode value. Supported source encodings are: ISO-2022-JP (jis),
+EUC-JP (euc), Shift_JIS (sjis) and the Adobe-Japan1 glyph set.
+
+### System requirement
+
+ * TeX format: LaTeX and plain TeX.
+ * TeX engine: Anything that has e-TeX extension.
+ * Dependent packages:
+ - infwarerr
+ - ltxcmds
+
+### Installation
+
+ - `*.sty` → $TEXMF/tex/latex/bxjatoucs
+ - `*.tfm` → $TEXMF/fonts/tfm/public/bxjatoucs
+
+### License
+
+This package is distributed under the MIT License.
+
+
+The bxjatoucs Package ― main
+-----------------------------
+
+### Package Loading
+
+In plain TeX:
+
+ \input bxjatoucs.sty
+
+In LaTeX:
+
+ \usepackage{bxjatoucs}
+
+### Usage
+
+All the macros take an argument that forms a valid number and represents
+the input code value, and expands (in two steps) to the string that
+represents the output Unicode scalar value in decimal.
+
+ - `\bxjaJisToUcs{<value>}`: converts from a jis scalar value.
+ - `\bxjaEucToUcs{<value>}`: converts from an euc scalar value.
+ - `\bxjaSjisToUcs{<value>}`: converts from a sjis scalar value.
+ - `\bxjaCidToUcs{<value>}`: converts from an AJ1 CID value.
+
+There are variants that return in hexadecimal (zero-padded to at least
+four digits):
+
+ - `\bxjaJisToUcsHex{<value>}`
+ - `\bxjaEucToUcsHex{<value>}`
+ - `\bxjaSjisToUcsHex{<value>}`
+ - `\bxjaCidToUcsHex{<value>}`
+
+Note: These macros return zero (decimal `0` and hexadecimal `0000`)
+if the input number is out of the valid range of source encoding.
+If the input is malformed, the macros issue an error `Missing number`
+and then return zero.
+
+Additional variants:
+
+ - `\bxjaFastCidToUcs{<value>}`: same as `bxjaCidToUcs`, except that
+ the argument is assumed to be a valid decimal string.
+ - `\bxjaFastCidToUcsHex{<value>}`: same for `\bxjaCidToUcsHex`.
+
+## Example
+
+The following `\message` lines all display `23551:21496`.
+
+ \message{\bxjaJisToUcs{"3C77}:\bxjaJisToUcs{"3B4A}}
+ \message{\bxjaEucToUcs{"BCF7}:\bxjaEucToUcs{"BBCA}}
+ \message{\bxjaSjisToUcs{"8EF5}:\bxjaSjisToUcs{"8E69}}
+ \message{\bxjaCidToUcs{2339}:\bxjaCidToUcs{2200}}
+
+The following `\message` lines all display `5BFF:53F8`.
+
+ \message{\bxjaJisToUcsHex{"3C77}:\bxjaJisToUcsHex{"3B4A}}
+ \message{\bxjaEucToUcsHex{"BCF7}:\bxjaEucToUcsHex{"BBCA}}
+ \message{\bxjaSjisToUcsHex{"8EF5}:\bxjaSjisToUcsHex{"8E69}}
+ \message{\bxjaCidToUcsHex{2339}:\bxjaCidToUcsHex{2200}}
+
+
+Revision History
+----------------
+
+ * Version 0.2 ‹2019/10/20›
+ - The first public version.
+
+--------------------
+Takayuki YATO (aka. "ZR")
+https://github.com/zr-tex8r
diff --git a/language/japanese/BX/bxjatoucs/bxjatoucs-cid.tfm b/language/japanese/BX/bxjatoucs/bxjatoucs-cid.tfm
new file mode 100644
index 0000000000..a2ff5dca2c
--- /dev/null
+++ b/language/japanese/BX/bxjatoucs/bxjatoucs-cid.tfm
Binary files differ
diff --git a/language/japanese/BX/bxjatoucs/bxjatoucs-jis.tfm b/language/japanese/BX/bxjatoucs/bxjatoucs-jis.tfm
new file mode 100644
index 0000000000..1c724cd7d5
--- /dev/null
+++ b/language/japanese/BX/bxjatoucs/bxjatoucs-jis.tfm
Binary files differ
diff --git a/language/japanese/BX/bxjatoucs/bxjatoucs.sty b/language/japanese/BX/bxjatoucs/bxjatoucs.sty
new file mode 100644
index 0000000000..b387872640
--- /dev/null
+++ b/language/japanese/BX/bxjatoucs/bxjatoucs.sty
@@ -0,0 +1,292 @@
+%%
+%% This is file 'bxjatoucs.sty'.
+%%
+%% Copyright (c) 2019 Takayuki YATO (aka. "ZR")
+%% GitHub: https://github.com/zr-tex8r
+%% Twitter: @zr_tex8r
+%%
+%% This package is distributed under the MIT License.
+%%
+%
+%% avoid multiple loading
+\csname\if11bxjatoucsLoaded\fi\endcsname
+%% code guards
+\edef\bxjatoucsLoaded{%
+\catcode32=\the\catcode32%
+\catcode34=\the\catcode34%
+\catcode43=\the\catcode43%
+\catcode45=\the\catcode45%
+\catcode46=\the\catcode46%
+\catcode47=\the\catcode47%
+\catcode58=\the\catcode58%
+\catcode60=\the\catcode60%
+\catcode62=\the\catcode62%
+\catcode63=\the\catcode63%
+\catcode64=\the\catcode64%
+\catcode96=\the\catcode96%
+\relax}
+\catcode32=10\relax
+\catcode34=12 % <">
+\catcode43=12 % <+>
+\catcode45=12 % <->
+\catcode46=12 % <.>
+\catcode47=12 % </>
+\catcode58=12 % <:>
+\catcode60=12 % <<>
+\catcode62=12 % <>>
+\catcode63=12 % <?>
+\catcode64=11 % <@>
+\catcode96=12 % <`>
+\edef\bxju@restore@codes{\bxjatoucsLoaded
+ \noexpand\let\noexpand\bxju@restore@codes\relax}
+\def\bxjatoucsLoaded{\endinput}
+
+%% check for LaTeX
+\ifx\RequirePackage\@undefined %<*!LaTeX>
+ \let\bxju@latex=f
+ \long\def\bxju@next#1\ProvidesPackage#2[#3]{%
+ \immediate\write-1{Package: #2 #3}}
+ \expandafter\bxju@next
+\else %<*LaTeX>
+ \let\bxju@latex=t
+\fi %</LaTeX>
+
+%% package declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bxjatoucs}[2019/10/20 v0.2]
+\def\bxju@pkgname{bxjatoucs}
+
+%--------------------------------------- "check-avail"
+
+\let\bxju@bad\@undefined
+\ifx\bxjatoucsCheckAvail\@undefined\else \if t\bxju@latex
+ \IfFileExists{ltxcmds.sty}{}{\let\bxju@bad=t}
+ \IfFileExists{infwarerr.sty}{}{\let\bxju@bad=t}
+\fi\fi
+\ifx t\bxju@bad
+ \expandafter\let\csname ver@\bxju@pkgname.sty\endcsname\@undefined
+ \expandafter\let\csname \bxju@pkgname Loaded\endcsname\@undefined
+\bxju@restore@codes\endinput\fi
+
+%--------------------------------------- general
+
+\if t\bxju@latex %-------<*LaTeX>
+
+%% packages
+\RequirePackage{ltxcmds}[2010/12/12]% v1.15
+\RequirePackage{infwarerr}[2010/04/08]% v1.3
+%% \bxju@ifdefinable
+\let\bxju@ifdefinable\@ifdefinable
+
+\else %-------<*!LaTeX>
+
+%% package
+\input ltxcmds.sty
+\input infwarerr.sty
+%% \bxju@ifdefinable
+\def\bxju@ifdefinable#1{%
+ \ifx#1\@undefined \expandafter\ltx@secondoftwo
+ \else \expandafter\ltx@firstoftwo
+ \fi{%
+ \@PackageError\bxju@pkgname
+ {Command \noexpand#1 already defined}{\@ehd}%
+ }}
+
+\fi %-------</LaTeX>
+
+%% unique tokens
+\def\bxju@end{\bxju@end@}
+\let\bxju@mk\indent % unexpandable
+
+%% \bxju@cond\ifXXX...\fi{<true>}{<false>}
+\ltx@gobbletwo\if\if \def\bxju@cond#1\fi{%
+ #1\expandafter\ltx@firstoftwo \else\expandafter\ltx@secondoftwo \fi}
+
+%% \bxju@cond@both\ifXXX...\fi\ifYYY...\fi{<true>}{<false>}
+\ltx@gobblefour\if\if\if\if \def\bxju@cond@both#1\fi#2\fi{%
+ \bxju@cond{\if #1#2T\else F\fi\else F\fi T}\fi}
+
+%% \bxju@burst-`>...
+\let\bxju@burst\romannumeral
+
+%% check engine
+\ifx\numexpr\@undefined
+ \@PackageError\bxju@pkgname
+ {Not running under e-TeX}{\@ehd}
+\bxju@restore@codes\endinput\fi
+
+%--------------------------------------- user interface
+
+% Each function twice-expands to the unicode codevalue.
+
+%%<*> \bxjaCidToUcs{<cid>}
+\bxju@ifdefinable\bxjaCidToUcs{%
+ \def\bxjaCidToUcs{%
+ \bxju@burst-`>\bxju@cid@to@ucs}}
+%%<*> \bxjaJisToUcs{<jis>}
+\bxju@ifdefinable\bxjaJisToUcs{%
+ \def\bxjaJisToUcs{%
+ \bxju@burst-`>\bxju@jis@to@ucs}}
+%%<*> \bxjaEucToUcs{<euc>}
+\bxju@ifdefinable\bxjaEucToUcs{%
+ \def\bxjaEucToUcs{%
+ \bxju@burst-`>\bxju@euc@to@ucs}}
+%%<*> \bxjaSjisToUcs{<sjis>}
+\bxju@ifdefinable\bxjaSjisToUcs{%
+ \def\bxjaSjisToUcs{%
+ \bxju@burst-`>\bxju@sjis@to@ucs}}
+%%<*> \bxjaFastCidToUcs{<cid>}
+\bxju@ifdefinable\bxjaFastCidToUcs{%
+ \def\bxjaFastCidToUcs{%
+ \bxju@burst-`>\bxju@fast@cid@to@ucs}}
+%%<*> \bxjaFastJscToUcs{<jsc>}
+\bxju@ifdefinable\bxjaFastJscToUcs{%
+ \def\bxjaFastJscToUcs{%
+ \bxju@burst-`>\bxju@fast@jsc@to@ucs}}
+%%<*> \bxjaCidToUcsHex{<cid>}
+\bxju@ifdefinable\bxjaCidToUcsHex{%
+ \def\bxjaCidToUcsHex{%
+ \bxju@burst-`>\bxju@in@hex\bxju@cid@to@ucs}}
+%%<*> \bxjaJisToUcsHex{<jis>}
+\bxju@ifdefinable\bxjaJisToUcsHex{%
+ \def\bxjaJisToUcsHex{%
+ \bxju@burst-`>\bxju@in@hex\bxju@jis@to@ucs}}
+%%<*> \bxjaEucToUcsHex{<euc>}
+\bxju@ifdefinable\bxjaEucToUcsHex{%
+ \def\bxjaEucToUcsHex{%
+ \bxju@burst-`>\bxju@in@hex\bxju@euc@to@ucs}}
+%%<*> \bxjaSjisToUcsHex{<sjis>}
+\bxju@ifdefinable\bxjaSjisToUcsHex{%
+ \def\bxjaSjisToUcsHex{%
+ \bxju@burst-`>\bxju@in@hex\bxju@sjis@to@ucs}}
+%%<*> \bxjaFastCidToUcsHex{<cid>}
+\bxju@ifdefinable\bxjaFastCidToUcsHex{%
+ \def\bxjaFastCidToUcsHex{%
+ \bxju@burst-`>\bxju@in@hex\bxju@fast@cid@to@ucs}}
+%%<*> \bxjaFastJscToUcsHex{<jsc>}
+\bxju@ifdefinable\bxjaFastJscToUcsHex{%
+ \def\bxjaFastJscToUcsHex{%
+ \bxju@burst-`>\bxju@in@hex\bxju@fast@jsc@to@ucs}}
+
+%--------------------------------------- auxiliary
+
+%% \bxju@check@number{<text>}\CScont
+% Checks if the text is a valid number; if invalid, it causes
+% "missing number" error and returns 0; if valid, returns the
+% larger of 0 and the input number (in decimal).
+\def\bxju@check@number#1{%
+ \expandafter\bxju@check@number@a\the\parshapeindent#1\bxju@mk{#1}}
+\begingroup \lccode`?=`p \lowercase{\endgroup
+ \def\bxju@check@number@a#1?}#2#3\bxju@mk{%
+ \ltx@ifempty{#3}{\bxju@check@number@c}{%else
+ \expandafter\bxju@check@number@b\number\bxju@mk}}
+\def\bxju@check@number@b#1\bxju@mk#2#3{#3{#1}}
+\def\bxju@check@number@c#1{%
+ \expandafter\bxju@check@number@d\number#1\bxju@mk}
+\def\bxju@check@number@d#1\bxju@mk#2{%
+ \bxju@cond\ifnum#1>\ltx@zero\fi{#2{#1}}{#2{0}}}
+
+%% \bxju@decomp{<number>}\CScont
+% Divides the <number> by 256 and returns the quotient and
+% the remainder as \CScont{<high>}{<low>}.
+\def\bxju@decomp#1{%
+ \expandafter\bxju@decomp@a\number\dimexpr.00390625\dimexpr#1sp:#1:}
+\def\bxju@decomp@a#1:#2:{%
+ \expandafter\bxju@decomp@b\the\numexpr#2-#1*256:#1:}
+\def\bxju@decomp@b#1:#2:#3{#3{#2}{#1}}
+
+%% \bxju@in@hex\CSconv{<arg>}
+\def\bxju@in@hex#1#2{%
+ \expandafter\bxju@in@hex@a\bxju@burst-`>#1{#2}:>}
+\def\bxju@in@hex@a#1:>{%
+ \bxju@to@hex{#1}}
+
+%% \bxju@to@hex{<number>}
+\def\bxju@to@hex#1{% {N}
+ \bxju@to@hex@a#1:4::}% at least 4 digits
+\def\bxju@to@hex@a#1:#2:#3:{% N:C:H:|
+ \bxju@cond@both\ifnum#1=\ltx@zero\fi\ifnum#2<\ltx@one\fi{#3}{%else
+ \expandafter\bxju@to@hex@b\number\dimexpr.0625\dimexpr#1sp%
+ \expandafter:\the\numexpr#2-1:#1:#3:}}
+\def\bxju@to@hex@b#1:#2:#3:{% Q:C:N:|H:
+ \expandafter\bxju@to@hex@c\the\numexpr#3-#1*16:#2:#1:}
+\def\bxju@to@hex@c#1:{% R:|C:Q:H:
+ \expandafter\expandafter\expandafter\bxju@to@hex@d
+ \csname bxju@H/#1\endcsname:}
+\def\bxju@to@hex@d#1:#2:#3:#4:{% D:C:Q:H:
+ \bxju@to@hex@a#3:#2:#1#4:}
+\begingroup
+ \def\do#1{\expandafter\gdef\csname bxju@H/\number"#1\endcsname{#1}}
+ \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9\do A\do B\do C\do D\do E\do F
+\endgroup
+
+%--------------------------------------- conversions
+
+%% constants
+\mathchardef\bxju@max@cid=23059
+\mathchardef\bxju@minb@jis="21
+\mathchardef\bxju@minb@euc="A1
+\mathchardef\bxju@jisrs=94
+
+%% umbralist fontdefs
+\font\bxju@ul@cid=bxjatoucs-cid
+\font\bxju@ul@jis=bxjatoucs-jis
+
+%% \bxju@cid@to@ucs{<cid>}
+\def\bxju@cid@to@ucs#1{%
+ \bxju@check@number{#1}\bxju@cid@to@ucs@a}
+\def\bxju@cid@to@ucs@a#1{%
+ \bxju@cond\ifnum#1>\bxju@max@cid\fi{0}{%
+ \number\fontdimen\numexpr#1+8\bxju@ul@cid}}
+
+%% \bxju@jis@to@ucs{<jis>}
+\def\bxju@jis@to@ucs#1{%
+ \bxju@check@number{#1}{\bxju@je@to@ucs\bxju@minb@jis}}
+%% \bxju@euc@to@ucs{<euc>}
+\def\bxju@euc@to@ucs#1{%
+ \bxju@check@number{#1}{\bxju@je@to@ucs\bxju@minb@euc}}
+\def\bxju@je@to@ucs#1#2{%
+ \bxju@decomp{#2}{\bxju@je@to@ucs@a#1}}
+\def\bxju@je@to@ucs@a#1#2#3{%
+ \expandafter\bxju@je@to@ucs@b\the\numexpr#2-#1\expandafter\bxju@mk
+ \the\numexpr#3-#1\bxju@mk}
+\def\bxju@je@to@ucs@b#1\bxju@mk#2\bxju@mk{%
+ \expandafter\bxju@je@to@ucs@c\the\numexpr
+ (\ifnum#1<\ltx@zero -9 \else\ifnum#1<\bxju@jisrs #1 \else
+ -9 \fi\fi)*\bxju@jisrs+%
+ (\ifnum#2<\ltx@zero -9999 \else\ifnum#2<\bxju@jisrs #2 \else
+ -9999 \fi\fi)\bxju@mk}
+\def\bxju@je@to@ucs@c#1\bxju@mk{%
+ \bxju@cond\ifnum#1<\ltx@zero\fi{0}{%
+ \number\fontdimen\numexpr#1+8\bxju@ul@jis}}
+
+%% \bxju@sjis@to@ucs{<euc>}
+\def\bxju@sjis@to@ucs#1{%
+ \bxju@check@number{#1}\bxju@sjis@to@ucs@a}
+\def\bxju@sjis@to@ucs@a#1{%
+ \bxju@decomp{#1}\bxju@sjis@to@ucs@b}
+\def\bxju@sjis@to@ucs@b#1#2{%
+ \expandafter\bxju@sjis@to@ucs@c\the\numexpr
+ (\ifnum#1<129 -9 \else\ifnum#1<160 #1-129 \else
+ \ifnum#1<224 -9 \else\ifnum#1<240 #1-193 \else
+ -9 \fi\fi\fi\fi)*188+%
+ (\ifnum#2<64 -9999 \else\ifnum#2<127 #2-64 \else
+ \ifnum#2<128 -9999 \else\ifnum#2<253 #2-65 \else
+ -9999 \fi\fi\fi\fi)\bxju@mk}
+\def\bxju@sjis@to@ucs@c#1\bxju@mk{%
+ \bxju@cond\ifnum#1<\ltx@zero\fi{0}{%
+ \number\fontdimen\numexpr#1+8\bxju@ul@jis}}
+
+%% \bxju@fast@cid@to@ucs{<cid>}
+\def\bxju@fast@cid@to@ucs#1{%
+ \number\fontdimen\numexpr(#1)+8\bxju@ul@cid}
+%% \bxju@fast@jsc@to@ucs{<jsc>}
+\def\bxju@fast@jsc@to@ucs#1{%
+ \number\fontdimen\numexpr(#1)+8\bxju@ul@jis}
+
+%--------------------------------------- all done
+\let\bxju@next\@undefined
+\let\bxju@ifdefinable\@undefined
+\bxju@restore@codes
+\endinput
+%% EOF