summaryrefslogtreecommitdiff
path: root/language/japanese/BX/bxbase/bxbase.sty
blob: 312fcf4b90302d03d3a0b71cec470a89237ce588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
%%
%% This is file 'bxbase.sty'.
%%
%% Copyright (c) 2008-2023 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{bxbase}[2023/02/23 v1.2a BX base library]

%--------------------------------------- main

%% load submodule
\providecommand*\bxRequireDefinition[1]{%
  \def\bxbz@ext{def}\@onefilewithoptions{#1}[][]\bxbz@ext}
\bxRequireDefinition{bxbase}

%% enable begin-document hooks
\bxBDHookBabel
\bxBDHookUnicode
\bxBDHookJisInput
\bxBDHookSafeCaret
\bxBDHookUcsFastErrors

%% error messages
\def\bxbz@pkgname{bxbase}
\def\bxbz@inf@aecsq#1{%
  \PackageInfo\bxbz@pkgname
   {Command \string#1 already exists}}

%--------------------------------------- extra

%%<*> \Ux / \UI / \AJ / \JI / \KI
% define commands unless their name is already used
\bxPreamble\def\bxbz@charcmd#1#2{%
  \ifundef#1{\def#1{#2}}{\bxbz@inf@aecsq#1}}
\bxbz@charcmd\Ux\bxUx
\bxbz@charcmd\UI\bxUI
\bxbz@charcmd\AJ\bxAJ
\bxbz@charcmd\JI\bxJI
\bxbz@charcmd\KI\bxKI

%--------------------------------------- all done
\endinput
%
% * bxbase provides:
%   - bx@Uxh@fb      (terminal)
%   - bxUx           (passed to bx@Ux)
%   - bxUI           (passed to bx@UI)
%   - bxUHex         (passed to bx@Uxh)
% * bxutf8 provides:
%   - conversion from UTF8 string to bxUHex
% * bxucs provides:
%   - bx@Ux@ucs      (fallback to bx@UI)
%   - bx@Uxh@ucs     (fallback to bx@UIh)
% * utf/otf provides:
%   - bx@UIh@p       (terminal)
%
% [default]
%   bx@Ux       bx@Uxh  
%     v           v     
%   bx@UI   >   bx@UIh  =  bx@UIh@fb or bx@UIh@p
%
% [with bxucs]
%   bx@Ux = bx@Ux@ucs   bx@Uxh = bx@Uxh@ucs
%             v                    v       
%           bx@UI     >          bx@UIh  =  bx@Uxh@fb or bx@UIh@p
%
%% EOF