diff options
Diffstat (limited to 'language/japanese/BX/bxjaprnind/bxjaprnind.sty')
-rw-r--r-- | language/japanese/BX/bxjaprnind/bxjaprnind.sty | 142 |
1 files changed, 98 insertions, 44 deletions
diff --git a/language/japanese/BX/bxjaprnind/bxjaprnind.sty b/language/japanese/BX/bxjaprnind/bxjaprnind.sty index 77196e842f..821ccc9a8f 100644 --- a/language/japanese/BX/bxjaprnind/bxjaprnind.sty +++ b/language/japanese/BX/bxjaprnind/bxjaprnind.sty @@ -1,43 +1,76 @@ -% -% bxjaprnind.sty -% - +%% +%% This is file 'bxjaprnind.sty'. +%% +%% Copyright (c) 2012-2021 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{bxjaprnind}[2017/09/12 v0.3b] - +\ProvidesPackage{bxjaprnind}[2021/06/06 v0.4] \def\bxpi@pkgname{bxjaprnind} -\def\bxpi@error{\PackageError\bxpi@pkgname} - -%% definitions -\newdimen\bxpi@dima %% code guards \edef\bxpi@restore@codes{% -\catcode33=\the\catcode33%<!> -\catcode34=\the\catcode34%<"> -\catcode62=\the\catcode62%<>> +\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% \endlinechar=\the\endlinechar% \relax}% -\catcode33=12 % -\catcode34=12 % -\catcode62=12 % +\catcode33=12 % <!> +\catcode34=12 % <"> +\catcode39=12 % <'> +\catcode45=12 % <-> +\catcode46=12 % <.> +\catcode47=12 % </> +\catcode58=12 % <:> +\catcode59=12 % <;> +\catcode60=12 % <<> +\catcode62=12 % <>> \AtEndOfPackage{% \bxpi@restore@codes \undef\bxpi@restore@codes} -%------------------- setting the everypar hook +%--------------------------------------- prologue +%% packages \RequirePackage{bxtoolbox} +%% variables +\newbool{bxpi@everyhook} +\newbool{bxpi@force} +\newdimen\bxpi@dima + +%--------------------------------------- options + +%% force +\DeclareOption{force}{% + \bxpi@forcetrue +} +%% dispatch +\ProcessOptions* + +%--------------------------------------- set the paragraph hook + %% Checks if everyhook package is available -\@tempswafalse +\bxpi@everyhookfalse \ifbxineTeX \IfFileExists{everyhook.sty}{% - \@tempswatrue + \bxpi@everyhooktrue }{} \fi -\if@tempswa +\ifbxpi@everyhook % if everyhook is available... \RequirePackage{everyhook}[2011/02/04] @@ -52,9 +85,16 @@ \everypar\bxpi@everypar \bxpi@everypar{\the\expandafter\everypar\bxpi@par@hook}% + \ifbxpi@force + \PackageError\bxpi@pkgname{% + Option 'force' is not supported because\MessageBreak + package 'everyhook' is not available% + }{\@ehc} + \bxpi@forcefalse + \fi \fi \endlinechar=-1 % -%------------------- setting the newline hook +%--------------------------------------- the newline hook %% adds hooks to (subcommands of) \\ \preto\@xnewline{\bxpi@init@param} @@ -74,38 +114,39 @@ \bxpi@next \endgroup -%------------------- helpers +%--------------------------------------- helpers %% \bxpi@inhibitglue \ifdef\inhibitglue{ \let\bxpi@inhibitglue\inhibitglue }{%else \let\bxpi@inhibitglue\relax - \bxpi@warn{ - \string\inhibitglue\space unavailable in current settings; - \MessageBreak the package may not work properly + \PackageWarningNoLine\bxpi@pkgname{ + Command \string\inhibitglue\space + unavailable in current settings;\MessageBreak + the package may not work properly } } -%------------------- main +%--------------------------------------- main -%% \def\bxpi@parhead +%% \bxpi@parhead \def\bxpi@parhead{0} -%% \def\bxpi@linehead +%% \bxpi@linehead \def\bxpi@linehead{0} -%% \def\bxpi@dialogue +%% \bxpi@dialogue \def\bxpi@dialogue{0.5} -%% \def\bxpi@lineheadforce +%% \bxpi@lineheadforce \def\bxpi@lineheadforce{1} -%% \ifbxpi@d@parprnind +%% switch bxpi@d@parprnind \newbool{bxpi@d@parprnind}\bxpi@d@parprnindtrue -%% \ifbxpi@d@lineprnind +%% switch bxpi@d@lineprnind \newbool{bxpi@d@lineprnind}\bxpi@d@lineprnindtrue -%% \ifbxpi@diaprnind +%% switch bxpi@diaprnind \newbool{bxpi@diaprnind}\bxpi@diaprnindfalse -%% \ifbxpi@prnind +%% switch bxpi@prnind \newbool{bxpi@prnind} -%% \ifbxpi@forceind +%% switch bxpi@forceind \newbool{bxpi@forceind} %% \bxpi@choice \let\bxpi@choice\relax @@ -196,7 +237,7 @@ % and sets the switches bxpi@forceind and bxpi@prnind, then % sets the remaining string to \bxpi@res, which is passed to % the original argument parser (\@newline). -\def\bxpi@parse@arg#1{% +\def\bxpi@parse@arg#1{ \bxpi@parse@arg@a#1\bxpi@end } \def\bxpi@parse@arg@a{ @@ -216,7 +257,7 @@ \def\bxpi@res{#1} } } -\def\bxpi@parse@arg@d#1{% +\def\bxpi@parse@arg@d#1{ \bxIfx{,#1}{ \bxpi@parse@arg@a }{\bxIfx{!#1}{ @@ -242,6 +283,7 @@ \futurelet\bxpi@tok\bxpi@par@hook@a } \def\bxpi@par@hook@a{ +%\bxDebug{peek:\meaning\bxpi@tok} \bxIfx{\bxpi@tok\special}{ \bxpi@par@hook@b }{%else @@ -275,7 +317,7 @@ \futurelet\bxpi@tok\bxpi@prnindent@a } \def\bxpi@prnindent@a{ - \bxIf{\@sptoken\bxpi@tok}{ + \bxIfx{\@sptoken\bxpi@tok}{ \bxpi@prnindent@space }{\bxIfCharToken\bxpi@tok{ \bxpi@prnindent@b @@ -346,10 +388,10 @@ \bxCsNoexpand{ifbxpi@d@lineprnind} } -%------------------- character table +%--------------------------------------- character table -%% \bxpi@P/<char> -\def\do#1#2{% +%% \[bxpi@P/<char>] +\def\do#1#2{ \bxToUcsCharDual{"#1}{"#2} \cslet{bxpi@P/\bxRes}{t} } @@ -376,13 +418,25 @@ \do{301D} \fi -%% \bxpi@DP/<char> -\def\do#1#2{% +%% \[bxpi@DP/<char>] +\def\do#1#2{ \bxToUcsCharDual{"#1}{"#2} \cslet{bxpi@DP/\bxRes}{t} } \do{2156}{300C} \do{2158}{300E} -%------------------- all done +%--------------------------------------- 'force' option +\ifbxpi@force + +%% re-attach the hook at begin-document +\AfterEndPreamble{ + \let\bxpi@par@hook@again\bxpi@par@hook + \let\bxpi@par@hook\relax + \PushPostHook{par}{\bxpi@par@hook@again} +} + +\fi +%--------------------------------------- all done \endinput +%% EOF |