summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-05-28 20:48:24 +0000
committerKarl Berry <karl@freefriends.org>2021-05-28 20:48:24 +0000
commit489c31ba9709773310b2ac33bb8454228fc126bd (patch)
treed50ca6a02a2d7013618b2d602fef863e9bdf71ca
parent34055957a9bdaf9f886fad9ec5ad7df1281229a3 (diff)
jlreq (28may21)
git-svn-id: svn://tug.org/texlive/trunk@59376 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/LICENSE2
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/README-ja.md7
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/README.md3
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html9
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq-ja.pdfbin360383 -> 361307 bytes
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq.html5
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq.pdfbin117030 -> 117613 bytes
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty18
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq.cls402
9 files changed, 281 insertions, 165 deletions
diff --git a/Master/texmf-dist/doc/latex/jlreq/LICENSE b/Master/texmf-dist/doc/latex/jlreq/LICENSE
index 94fb8def3c1..4e292f4765c 100644
--- a/Master/texmf-dist/doc/latex/jlreq/LICENSE
+++ b/Master/texmf-dist/doc/latex/jlreq/LICENSE
@@ -1,6 +1,6 @@
(2-clause BSD license)
jlreq and jlreq-trimmarks
-Copyright 2017-2020, Noriyuki Abe.
+Copyright 2017-2021, Noriyuki Abe.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
diff --git a/Master/texmf-dist/doc/latex/jlreq/README-ja.md b/Master/texmf-dist/doc/latex/jlreq/README-ja.md
index 7a9189ac41a..3b46b52c7e4 100644
--- a/Master/texmf-dist/doc/latex/jlreq/README-ja.md
+++ b/Master/texmf-dist/doc/latex/jlreq/README-ja.md
@@ -102,7 +102,7 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内
\begin{document}
```
- のようにします.
+ のようにします.和文と欧文の間の空白((u)pTeXでは`\xkanjiskip`に,LuateX-jaでは`xkanjiskip`パラメータに格納されているもの)も同様に`\jlreqxkanjiskip`を再定義することで変更することができます.
## 各種設計
設計はクラスオプションまたは`\jlreqsetup`によりkeyval形式で行います.ただし,クラスオプションではLaTeXの実装により,本来可能な入力が受け付けられないケースがあります.多くの場合は空白を除くことにより解決します.
@@ -164,7 +164,7 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内
* `caption_label_font=<フォント設定コード>`:キャプションのラベルのフォントを指定します.
* `caption_after_label_space=<寸法>`:ラベルとキャプションの間の空きを指定します.
* `caption_label_format=<コード>`:ラベルの書式を指定します.`caption_label_format={#1:}`のようにします.`#1`が「図1」のような番号に置換されます.
-* `caption_align=[left/right/center/bottom/top]`:キャプションの場所を指定します.
+* `caption_align=[left/right/center/bottom/top]`:キャプションの場所を指定します.{center,*left}のようにすると,通常は中央配置だがキャプションが大きいときには左に配置されます.
### 引用
`quote / quotation / verse`環境の挙動を`\jlreqsetup`で指定できます.
@@ -495,6 +495,9 @@ JFMの名前は次の通りです.`[]`で囲まれている文字は設定に
- `\item`直後のJFMグルーをなくした.
- 同行見出し直後のJFMグルーをなくした.
- バグ修正.
+* 2021-05-28
+ - `\jlreqsetup`の`caption_align`を拡張.
+ - `\ifthenelse`を少し削除.
--------------
Noriyuki Abe
diff --git a/Master/texmf-dist/doc/latex/jlreq/README.md b/Master/texmf-dist/doc/latex/jlreq/README.md
index abb0fa6f18b..62fc8b3b5d5 100644
--- a/Master/texmf-dist/doc/latex/jlreq/README.md
+++ b/Master/texmf-dist/doc/latex/jlreq/README.md
@@ -139,6 +139,9 @@ This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENS
- Removed JFM glue after `\item`.
- Removed JFM glue after block headings.
- Fixed bugs.
+* 2021-05-28
+ - Extended `caption_align` in `\jlreqsetup`.
+ - Removed some `\ifthenelse`.
--------------
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html b/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
index 1228e200715..73eed49d798 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
@@ -154,7 +154,7 @@
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">document</span>}</span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a>(本文)</span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">document</span>}</span></code></pre></div>
-<p>のようにします.</p></li>
+<p>のようにします.和文と欧文の間の空白((u)pTeXでは<code>\xkanjiskip</code>に,LuateX-jaでは<code>xkanjiskip</code>パラメータに格納されているもの)も同様に<code>\jlreqxkanjiskip</code>を再定義することで変更することができます.</p></li>
</ul>
<h2 id="各種設計">各種設計</h2>
<p>設計はクラスオプションまたは<code>\jlreqsetup</code>によりkeyval形式で行います.ただし,クラスオプションではLaTeXの実装により,本来可能な入力が受け付けられないケースがあります.多くの場合は空白を除くことにより解決します.</p>
@@ -221,7 +221,7 @@
<li><code>caption_label_font=&lt;フォント設定コード&gt;</code>:キャプションのラベルのフォントを指定します.</li>
<li><code>caption_after_label_space=&lt;寸法&gt;</code>:ラベルとキャプションの間の空きを指定します.</li>
<li><code>caption_label_format=&lt;コード&gt;</code>:ラベルの書式を指定します.<code>caption_label_format={#1:}</code>のようにします.<code>#1</code>が「図1」のような番号に置換されます.</li>
-<li><code>caption_align=[left/right/center/bottom/top]</code>:キャプションの場所を指定します.</li>
+<li><code>caption_align=[left/right/center/bottom/top]</code>:キャプションの場所を指定します.{center,*left}のようにすると,通常は中央配置だがキャプションが大きいときには左に配置されます.</li>
</ul>
<h3 id="引用">引用</h3>
<p><code>quote / quotation / verse</code>環境の挙動を<code>\jlreqsetup</code>で指定できます.</p>
@@ -595,6 +595,11 @@
<li>同行見出し直後のJFMグルーをなくした.</li>
<li>バグ修正.</li>
</ul></li>
+<li>2021-05-28
+<ul>
+<li><code>\jlreqsetup</code>の<code>caption_align</code>を拡張.</li>
+<li><code>\ifthenelse</code>を少し削除.</li>
+</ul></li>
</ul>
<hr />
<p>Noriyuki Abe <a href="https://github.com/abenori/jlreq">https://github.com/abenori/jlreq</a></p>
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.pdf b/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.pdf
index 364332c751b..8e2afa93d26 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.pdf
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq.html b/Master/texmf-dist/doc/latex/jlreq/jlreq.html
index bab78328c17..4b5afe7401a 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq.html
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq.html
@@ -251,6 +251,11 @@
<li>Removed JFM glue after block headings.</li>
<li>Fixed bugs.</li>
</ul></li>
+<li>2021-05-28
+<ul>
+<li>Extended <code>caption_align</code> in <code>\jlreqsetup</code>.</li>
+<li>Removed some <code>\ifthenelse</code>.</li>
+</ul></li>
</ul>
<hr />
<p>Noriyuki Abe <a href="https://github.com/abenori/jlreq">https://github.com/abenori/jlreq</a></p>
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq.pdf b/Master/texmf-dist/doc/latex/jlreq/jlreq.pdf
index c94dc00df78..181f91ee69a 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq.pdf
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
index 46a619a84c4..83251193bb4 100644
--- a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
+++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
@@ -62,9 +62,9 @@
% 条件.\jlreq@if{\ifnum\@count=1 \fi}{<TRUE>}{<FALSE>}みたいに使う
\def\jlreq@if@endmark{\jlreq@if@endmark}
-\def\jlreq@if#1{\jlreq@if@#1\jlreq@if@endmark}
+\long\def\jlreq@if#1{\jlreq@if@#1\jlreq@if@endmark}
\@gobbletwo\if\if
-\def\jlreq@if@#1\fi\jlreq@if@endmark{#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+\long\def\jlreq@if@#1\fi\jlreq@if@endmark{#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
% #1の先頭が引数なしのマクロか
\long\def\jlreq@ifmacro@noargument#1{%
@@ -177,7 +177,7 @@
% カンマで区切って,その前と後ろを\jlreq@resulta,\jlreq@resultbに入れる
% もしカンマがない場合は\ifjlreq@resultがfalseになる.
\newcommand*{\jlreq@helper@dividebycomma}[1]{\jlreq@helper@dividebycomma@#1,\jlreq@endmark}
-\def\jlreq@helper@dividebycomma@#1,#2\jlreq@endmark{%
+\long\def\jlreq@helper@dividebycomma@#1,#2\jlreq@endmark{%
\jlreq@helper@trim{#1}{\jlreq@resulta}%
\jlreq@helper@trim{#2}{\jlreq@resultb}%
\jlreq@if{\ifx\jlreq@resultb\@empty\fi}{%
@@ -188,7 +188,7 @@
\expandafter\jlreq@helper@trim\expandafter{\jlreq@resultb}{\jlreq@resultb}%
}%
}
-\def\jlreq@helper@removelastcomma#1,\jlreq@endmark{#1}
+\long\def\jlreq@helper@removelastcomma#1,\jlreq@endmark{#1}
% vbox #1の最後を\jlreq@resultboxに入れる
% #1の最後の行は消える
@@ -395,9 +395,9 @@
% \jlreq@reference@ref{ラベル名}{デフォルト値}
\def\jlreq@reference@ref#1{\jlreq@if{\expandafter\unless\expandafter\ifx\csname jlreq@reference@#1\endcsname\relax\fi}{\csname jlreq@reference@#1\endcsname}}
% \jlreq@reference@label{ラベル名}{値}
-\def\jlreq@reference@label#1#2{\protected@write\@auxout{}{\string\@newl@bel{jlreq@reference}{#1}{#2}}}%
-\def\jlreq@reference@immediate@write#1#2{\immediate\write\@auxout{\string\@newl@bel{jlreq@reference}{#1}{#2}}}%
-\def\jlreq@reference@ifexist#1{\jlreq@if{\expandafter\unless\expandafter\ifx\csname jlreq@reference@#1\endcsname\relax\fi}}
+\long\def\jlreq@reference@label#1#2{\protected@write\@auxout{}{\string\@newl@bel{jlreq@reference}{#1}{#2}}}%
+\long\def\jlreq@reference@immediate@write#1#2{\immediate\write\@auxout{\string\@newl@bel{jlreq@reference}{#1}{#2}}}%
+\long\def\jlreq@reference@ifexist#1{\jlreq@if{\expandafter\unless\expandafter\ifx\csname jlreq@reference@#1\endcsname\relax\fi}}
% 自動生成されるラベル用の番号
\newcount\jlreq@reference@count
@@ -423,9 +423,9 @@
}%
}%
}
-\def\jlreq@getfirsttoken@expandmacros@#1#2{\def#2{#1}}
+\long\def\jlreq@getfirsttoken@expandmacros@#1#2{\def#2{#1}}
-\def\jlreq@helper@checktokenlist#1#2{%
+\long\def\jlreq@helper@checktokenlist#1#2{%
\jlreq@ifendmark{#2}{\@firstoftwo}%
{%
\jlreq@if{\ifnum0#1{#2}>0 \fi}%
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
index 1bee6df7306..477a34af98b 100644
--- a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
+++ b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
@@ -5,7 +5,7 @@
%%
% (based on JLReq 20200811 https://www.w3.org/TR/2020/NOTE-jlreq-20200811/)
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2021/03/17 jlreq]
+\ProvidesClass{jlreq}[2021/05/28 jlreq]
\RequirePackage{xkeyval,everyhook,etoolbox,ifthen}
\RequirePackage{jlreq-helpers}
@@ -17,6 +17,7 @@
\str_new:N \l_jlreq_tmpb_str
\str_new:N \l_jlreq_tmpc_str
\bool_new:N \l_jlreq_tmpa_bool
+\clist_new:N \l_jlreq_tmpa_clist
\ExplSyntaxOff
\newcommand*{\jlreq@undeferr}[1]{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}}
@@ -298,22 +299,24 @@
\let\@removeelement=\jlreq@temporary@original@@removeelement
\let\jlreq@temporary@original@@removeelement=\@undefined
-\ifjlreq@option@titlepage\else
- \ifthenelse{\equal{\jlreq@article@type}{article}}{\@titlepagefalse}{\@titlepagetrue}
-\fi
-\ifjlreq@option@open\else
- \ifthenelse{\equal{\jlreq@article@type}{book}}{\@openrighttrue}{\@openrightfalse}
-\fi
+\ExplSyntaxOn
+\legacy_if:nF { jlreq@option@titlepage } {
+ \str_if_eq:VnTF \jlreq@article@type { article } { \@titlepagefalse } { \@titlepagetrue }
+}
+\legacy_if:nF { jlreq@option@open } {
+ \str_if_eq:VnTF \jlreq@article@type { book } { \@openrighttrue } { \@openrightfalse }
+}
% articleではopenrightは効かない.
-\ifthenelse{\equal{\jlreq@article@type}{article}}{%
- \if@openright
- \ClassWarningNoLine{jlreq}{The option `openright' is ignored in article}
+\str_if_eq:VnT \jlreq@article@type { article } {
+ \legacy_if:nT { @openright } {
+ \ClassWarningNoLine { jlreq } { The~option~`openright'~is~ignored~in~article }
\@openrightfalse
- \fi
-}{}
-\ifjlreq@option@twoside\else
- \ifthenelse{\equal{\jlreq@article@type}{book}}{\@twosidetrue}{\@twosidefalse}
-\fi
+ }
+}
+\legacy_if:nF { jlreq@option@twoside } {
+ \str_if_eq:VnTF \jlreq@article@type { book } { \@twosidetrue } { \@twosidefalse }
+}
+\ExplSyntaxOff
\def\jlreq@jlreqsetup@keyvallist{}
\def\jlreq@jlreqsetup@finally{}
@@ -355,6 +358,7 @@
\fi
%.. JFMとluatexjaのロード
+\ExplSyntaxOn
\ifx l\jlreq@engine
\def\ltj@stdyokojfm{jlreq}
\def\ltj@stdtatejfm{jlreqv}
@@ -376,13 +380,16 @@
\def\jlreq@jfmname@prefix{}
\jlreq@aftercls@addtodeletecs{\jlreq@jfmname@prefix}
\ifjlreq@burasage\edef\jlreq@jfmname@prefix{b\jlreq@jfmname@prefix}\fi
- \ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{\edef\jlreq@jfmname@prefix{\jlreq@jfmname@prefix z}}{}
+ \str_if_eq:VnT \jlreq@open@bracket@pos { zenkakunibu_nibu } {
+ \edef\jlreq@jfmname@prefix { \jlreq@jfmname@prefix z }
+ }
\ifx u\jlreq@engine\edef\jlreq@jfmname@prefix{u\jlreq@jfmname@prefix}\fi
\edef\jlreq@jfmname{\jlreq@jfmname@prefix jlreq} % JFMの名前
\edef\jlreq@jfmnameg{\jlreq@jfmname@prefix jlreqg} % ゴシックなJFMの名前
\jlreq@aftercls@addtodeletecs{\jlreq@jfmname}
\jlreq@aftercls@addtodeletecs{\jlreq@jfmnameg}
\fi
+\ExplSyntaxOff
% (u)pLaTeXの場合ここで初めて\epTeXinputencodingが発行されるので,
% これ以前には和文は使えない.
@@ -452,13 +459,17 @@
% 左ページであるか
% #1 : odd or even or ページ数
+\ExplSyntaxOn
\def\jlreq@ifleftpage#1{%
- \ifthenelse{\(\boolean{@tate} \AND
- \(\equal{#1}{odd} \OR \(\(\NOT \equal{#1}{even}\) \AND \isodd{#1}\)\)
- \) \OR \(\(\NOT \boolean{@tate}\) \AND
- \(\equal{#1}{even} \OR \(\(\NOT \equal{#1}{odd}\) \AND \(\NOT \isodd{#1}\)\)\)
- \)}%
+ \bool_if:nTF { ( \legacy_if_p:n { @tate } &&
+ \bool_lazy_or_p:nn { \str_if_eq_p:ee {#1} { odd } }
+ { \bool_lazy_and_p:nn { ! \str_if_eq_p:ee {#1} { even } } { \int_if_odd_p:n {#1} } }
+ ) || ( ! \legacy_if_p:n { @tate } &&
+ \bool_lazy_or_p:nn { \str_if_eq_p:ee {#1} { even } }
+ { \bool_lazy_and_p:nn { ! \str_if_eq_p:ee {#1} { odd } } { ! \int_if_odd_p:n {#1} } }
+ ) }
}
+\ExplSyntaxOff
\ifx l\jlreq@engine
\newcommand*{\jlreq@getpostbreakpenalty}[1]{\ltjgetparameter{postbreakpenalty}{#1}}
@@ -694,11 +705,13 @@
% 行頭の括弧は \jlreq@open@bracket@before@space \inhibitglue 「みたいにする.
-\ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{
+\ExplSyntaxOn
+\str_if_eq:VnTF \jlreq@open@bracket@pos { zenkakunibu_nibu } {
\def\jlreq@open@bracket@before@space{\hskip\glueexpr-.5\jlreq@zw\relax}
}{
\def\jlreq@open@bracket@before@space{}
}
+\ExplSyntaxOff
\ifx p\jlreq@engine
\def\jlreq@yokokanjiencoding{JY1}
@@ -720,23 +733,26 @@
\ExplSyntaxOn
\def\DeclareFontShape#1#2#3#4#5#6{
\group_begin:
- \bool_if:nT{\str_if_eq_p:nn{#1}{JY3} || \str_if_eq_p:nn{#1}{JT3}}{
+ \bool_if:nT { \str_if_eq_p:nn {#1} {JY3} || \str_if_eq_p:nn {#1} {JT3} } {
\tl_set:Nx \l_jlreq_tmpa_tl {#5}
- \tl_if_in:NnTF \l_jlreq_tmpa_tl {jfm=jlreq}{
- \tl_if_in:NnTF \l_jlreq_tmpa_tl {jfm=jlreqv}{
- \tl_replace_all:Nnn \l_jlreq_tmpa_tl {jfm=jlreqv}{jfm=jlreqv-jidori}
+ \tl_if_in:NnTF \l_jlreq_tmpa_tl { jfm=jlreq} {
+ \tl_if_in:NnTF \l_jlreq_tmpa_tl { jfm=jlreqv }{
+ \tl_replace_all:Nnn \l_jlreq_tmpa_tl { jfm=jlreqv } { jfm=jlreqv-jidori }
}{
- \tl_replace_all:Nnn \l_jlreq_tmpa_tl {jfm=jlreq}{jfm=jlreq-jidori}
+ \tl_replace_all:Nnn \l_jlreq_tmpa_tl { jfm=jlreq } { jfm=jlreq-jidori }
+ }
+ \cs_set:Nx \l_jlreq_do: {
+ \exp_not:n{ \jlreq@useoriginalcs{DeclareFontShape} {#1} {#2} {#3} { #4-jidori } }
+ { \tl_use:N \l_jlreq_tmpa_tl } {#6}
}
- \cs_set:Nx \l_jlreq_do: {\exp_not:n{\jlreq@useoriginalcs{DeclareFontShape}{#1}{#2}{#3}{#4-jidori}}{\tl_use:N \l_jlreq_tmpa_tl}{#6}}
}{
- \tl_if_in:NnT \l_jlreq_tmpa_tl {<->ssub}{
- \cs_set:Nn \l_jlreq_do: {\jlreq@useoriginalcs{DeclareFontShape}{#1}{#2}{#3}{#4-jidori}{#5}{#6}}
+ \tl_if_in:NnT \l_jlreq_tmpa_tl {<->ssub} {
+ \cs_set:Nn \l_jlreq_do: {\jlreq@useoriginalcs{DeclareFontShape} {#1} {#2} {#3} { #4-jidori } {#5} {#6} }
}
}
}
\exp_after:wN \group_end: \l_jlreq_do:
- \jlreq@useoriginalcs{DeclareFontShape}{#1}{#2}{#3}{#4}{#5}{#6}
+ \jlreq@useoriginalcs{DeclareFontShape} {#1} {#2} {#3} {#4} {#5} {#6}
}
\ExplSyntaxOff
\DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont:jfm=jlreq;script=latn;-kern}{}
@@ -754,23 +770,27 @@
\DeclareFontShape{\jlreq@tatekanjiencoding}{mc}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\jlreq@tempa jlreq-v-jidori}{}
\DeclareFontShape{\jlreq@tatekanjiencoding}{gt}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\jlreq@tempa jlreqg-v-jidori}{}
\fi
-\@for\jlreq@encoding:=\jlreq@yokokanjiencoding,\jlreq@tatekanjiencoding\do{
- \@for\jlreq@shape:=n,it,sl,sc\do{
- \@for\jlreq@series:=m,b,bx,sb,c\do{
- \ifthenelse{\equal{\jlreq@shape}{n} \AND \equal{\jlreq@series}{m}}{}{
- \DeclareFontShape{\jlreq@encoding}{gt}{\jlreq@series}{\jlreq@shape}{<->ssub*gt/m/n}{}
+\ExplSyntaxOn
+\clist_set:NV \l_jlreq_tmpa_clist \jlreq@yokokanjiencoding
+\clist_push:NV \l_jlreq_tmpa_clist \jlreq@tatekanjiencoding
+\clist_map_inline:Nn \l_jlreq_tmpa_clist {% #1 = encoding
+ \clist_map_inline:nn { n,it,sl,sc } {% ##1 = shape
+ \clist_map_inline:nn { m,b,bx,sb,c } {% ####1 = series
+ \bool_if:nF { \str_if_eq_p:nn {##1} {n} && \str_if_eq_p:nn {####1} {m} } {
+ \DeclareFontShape{#1}{gt}{####1}{##1}{<->ssub*gt/m/n}{}
}
}
- \@for\jlreq@series:=bx,b,sb\do{
- \DeclareFontShape{\jlreq@encoding}{mc}{\jlreq@series}{\jlreq@shape}{<->ssub*gt/m/n}{}
+ \clist_map_inline:nn { bx,b,sb } {% ####1 = series
+ \DeclareFontShape{#1}{mc}{####1}{##1}{<->ssub*gt/m/n}{}
}
- \@for\jlreq@series:=m,c\do{
- \ifthenelse{\equal{\jlreq@shape}{n} \AND \equal{\jlreq@series}{m}}{}{
- \DeclareFontShape{\jlreq@encoding}{mc}{\jlreq@series}{\jlreq@shape}{<->ssub*mc/m/n}{}
+ \clist_map_inline:nn { m,c } {% ####1 = series
+ \bool_if:nF { \str_if_eq_p:nn {##1} {n} && \str_if_eq_p:nn {####1} {m} } {
+ \DeclareFontShape{#1}{mc}{####1}{##1}{<->ssub*mc/m/n}{}
}
}
}
}
+\ExplSyntaxOff
%.. 文字クラスのリスト
% 開き括弧(文字クラス1)
@@ -806,6 +826,7 @@
\AtBeginDocument{\PushPostHook{par}{\jlreq@hook@everypar}}
\def\jlreq@hook@everypar{}
\jlreq@saveoriginalcs{item}
+\ExplSyntaxOn
\ifx l\jlreq@engine
% \itemの直後は折り返し行頭と同じにする.
\def\item{%
@@ -823,7 +844,7 @@
\def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifx\jlreq@nextchar#11\fi}\jlreq@do}}
\expandafter\jlreq@do\jlreq@charlist@openingbrackets\jlreq@endmark
% JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる.
- \ifthenelse{\equal{\jlreq@open@bracket@pos}{nibu_tentsuki}}{
+ \str_if_eq:VnTF \jlreq@open@bracket@pos { nibu_tentsuki } {
\edef\jlreq@openbracket@hook@ii{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\hskip -.5\jlreq@zw\inhibitglue}\noexpand\fi}
}{% zenkakunibu_nibu,zenkaku_tentsuki
\edef\jlreq@openbracket@hook@ii{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\inhibitglue}\noexpand\fi}
@@ -841,6 +862,7 @@
\jlreq@useoriginalcs{item}%
}
\fi
+\ExplSyntaxOff
%.. 禁則処理
\ifx l\jlreq@engine
@@ -1141,9 +1163,11 @@
\ifdim\jlreq@fontsize>\jlreq@baselineskip
\ClassError{jlreq}{The baselineskip is less than fontsize}{\@ehc}%
\fi
-\ifthenelse{\lengthtest{\jlreq@baselineskip<1.5\zw} \OR \lengthtest{\jlreq@baselineskip>2\zw}}{
- \jlreq@note{行間は二分以上全角以下が望ましい (2.4.2.d 注3).}
-}{}
+\ExplSyntaxOn
+\bool_if:nT { \dim_compare_p:n { \jlreq@baselineskip < 1.5\zw } || \dim_compare_p:n { \jlreq@baselineskip > 2\zw } } {
+ \jlreq@note { 行間は二分以上全角以下が望ましい (2.4.2.d~注3).}
+}
+\ExplSyntaxOff
\emergencystretch 3\jlreq@gol
\setlength{\parindent}{1\zw}
@@ -1332,7 +1356,9 @@
% 縦書きの時は脚注に固定
% (TODO: 頭注)
-\if@tate\@mparswitchfalse\fi
+\@mparswitchfalse
+\if@tate\else\if@twoside\@mparswitchtrue\fi\fi
+
\setlength{\topskip}{1\zw} % フォントサイズと一致させる
\ifx\jlreq@option@headfoot@verticalpos\@empty
@@ -2663,13 +2689,14 @@
\fi
}
+\ExplSyntaxOn
\def\jlreq@BlockHeading@spaces@output@#1#2\jlreq@endmark{%
\def\jlreq@result{}%
\jlreq@tempcnta=0
\jlreq@BlockHeading@spaces@output@@#2\jlreq@endmark
\jlreq@tempatrue % 周りの行取り処理が必要か
\jlreq@ifempty{#1}{\jlreq@tempafalse}{}%
- \ifthenelse{\equal{#1}{{}{}{}}}{\jlreq@tempafalse}{}%
+ \tl_if_eq:nnT {#1} {{}{}{}} { \jlreq@tempafalse }
\edef\jlreq@do{%
\ifjlreq@tempa
\unexpanded{\jlreq@BlockHeading@start@gyodori#1}{%
@@ -2682,6 +2709,7 @@
\jlreq@BlockHeading@spaces@clear
\jlreq@do
}
+\ExplSyntaxOff
% jlreq@resultに出力すべきものを入れていく
\def\jlreq@BlockHeading@spaces@output@@#1{%
\jlreq@ifendmark{#1}{}{%
@@ -2992,23 +3020,28 @@
\ExplSyntaxOn
\NewDocumentCommand{\ModifyHeading}{m m}{
- \@ifundefined{jlreq@heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}
+ \@ifundefined { jlreq@heading@setting@#1 } { \ClassError{jlreq}{Unknown heading: #1}{\@ehc} } {}
\group_begin:
\tl_set:Nn \l_jlreq_tmpa_tl {#2}
\str_set:Nn \l_jlreq_tmpa_str {#2}
- \str_case_e:nn {\jlreq@HeadingType{#1}} {
- {BlockHeading}{
+ \str_case_e:nn { \jlreq@HeadingType {#1} } {
+ { BlockHeading } {
\bool_set_false:N \l_jlreq_tmpa_bool
- \str_if_in:NnT \l_jlreq_tmpa_str {before_space=}{\bool_set_true:N \l_jlreq_tmpa_bool}
- \str_if_in:NnT \l_jlreq_tmpa_str {before_space~=}{\bool_set_true:N \l_jlreq_tmpa_bool}
- \bool_if:NT \l_jlreq_tmpa_bool {\tl_put_left:Nn \l_jlreq_tmpa_tl {before_lines={},}}
+ \str_if_in:NnT \l_jlreq_tmpa_str { before_space= } { \bool_set_true:N \l_jlreq_tmpa_bool }
+ \str_if_in:NnT \l_jlreq_tmpa_str { before_space~= } { \bool_set_true:N \l_jlreq_tmpa_bool }
+ \bool_if:NT \l_jlreq_tmpa_bool {\tl_put_left:Nn \l_jlreq_tmpa_tl {before_lines={},} }
\bool_set_false:N \l_jlreq_tmpa_bool
- \str_if_in:NnT \l_jlreq_tmpa_str {after_space=}{\bool_set_true:N \l_jlreq_tmpa_bool}
- \str_if_in:NnT \l_jlreq_tmpa_str {after_space~=}{\bool_set_true:N \l_jlreq_tmpa_bool}
+ \str_if_in:NnT \l_jlreq_tmpa_str { after_space= } { \bool_set_true:N \l_jlreq_tmpa_bool }
+ \str_if_in:NnT \l_jlreq_tmpa_str { after_space~= } { \bool_set_true:N \l_jlreq_tmpa_bool }
\bool_if:NT \l_jlreq_tmpa_bool {\tl_put_left:Nn \l_jlreq_tmpa_tl {after_lines={},}}
}
}
- \cs_set:Nx \l_jlreq_do: {\exp_not:v {jlreq@heading@type@#1}{\exp_not:n {#1}}{\exp_not:v {jlreq@heading@level@#1}}{\exp_not:v {jlreq@heading@setting@#1},\exp_not:V \l_jlreq_tmpa_tl}}
+ \cs_set:Nx \l_jlreq_do: {
+ \exp_not:v { jlreq@heading@type@#1 }
+ { \exp_not:n { #1 } }
+ { \exp_not:v { jlreq@heading@level@#1 } }
+ { \exp_not:v { jlreq@heading@setting@#1 },\exp_not:V \l_jlreq_tmpa_tl }
+ }
\exp_after:wN \group_end:
\l_jlreq_do:
}
@@ -3090,9 +3123,10 @@
\newcommand*\jlreq@referencemark@format[1]{#1}
\newif\ifjlreqadjustreferencemark
\jlreqadjustreferencemarktrue
+\ExplSyntaxOn
\jlreq@jlreqsetup@add{reference_mark}[inline,interlinear]{
\def\jlreq@referencemark{#1}
- \ifthenelse{\equal{\jlreq@referencemark}{inline}}{
+ \str_if_eq:VnTF \jlreq@referencemark { inline } {
\def\jlreq@notemark##1{%
\jlreq@ifydir{%
\hbox{}\hbox{\@textsuperscript{\normalfont\jlreq@referencemark@format{##1}}}\hbox{}%
@@ -3112,7 +3146,7 @@
\jlreq@getfirsttoken@expandmacros{\jlreq@nextchar}{\jlreq@tempa}%
\expandafter\let\expandafter\jlreq@tempb\jlreq@tempa
}%
- \noexpand\jlreq@if{\noexpand\ifnum 0\expandonce{\@tempa}>0 \noexpand\fi}{}{\noexpand\inhibitglue}%
+ \noexpand\jlreq@if{\noexpand\ifnum 0\expandonce{\@tempa}>0~\noexpand\fi}{}{\noexpand\inhibitglue}%
}
}{% reference_mark=interlinear
\def\jlreq@notemark##1{{%
@@ -3132,18 +3166,19 @@
\ifx l\jlreq@engine
\def\jlreq@hook@prenote{%
\jlreq@lastnodechar=\lastnodechar\relax
- \ifnum\jlreq@lastnodechar>-1 \inhibitglue\fi
+ \ifnum\jlreq@lastnodechar>-1~\inhibitglue\fi
}
\else
% (u)platexの時は代入すると\inhibitglueが効かなくなる
\def\jlreq@hook@prenote{%
- \ifnum\lastnodechar>-1 \inhibitglue\fi
+ \ifnum\lastnodechar>-1~\inhibitglue\fi
\jlreq@lastnodechar=\lastnodechar\relax
}
\fi
\def\jlreq@hook@postnote{\jlreq@fixjfm}
}
}
+\ExplSyntaxOff
% \@footnotemarkをシンプルなものにする
\def\jlreq@setdefaultnotemark#1#2{%
\def#1{%
@@ -3192,13 +3227,14 @@
}
\newcommand{\@makefntext}[1]{\jlreq@makefntext{#1}}
+\ExplSyntaxOn
\jlreq@jlreqsetup@add{footnote_second_indent}{%
- \if@tate\else
- \ifthenelse{
- \( \lengthtest{0.99\jlreq@zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < 1.01\jlreq@zw} \) \OR
- \( \lengthtest{-1.01\jlreq@zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < -0.99\jlreq@zw} \)
- }{}{\jlreq@note{脚注が2行以上となった場合,脚注の2行目以下の字下げを1行目より,脚注の文字サイズの全角アキとするか,逆に,1行目の字下げを2行目より,脚注の文字サイズの全角アキとする (4.2.5.d).}}
- \fi
+ \legacy_if:nF { @tate }{
+ \bool_if:nF {
+ ( \dim_compare_p:n { 0.99\jlreq@zw < \dimexpr #1\relax } && \dim_compare_p:n { \dimexpr #1\relax < 1.01\jlreq@zw } ) ||
+ ( \dim_compare_p:n { -1.01\jlreq@zw < \dimexpr #1\relax } && \dim_compare_p:n { \dimexpr #1\relax < -0.99\jlreq@zw } )
+ }{\jlreq@note{脚注が2行以上となった場合,脚注の2行目以下の字下げを1行目より,脚注の文字サイズの全角アキとするか,逆に,1行目の字下げを2行目より,脚注の文字サイズの全角アキとする (4.2.5.d).}}
+ }
\ifdim\dimexpr #1\relax<0pt
\def\jlreq@makefntext{}
\else
@@ -3215,6 +3251,7 @@
}##1%
}
}
+\ExplSyntaxOff
\jlreq@jlreqsetup@add{footnotetext_indent}{
\ClassWarningNoLine{jlreq}{footnotetext_indent was removed}
@@ -3263,7 +3300,8 @@
\let\footnotetext=\jlreq@temporary@saved@footnotetext
}
-\ifthenelse{\boolean{@tate} \AND \(\boolean{@twoside} \OR \boolean{@twocolumn}\)}{
+\ExplSyntaxOn
+\bool_if:nTF { \legacy_if_p:n { @tate } && (\legacy_if_p:n { @twoside } || \legacy_if_p:n { @twocolumn }) }{
% 縦組の傍注は,その見開き内に付いている合印に対応する注を,奇数ページの左端にそろえて配置する.多段組では最下段の左端にそろえて配置する.(4.2.6.a)
% 必要ならば\footnoteを\footnotemarkと\footnotetextにわけ,\footnotetextをアウトプット時まで遅延することで実現する.
\def\jlreq@footnote@delayfootnoteslist{}
@@ -3280,7 +3318,7 @@
\jlreq@setcurrentpage
\jlreq@resultcnt=\numexpr\jlreq@currentpage\ifodd\jlreq@currentpage\else + 1\fi\relax
% このページに表示&上の段処理済みだと\output内では間に合わない
- \ifnum\jlreq@resultcnt=\value{page}\if@firstcolumn\else\jlreq@resultcnt=-1 \fi\fi
+ \ifnum\jlreq@resultcnt=\value{page}\if@firstcolumn\else\jlreq@resultcnt=-1~\fi\fi
}
\else
\def\jlreq@footnote@delayfootnote@page{%
@@ -3291,7 +3329,7 @@
\fi
\long\def\jlreq@footnote@delayfootnote@delay#1#2{%
% 二段組みの場合は上段を組んだ直後に\footnotetextを挿入(そのページの下段に入る)
- \jlreq@if{\ifnum 0\if@firstcolumn\else 1\fi\ifnum#1>\value{page}1\fi>0 \fi}{%
+ \jlreq@if{\ifnum 0\if@firstcolumn\else 1\fi\ifnum#1>\value{page}1\fi>0~\fi}{%
\xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}}}%
}{#2}%
}
@@ -3306,7 +3344,7 @@
}
\long\def\jlreq@footnote@delayfootnote@delay#1#2{%
% 一段組の場合はその前のページを組んだ直後に\footnotetextを挿入.
- \jlreq@if{\ifnum\numexpr#1 - 1\relax>\value{page} \fi}{%
+ \jlreq@if{\ifnum\numexpr#1 - 1\relax>\value{page}~\fi}{%
\xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}}}%
}{#2}%
}
@@ -3356,7 +3394,7 @@
\edef\jlreq@do{%
\unexpanded{\def\jlreq@result{}#2}[\the\value{footnote}]\noexpand\jlreq@result
\unexpanded{\def\jlreq@result{}#3}[\the\value{footnote}]\unexpanded{{#4}}%
- \jlreq@if{\ifnum\jlreq@resultcnt=-1 \fi}{\noexpand\jlreq@result}{\unexpanded{%
+ \jlreq@if{\ifnum\jlreq@resultcnt=-1~\fi}{\noexpand\jlreq@result}{\unexpanded{%
\xappto\jlreq@footnote@delayfootnoteslist{%
\noexpand\jlreq@footnote@delayfootnote{\the\jlreq@resultcnt}{%
\noexpand\jlreq@restore@original@footnotes
@@ -3383,6 +3421,7 @@
\jlreq@hook@postnote
}
}
+\ExplSyntaxOff
% 合印
\renewcommand*{\@makefnmark}{%
@@ -4740,81 +4779,130 @@
}%
\fi
\setbox\@tempboxa=\hbox{\jlreq@tempa}%
- \edef\jlreq@tempc{\jlreq@jlreqsetup@withenv@nameuse{jlreq@@makecaption@align@setting}{\jlreq@tempb}}%
- \expandafter\let\expandafter\jlreq@align\jlreq@tempc
\ifdim\wd\@tempboxa>\hsize\relax
- {%
- \ifx c\jlreq@align\centering\fi
- \ifx r\jlreq@align\raggedleft\fi
- \unhbox\@tempboxa\par
- }%
+ \edef\jlreq@tempc{\jlreq@jlreqsetup@withenv@nameuse{jlreq@@makecaption@align@setting@large}{\jlreq@tempb}}%
\else
\global\@minipagefalse
- \hbox to\hsize{%
- \ifnum0\ifx c\jlreq@align 1\fi\ifx r\jlreq@align 1\fi>0 \hfil\fi
- \unhbox\@tempboxa
- \ifnum0\ifx c\jlreq@align 1\fi\ifx l\jlreq@align 1\fi>0 \hfil\fi
- \par
- }%
+ \edef\jlreq@tempc{\jlreq@jlreqsetup@withenv@nameuse{jlreq@@makecaption@align@setting@small}{\jlreq@tempb}}%
\fi
- \vskip\belowcaptionskip}}
+ \expandafter\let\expandafter\jlreq@align\jlreq@tempc
+ \ifx c\jlreq@align\centering\fi
+ \ifx r\jlreq@align\raggedleft\fi
+ \unhbox\@tempboxa
+ \par
+ \vskip\belowcaptionskip
+}}
\jlreq@jlreqsetup@add{caption_font}{\jlreq@jlreqsetup@withenv{jlreq@@makecaption@font@envlist}{jlreq@@makecaption@font@setting}{#1}}
\jlreq@jlreqsetup@add{caption_label_font}{\jlreq@jlreqsetup@withenv{jlreq@@makecaption@label@font@envlist}{jlreq@@makecaption@label@font@setting}{#1}}
\jlreq@jlreqsetup@add{caption_label_format}{\jlreq@jlreqsetup@withenv{jlreq@@makecaption@label@format@envlist}{jlreq@@makecaption@label@format@setting}{#1}}
\jlreq@jlreqsetup@add{caption_after_label_space}{\jlreq@jlreqsetup@withenv{jlreq@@makecaption@after@label@space@envlist}{jlreq@@makecaption@after@label@space@setting}{#1}}
-\def\jlreq@@makecaption@align@clearandsetalign#1{%
- \@for\jlreq@tempa:=\jlreq@@makecaption@align@envlist\do{%
- \ifx\jlreq@tempa\@empty\else
- \eappto\jlreq@generalset{\noexpand\let\expandonce{\csname jlreq@@makecaption@align@setting@\jlreq@tempa\endcsname}=\noexpand\@undefined}%
- \fi
- }%
- \appto\jlreq@generalset{%
- \def\jlreq@@makecaption@align@envlist{}%
- \let\jlreq@@makecaption@align@setting=#1%
- }%
+\ExplSyntaxOn
+%%
+%% \jlreq@@makecaption@align@setting@small(@env)に小さい時のalign,jlreq@@makecaption@align@setting@large(@env)に大きいときのalignを入れる.
+%% \l_jlreq_tmpb_tlに各環境の設定クリア
+%% \l_jlreq_tmpc_tlにsmall/largeどちらのも設定
+%% \l_jlreq_tmpd_tlにlarge設定
+%% #1=env,#2=値
+\clist_new:N \g__jlreq_@makecaption_align_envlist_clist
+\cs_set:Nn \__jlreq_@makecaption_align_set:nn {
+ \str_case:nnF {#2} {
+ { center } { \__jlreq_@makecaption_align_set_aux:nnn {#1} { } {c} }
+ { left } { \__jlreq_@makecaption_align_set_aux:nnn {#1} { } {l} }
+ { right } { \__jlreq_@makecaption_align_set_aux:nnn {#1} { } {r} }
+ { top } { \__jlreq_@makecaption_align_set_aux:nnn {#1} { } {l} }
+ { bottom } { \__jlreq_@makecaption_align_set_aux:nnn {#1} { } {r} }
+ { *center } { \__jlreq_@makecaption_align_set_aux:nnn {#1} {*} {c} }
+ { *left } { \__jlreq_@makecaption_align_set_aux:nnn {#1} {*} {l} }
+ { *right } { \__jlreq_@makecaption_align_set_aux:nnn {#1} {*} {r} }
+ { *top } { \__jlreq_@makecaption_align_set_aux:nnn {#1} {*} {l} }
+ { *bottom } { \__jlreq_@makecaption_align_set_aux:nnn {#1} {*} {r} }
+ }{
+ \ClassWarning { jlreq } { Unknown~position~`#2`~in~caption_align,~ignored }
+ }
}
+\cs_generate_variant:Nn \__jlreq_@makecaption_align_set:nn { VV }
+\cs_set:Nn \__jlreq_@makecaption_align_set_aux:nnn {
+ \tl_if_empty:nTF {#1} {
+ \clist_map_inline:Nn \g__jlreq_@makecaption_align_envlist_clist {
+ \tl_put_right:Nx \l_jlreq_tmpb_tl {
+ \exp_not:N \let \exp_not:o {\csname jlreq@@makecaption@align@setting@large##1\endcsname}=\exp_not:N \@undefined
+ }
+ \tl_if_empty:nT {#2} {
+ \tl_put_right:Nx \l_jlreq_tmpb_tl {
+ \exp_not:N \let \exp_not:o {\csname jlreq@@makecaption@align@setting@small##1\endcsname}=\exp_not:N \@undefined
+ }
+ }
+ }
+ }{
+ \tl_put_right:Nn \l_jlreq_tmpb_tl {
+ \clist_gput_right:Nn \g__jlreq_@makecaption_align_envlist_clist {#1}
+ }
+ }
+ \tl_if_empty:nTF {#2} {
+ \tl_put_right:Nn \l_jlreq_tmpc_tl {
+ \expandafter\let\csname jlreq@@makecaption@align@setting@small#1\endcsname=#3
+ \expandafter\let\csname jlreq@@makecaption@align@setting@large#1\endcsname=#3
+ }
+ }{
+ \tl_put_right:Nn \l_jlreq_tmpd_tl {
+ \expandafter\let\csname jlreq@@makecaption@align@setting@large#1\endcsname=#3
+ }
+ }
+}
+\cs_set:Nn \__jlreq_@makecaption_align_set_with_check_value:nn {
+ \tl_if_empty:nTF {#2}
+ { \__jlreq_@makecaption_align_set:nn {} {#1} }
+ { \__jlreq_@makecaption_align_set:nn {@#1} {#2} }
+}
+\cs_generate_variant:Nn \__jlreq_@makecaption_align_set_with_check_value:nn {Vn}
+
+\keys_define:nn { __jlreqsetup_caption_align } {
+ center .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ left .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ right .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ top .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ bottom .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ *center .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ *left .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ *right .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ *top .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ *bottom .code:n = { \__jlreq_@makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+ unknown .code:n = {
+ \clist_map_variable:nNn {#1} \l_jlreq_tmpa_tl {
+ \tl_trim_spaces:N \l_jlreq_tmpa_tl
+ \str_set_eq:NN \l_jlreq_tmpa_str \l_keys_key_str
+ \str_put_left:Nn \l_jlreq_tmpa_str {@}
+ \__jlreq_@makecaption_align_set:VV \l_jlreq_tmpa_str \l_jlreq_tmpa_tl
+ }
+ }
+}
+
\jlreq@jlreqsetup@add{caption_align}{%
- \@ifundefined{jlreq@@makecaption@align@envlist}{\def\jlreq@@makecaption@align@envlist{}}{}%
- \begingroup
- \def\jlreq@generalset{}\def\jlreq@envset{}%
- \jlreq@parsekeyval@nokey{%
- \jlreq@ifempty{##1}{}{%
- \jlreq@switch{##1}{%
- {center}{\jlreq@@makecaption@align@clearandsetalign{c}}
- {left}{\jlreq@@makecaption@align@clearandsetalign{l}}
- {right}{\jlreq@@makecaption@align@clearandsetalign{r}}
- {top}{\jlreq@@makecaption@align@clearandsetalign{l}}
- {bottom}{\jlreq@@makecaption@align@clearandsetalign{r}}
- {%
- \jlreq@switch{##2}{%
- {center}{\eappto\jlreq@envset{\noexpand\let\expandonce{\csname jlreq@@makecaption@align@setting@##1\endcsname}=c}}%
- {left}{\eappto\jlreq@envset{\noexpand\let\expandonce{\csname jlreq@@makecaption@align@setting@##1\endcsname}=l}}%
- {right}{\eappto\jlreq@envset{\noexpand\let\expandonce{\csname jlreq@@makecaption@align@setting@##1\endcsname}=r}}%
- {top}{\eappto\jlreq@envset{\noexpand\let\expandonce{\csname jlreq@@makecaption@align@setting@##1\endcsname}=l}}%
- {bottom}{\eappto\jlreq@envset{\noexpand\let\expandonce{\csname jlreq@@makecaption@align@setting@##1\endcsname}=r}}%
- }%
- \appto\jlreq@envset{%
- \def\jlreq@tempa{\jlreq@helper@removeelement{##1}}%
- \expandafter\jlreq@tempa\expandafter{\jlreq@@makecaption@align@envlist}{\jlreq@@makecaption@align@envlist}%
- \appto\jlreq@@makecaption@align@envlist{,##1}%
- }%
- }%
- }%
- }%
- }{#1}%
- \edef\jlreq@do{\expandonce{\jlreq@generalset}\expandonce{\jlreq@envset}}%
- \expandafter\endgroup
- \jlreq@do
+ \group_begin:
+ \tl_clear:N \l_jlreq_tmpb_tl
+ \tl_clear:N \l_jlreq_tmpc_tl
+ \tl_clear:N \l_jlreq_tmpd_tl
+ \keys_set:nn { __jlreqsetup_caption_align } {#1}
+ \cs_set:Nx \l_jlreq_do:{
+ \exp_not:o \l_jlreq_tmpb_tl
+ \exp_not:o \l_jlreq_tmpc_tl
+ \exp_not:o \l_jlreq_tmpd_tl
+ }
+ \exp_after:wN \group_end:
+ \l_jlreq_do:
}
+\ExplSyntaxOff
+
% 特に根拠のない値
\setlength\abovecaptionskip{.5\jlreq@gol}
\setlength\belowcaptionskip{0pt}
%.. figure環境
\newcounter{figure}
-\ifthenelse{\equal{\jlreq@article@type}{article}}{%
+\ExplSyntaxOn
+\str_if_eq:VnTF \jlreq@article@type { article } {
\renewcommand{\thefigure}{\@arabic\c@figure}
}{%
\@addtoreset{figure}{chapter}
@@ -4829,7 +4917,7 @@
%.. table環境
\newcounter{table}
-\ifthenelse{\equal{\jlreq@article@type}{article}}{%
+\str_if_eq:VnTF \jlreq@article@type { article } {
\renewcommand{\thetable}{\@arabic\c@table}
}{%
\@addtoreset{table}{chapter}
@@ -4841,6 +4929,7 @@
\newcommand*{\fnum@table}{\tablename\thetable}
\newenvironment{table}{\@float{table}}{\end@float}
\newenvironment{table*}{\@dblfloat{table}}{\end@dblfloat}
+\ExplSyntaxOff
%. タイトル周り
\newenvironment{titlepage}{%
@@ -4911,12 +5000,12 @@
\@maketitle
\fi
% \pagestyle{empty}の時はそのまま.
- \bool_if:nT{!(
+ \bool_if:nT {!(
\tl_if_empty_p:o \@oddhead &&
\tl_if_empty_p:o \@evenhead &&
\tl_if_empty_p:o \@oddfoot &&
\tl_if_empty_p:o \@evenfoot
- )}{\thispagestyle{plain}}
+ )} { \thispagestyle{plain} }
\@thanks
\endgroup
\jlreq@endofmaketitle
@@ -4969,7 +5058,8 @@
%.. abstract
\def\jlreq@parhook@abstract{}
-\ifthenelse{\equal{\jlreq@article@type}{book}}{}{% article,report
+\ExplSyntaxOn
+\str_if_eq:VnF \jlreq@article@type { book } {
\newbox\jlreq@abstractbox
\newcommand*{\abstractname}{概要}
\if@titlepage
@@ -5055,6 +5145,7 @@
}
\fi
}
+\ExplSyntaxOff
%. 箇条書き. cf. JISX4051 8.4
% 用語定義型
\newenvironment{description}{\list{}{%
@@ -5094,6 +5185,7 @@
}%
\appto\jlreq@generalset{\expandafter\def\csname #1\endcsname{}}%
}{%
+% \bool_if:nTF{ \str_if_eq_p:nn {##1} {i} || \str_if_eq_p:nn {##1} {ii} || \str_if_eq_p:nn {##1} {iii} || \str_if_eq_p:nn {##1} {iv} || \str_if_eq_p:nn {##1} {v} || \str_if_eq_p:nn {##1} {vi} }{
\ifthenelse{\equal{##1}{i} \OR \equal{##1}{ii} \OR \equal{##1}{iii} \OR \equal{##1}{iv} \OR \equal{##1}{v} \OR \equal{##1}{vi}}{%
% i=とかの時,環境に対応するものをクリアし,\#2@##1に値を入れる
\expandafter\@for\expandafter\jlreq@tempa\expandafter:\expandafter=\csname #1\endcsname\do{
@@ -5128,6 +5220,7 @@
\jlreq@do
}
+
\def\jlreq@itemization@beforeafter@space@envlist{}
\jlreq@jlreqsetup@add{itemization_beforeafter_space}{\jlreq@jlreqsetup@itemization{jlreq@itemization@beforeafter@space@envlist}{jlreq@itemization@beforeafter@space@setting}{#1}}
\jlreq@jlreqsetup@add{itemization_itemsep}{\jlreq@jlreqsetup@withenv{jlreq@itemization@itemsep@envlist}{jlreq@itemization@itemsep@setting}{#1}}
@@ -5236,12 +5329,14 @@
\setlength\fboxsep{.3\zw}
\setlength\fboxrule{\jlreq@omotekeiwidth} % 根拠はない
% 後で
-\ifthenelse{\equal{\jlreq@article@type}{article}}{%
+\ExplSyntaxOn
+\str_if_eq:VnTF \jlreq@article@type { article } {
\renewcommand{\theequation}{\@arabic\c@equation}
}{%
\@addtoreset{equation}{chapter}
\renewcommand{\theequation}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@equation}
}
+\ExplSyntaxOff
%. 目次
\setcounter{tocdepth}{3}
@@ -5271,7 +5366,8 @@
\jlreq@top@contents=#1\relax
\fi
}
-\ifthenelse{\equal{\jlreq@article@type}{article}}{
+\ExplSyntaxOn
+\str_if_eq:VnTF \jlreq@article@type { article } {
\newcommand{\tableofcontents}{%
\jlreq@top@contents=-100\relax
\if@twocolumn
@@ -5298,6 +5394,8 @@
\if@restonecol\twocolumn\fi
}
}
+\ExplSyntaxOff
+
% JIS X 4051自身の目次に近づけようかと……なりきれてないけど.
% 文字の大きさは全て同じ(\normalsize)にする.
% 見出しのレベルがあがると1文字分ずつ字下げしていく.
@@ -5714,16 +5812,16 @@
\jlreq@saveoriginalcs{kanjishape}
\ifx l\jlreq@engine
\cs_set:Nn \l_jlreq_tmpa:n {
- \NewDocumentCommand{\jidori}{m m}{
- \mode_if_vertical:TF{\leavevmode}{}
+ \NewDocumentCommand { \jidori } { m m } {
+ \mode_if_vertical:TF { \leavevmode } {}
\group_begin:
\ltj@setpar@global
\ltjsetkanjiskip 0pt~plus~1fil~minus~0pt
\ltjsetxkanjiskip 0pt~plus~1fil~minus~0pt
- \renewcommand*{\jlreqkanjiskip}{0pt~plus~1fil~minus~0pt}
- \renewcommand*{\jlreqxkanjiskip}{0pt~plus~1fil~minus~0pt}
- \hbox_to_wd:nn {##1}{
- \def#1{ }
+ \renewcommand*{ \jlreqkanjiskip } { 0pt~plus~1fil~minus~0pt }
+ \renewcommand*{ \jlreqxkanjiskip } { 0pt~plus~1fil~minus~0pt }
+ \hbox_to_wd:nn {##1} {
+ \def#1 { }
\kanjishape{n-jidori}\selectfont
\def\kanjishape####1{\jlreq@useoriginalcs{kanjishape}{####1-jidori}}
##2
@@ -5736,14 +5834,14 @@
\l_jlreq_tmpa:n{ }
\catcode` =12
\else
- \NewDocumentCommand{\jidori}{m m}{
- \mode_if_vertical:TF{\leavevmode}{}
+ \NewDocumentCommand { \jidori } { m m } {
+ \mode_if_vertical:TF { \leavevmode } {}
\group_begin:
- \setlength{\kanjiskip}{0pt~plus~15zw~minus~0pt}
- \setlength{\xkanjiskip}{0pt~plus~15zw~minus~0pt}
- \renewcommand*{\jlreqkanjiskip}{0pt~plus~15zw~minus~0pt}
- \renewcommand*{\jlreqxkanjiskip}{0pt~plus~15zw~minus~0pt}
- \hbox_to_wd:nn {#1}{
+ \setlength { \kanjiskip } { 0pt~plus~15zw~minus~0pt }
+ \setlength { \xkanjiskip } { 0pt~plus~15zw~minus~0pt }
+ \renewcommand* { \jlreqkanjiskip } { 0pt~plus~15zw~minus~0pt }
+ \renewcommand* { \jlreqxkanjiskip } { 0pt~plus~15zw~minus~0pt }
+ \hbox_to_wd:nn {#1} {
\kanjishape{n-jidori}\selectfont
\inhibitglue #2
\hskip\glueexpr 0pt~minus~1fil\relax
@@ -5985,7 +6083,7 @@
caption_label_font={\sffamily\gtfamily\bfseries},
caption_after_label_space=1\jlreq@zw,
caption_label_format={#1},
- caption_align=center
+ caption_align={center,*left}
}
%.. 箇条書き
@@ -6041,6 +6139,7 @@
}
%.. 引用
+\ExplSyntaxOn
\jlreqsetup{
quote_indent=2\jlreq@zw,
quote_end_indent=0pt,
@@ -6049,7 +6148,7 @@
}
%.. その他
-\ifthenelse{\equal{\jlreq@article@type}{book}}{
+\str_if_eq:VnT \jlreq@article@type { book } {
\jlreqsetup{
frontmatter_pagebreak = cleardoublepage,
frontmatter_pagestyle = {plain,restore = true},
@@ -6092,8 +6191,8 @@
mainmatter_pagination = {arabic},
backmatter_pagination = {continuous,arabic},
}
-}{}
-\ifthenelse{\equal{\jlreq@article@type}{article}}{
+}
+\str_if_eq:VnTF \jlreq@article@type { article } {
\if@tate
\jlreqsetup{
appendix_counter = {
@@ -6129,7 +6228,7 @@
chapter = {label_format = {付録\thechapter}}
},
appendix_postcode = {%
- \ifthenelse{\equal{\jlreq@current@pagestyle}{headings}}{%
+ \str_if_eq:VnT \jlreq@current@pagestyle { headings } {
\def\chaptermark#1{\markboth{付録\thechapter\quad #1}{}}%
\ModifyPageStyle{headings}{mark_format={_chapter={付録\thechapter\quad #1}}}%
}{}%
@@ -6137,6 +6236,7 @@
appendix_precode = {}
}
}
+\ExplSyntaxOff
\jlreqsetup{theindex_pagestyle=plain}
\jlreqsetup{year_style=seireki}
\jlreqsetup{