diff options
author | Karl Berry <karl@freefriends.org> | 2018-02-12 22:55:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-02-12 22:55:46 +0000 |
commit | b5dbda049c2bf74cc5506b25d92d7c03fb8cdc6a (patch) | |
tree | fb0aa889d07975c0fdf05c9bf617fd64411436f8 /Master/texmf-dist/source/latex/bxjscls | |
parent | 3359ef2af2d79c9fe8c98a0e02a0ae0a9407cb50 (diff) |
bxjscls (12feb18)
git-svn-id: svn://tug.org/texlive/trunk@46612 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/bxjscls')
-rw-r--r-- | Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx | 116 |
1 files changed, 101 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx b/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx index 18662da1b67..b95badcba4a 100644 --- a/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx +++ b/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx @@ -68,7 +68,8 @@ %<*driver> \ProvidesFile{bxjscls.dtx} %</driver> - [2018/01/28 v1.7b BXJS document classes] + [2018/02/04 v1.7c BXJS document classes] +% [2018/01/28 v1.7b BXJS document classes] % [2017/12/09 v1.7a BXJS document classes] % [2017/10/21 v1.7 BXJS document classes] % [2017/09/28 v1.6b BXJS document classes] @@ -1841,6 +1842,20 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\bxjs@label@section} +% |label-section| の指定値。 +% \begin{macrocode} +\chardef\bxjs@label@section@none=0 +\chardef\bxjs@label@section@compat=1 +\chardef\bxjs@label@section@modern=2 +\let\bxjs@label@section\bxjs@label@section@compat +\def\bxjs@kv@labelsection@none{\let\bxjs@label@section\bxjs@label@section@none} +\def\bxjs@kv@labelsection@compat{\let\bxjs@label@section\bxjs@label@section@compat} +\def\bxjs@kv@labelsection@modern{\let\bxjs@label@section\bxjs@label@section@modern} +\define@key{bxjs}{label-section}{\bxjs@set@keyval{labelsection}{#1}{}} +% \end{macrocode} +% \end{macro} +% % \end{ZRnote} % % \paragraph{オプションの実行} @@ -4143,10 +4158,10 @@ \hbox to \fullwidth{{\rightmark}\hfil\textbf{\thepage}}}\hss}% \let\@mkboth\markboth \def\sectionmark##1{\markboth{% - \ifnum \c@secnumdepth >\z@ \thesection \hskip1\jsZw\fi + \ifnum \c@secnumdepth >\z@ \bxjs@label@sect{section}\hskip1\jsZw\fi ##1}{}}% \def\subsectionmark##1{\markright{% - \ifnum \c@secnumdepth >\@ne \thesubsection \hskip1\jsZw\fi + \ifnum \c@secnumdepth >\@ne \bxjs@label@sect{subsection}\hskip1\jsZw\fi ##1}}% } \else % if not twoside @@ -4157,7 +4172,7 @@ \hbox to \fullwidth{{\rightmark}\hfil\textbf{\thepage}}}\hss}% \let\@mkboth\markboth \def\sectionmark##1{\markright{% - \ifnum \c@secnumdepth >\z@ \thesection \hskip1\jsZw\fi + \ifnum \c@secnumdepth >\z@ \bxjs@label@sect{section}\hskip1\jsZw\fi ##1}}} \fi %</article|slide> @@ -4199,7 +4214,7 @@ \fi ##1}{}}% \def\sectionmark##1{\markright{% - \ifnum \c@secnumdepth >\z@ \thesection \hskip1\jsZw\fi + \ifnum \c@secnumdepth >\z@ \bxjs@label@sect{section}\hskip1\jsZw\fi ##1}}}% %</book|report> % \end{macrocode} @@ -4553,6 +4568,44 @@ % % \subsection{章・節} % +% \begin{ZRnote} +% ムニャムニャ……。 +% \begin{macro}{\bxjs@label@sect} +% 節付 |#1| の番号を出力する。 +% 節付 |XXX| に対して、|\labelXXX| が定義済ならそれが出力書式を表す。 +% 未定義ならばカウンタの出力書式 |\theXXX| が使われる。 +% \begin{macrocode} +\def\bxjs@label@sect#1{% + \expandafter\ifx\csname label#1\endcsname\relax + \csname the#1\endcsname + \else \csname label#1\endcsname + \fi} +\def\@seccntformat#1{\bxjs@label@sect{#1}\quad} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@secapp} +% 節番号の接頭辞。 +% \begin{macro}{\@secpos} +% 節番号の接尾辞。 +% \begin{macrocode} +\ifnum\bxjs@label@section=\bxjs@label@section@compat\else +\def\@secapp{\presectionname} +\def\@secpos{\postsectionname} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\labelsection} +% 節番号の出力書式。 +% \begin{macrocode} +\ifnum\bxjs@label@section=\bxjs@label@section@modern +\def\labelsection{\@secapp\thesection\@secpos} +\fi +% \end{macrocode} +% \end{macro} +% +% \end{ZRnote} +% % \paragraph{構成要素} % % |\@startsection| マクロは6個の必須引数と,オプションとして |*| と @@ -4661,7 +4714,7 @@ \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else - \protect\numberline{\csname the#1\endcsname}% + \protect\numberline{\bxjs@label@sect{#1}}% \fi #7}}% 目次にフルネームを載せるなら #8 \else @@ -4675,7 +4728,7 @@ \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else - \protect\numberline{\csname the#1\endcsname}% + \protect\numberline{\bxjs@label@sect{#1}}% \fi #7}% 目次にフルネームを載せるならここは #8 \fi @@ -4829,9 +4882,15 @@ % % \begin{macrocode} \renewcommand{\thepart}{\@Roman\c@part} -%<!book&!report>% \renewcommand{\thesection}{\@arabic\c@section} -%<!book&!report>\renewcommand{\thesection}{\presectionname\@arabic\c@section\postsectionname} -%<!book&!report>\renewcommand{\thesubsection}{\@arabic\c@section.\@arabic\c@subsection} +%<*!book&!report> +\ifnum\bxjs@label@section=\bxjs@label@section@compat +\renewcommand{\thesection}{\presectionname\@arabic\c@section\postsectionname} +\renewcommand{\thesubsection}{\@arabic\c@section.\@arabic\c@subsection} +\else +\renewcommand{\thesection}{\@arabic\c@section} +\renewcommand{\thesubsection}{\thesection.\@arabic\c@subsection} +\fi +%</!book&!report> %<*book|report> \renewcommand{\thechapter}{\@arabic\c@chapter} \renewcommand{\thesection}{\thechapter.\@arabic\c@section} @@ -5900,11 +5959,17 @@ \newcommand{\appendix}{\par \setcounter{section}{0}% \setcounter{subsection}{0}% + \ifnum\bxjs@label@section=\bxjs@label@section@compat \gdef\presectionname{\appendixname}% \gdef\postsectionname{}% % \gdef\thesection{\@Alph\c@section}% [2003-03-02] \gdef\thesection{\presectionname\@Alph\c@section\postsectionname}% - \gdef\thesubsection{\@Alph\c@section.\@arabic\c@subsection}} + \gdef\thesubsection{\@Alph\c@section.\@arabic\c@subsection}% + \else + \gdef\@secapp{\appendixname}% + \gdef\@secpos{}% + \gdef\thesection{\@Alph\c@section}% + \fi} %</!book&!report> %<*book|report> \newcommand{\appendix}{\par @@ -8637,10 +8702,17 @@ % % \paragraph{和文用単位のサポート} % +% エンジンが{(u)\pTeX}の場合は |units| を無効にする。 +% \begin{macrocode} +\if j\jsEngine + \bxjs@jp@unitsfalse +\fi +% \end{macrocode} +% % |units| パラメタが有効の場合は、|bxcalc| パッケージを読みこんで、 % |\usepTeXunits| 命令を実行する。 % \begin{macrocode} -\ifbxjs@jp@units\if j\jsEngine\else +\ifbxjs@jp@units \IfFileExists{bxcalc.sty}{% \RequirePackage{bxcalc}[2018/01/28]%v1.0a \ifx\usepTeXunits\@undefined @@ -8654,8 +8726,22 @@ {Cannot support pTeX units (zw etc.), since\MessageBreak the package 'bxcalc' is unavailable}% } -\fi\fi +\fi +% \end{macrocode} +% +% \begin{macro}{\bxjs@let@lenexpr} +% |\bxjs@let@lenexpr\CS{|\Meta{長さ式}|}|\Means +% 長さ式に |bxcalc| の展開を適用した結果のトークン列を |\CS| に代入する。 +% \begin{macrocode} +\ifbxjs@jp@units + \def\bxjs@let@lenexpr#1#2{% + \edef#1{#2}% + \expandafter\CUXParseExpr\expandafter#1\expandafter{#1}} +\else + \def\bxjs@let@lenexpr{\edef} +\fi % \end{macrocode} +% \end{macro} % % \paragraph{共通命令の実装} % @@ -8801,7 +8887,7 @@ % 和文間空白の量を設定する。 % \begin{macrocode} \newcommand*\setkanjiskip[1]{% - \edef\bxjs@kanjiskip{#1}% + \bxjs@let@lenexpr\bxjs@kanjiskip{#1}% \bxjs@reset@kanjiskip} % \end{macrocode} % \end{macro} @@ -8860,7 +8946,7 @@ % \begin{macrocode} \def\bxjs@xkanjiskip{0pt} \newcommand*\setxkanjiskip[1]{% - \edef\bxjs@xkanjiskip{#1}% + \bxjs@let@lenexpr\bxjs@xkanjiskip{#1}% \bxjs@reset@xkanjiskip} \newcommand*\getxkanjiskip{% \bxjs@xkanjiskip} |