texlive[59376] Master/texmf-dist: jlreq (28may21)

commits+karl at tug.org commits+karl at tug.org
Fri May 28 22:48:24 CEST 2021


Revision: 59376
          http://tug.org/svn/texlive?view=revision&revision=59376
Author:   karl
Date:     2021-05-28 22:48:24 +0200 (Fri, 28 May 2021)
Log Message:
-----------
jlreq (28may21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/jlreq/LICENSE
    trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md
    trunk/Master/texmf-dist/doc/latex/jlreq/README.md
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.pdf
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.pdf
    trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
    trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/LICENSE	2021-05-28 02:55:00 UTC (rev 59375)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/LICENSE	2021-05-28 20:48:24 UTC (rev 59376)
@@ -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:

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md	2021-05-28 02:55:00 UTC (rev 59375)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md	2021-05-28 20:48:24 UTC (rev 59376)
@@ -102,7 +102,7 @@
     \begin{document}
     ```
 
-    のようにします.
+    のようにします.和文と欧文の間の空白((u)pTeXでは`\xkanjiskip`に,LuateX-jaでは`xkanjiskip`パラメータに格納されているもの)も同様に`\jlreqxkanjiskip`を再定義することで変更することができます.
 
 ## 各種設計
 設計はクラスオプションまたは`\jlreqsetup`によりkeyval形式で行います.ただし,クラスオプションではLaTeXの実装により,本来可能な入力が受け付けられないケースがあります.多くの場合は空白を除くことにより解決します.
@@ -164,7 +164,7 @@
 * `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 @@
     - `\item`直後のJFMグルーをなくした.
     - 同行見出し直後のJFMグルーをなくした.
     - バグ修正.
+* 2021-05-28
+    - `\jlreqsetup`の`caption_align`を拡張.
+    - `\ifthenelse`を少し削除.
 
 --------------
 Noriyuki Abe

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README.md	2021-05-28 02:55:00 UTC (rev 59375)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README.md	2021-05-28 20:48:24 UTC (rev 59376)
@@ -139,6 +139,9 @@
     - Removed JFM glue after `\item`.
     - Removed JFM glue after block headings.
     - Fixed bugs.
+* 2021-05-28
+    - Extended `caption_align` in `\jlreqsetup`.
+    - Removed some `\ifthenelse`.
 
 
 --------------

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html	2021-05-28 02:55:00 UTC (rev 59375)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html	2021-05-28 20:48:24 UTC (rev 59376)
@@ -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=<フォント設定コード></code>:キャプションのラベルのフォントを指定します.</li>
 <li><code>caption_after_label_space=<寸法></code>:ラベルとキャプションの間の空きを指定します.</li>
 <li><code>caption_label_format=<コード></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>

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html	2021-05-28 02:55:00 UTC (rev 59375)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html	2021-05-28 20:48:24 UTC (rev 59376)
@@ -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>

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty	2021-05-28 02:55:00 UTC (rev 59375)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty	2021-05-28 20:48:24 UTC (rev 59376)
@@ -62,9 +62,9 @@
 
 % 条件.\jlreq at if{\ifnum\@count=1 \fi}{<TRUE>}{<FALSE>}みたいに使う
 \def\jlreq at if@endmark{\jlreq at if@endmark}
-\def\jlreq at if#1{\jlreq at if@#1\jlreq at if@endmark}
+\long\def\jlreq at if#1{\jlreq at if@#1\jlreq at if@endmark}
 \@gobbletwo\if\if
-\def\jlreq at if@#1\fi\jlreq at if@endmark{#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+\long\def\jlreq at if@#1\fi\jlreq at if@endmark{#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
 
 % #1の先頭が引数なしのマクロか
 \long\def\jlreq at ifmacro@noargument#1{%
@@ -177,7 +177,7 @@
 % カンマで区切って,その前と後ろを\jlreq at resulta,\jlreq at resultbに入れる
 % もしカンマがない場合は\ifjlreq at resultがfalseになる.
 \newcommand*{\jlreq at helper@dividebycomma}[1]{\jlreq at helper@dividebycomma@#1,\jlreq at endmark}
-\def\jlreq at helper@dividebycomma@#1,#2\jlreq at endmark{%
+\long\def\jlreq at helper@dividebycomma@#1,#2\jlreq at endmark{%
   \jlreq at helper@trim{#1}{\jlreq at resulta}%
   \jlreq at helper@trim{#2}{\jlreq at resultb}%
   \jlreq at if{\ifx\jlreq at resultb\@empty\fi}{%
@@ -188,7 +188,7 @@
     \expandafter\jlreq at helper@trim\expandafter{\jlreq at resultb}{\jlreq at resultb}%
   }%
 }
-\def\jlreq at helper@removelastcomma#1,\jlreq at endmark{#1}
+\long\def\jlreq at helper@removelastcomma#1,\jlreq at endmark{#1}
 
 % vbox #1の最後を\jlreq at resultboxに入れる
 % #1の最後の行は消える
@@ -395,9 +395,9 @@
 % \jlreq at reference@ref{ラベル名}{デフォルト値}
 \def\jlreq at reference@ref#1{\jlreq at if{\expandafter\unless\expandafter\ifx\csname jlreq at reference@#1\endcsname\relax\fi}{\csname jlreq at reference@#1\endcsname}}
 % \jlreq at reference@label{ラベル名}{値}
-\def\jlreq at reference@label#1#2{\protected at write\@auxout{}{\string\@newl at bel{jlreq at reference}{#1}{#2}}}%
-\def\jlreq at reference@immediate at write#1#2{\immediate\write\@auxout{\string\@newl at bel{jlreq at reference}{#1}{#2}}}%
-\def\jlreq at reference@ifexist#1{\jlreq at if{\expandafter\unless\expandafter\ifx\csname jlreq at reference@#1\endcsname\relax\fi}}
+\long\def\jlreq at reference@label#1#2{\protected at write\@auxout{}{\string\@newl at bel{jlreq at reference}{#1}{#2}}}%
+\long\def\jlreq at reference@immediate at write#1#2{\immediate\write\@auxout{\string\@newl at bel{jlreq at reference}{#1}{#2}}}%
+\long\def\jlreq at reference@ifexist#1{\jlreq at if{\expandafter\unless\expandafter\ifx\csname jlreq at reference@#1\endcsname\relax\fi}}
 
 % 自動生成されるラベル用の番号
 \newcount\jlreq at reference@count
@@ -423,9 +423,9 @@
     }%
   }%
 }
-\def\jlreq at getfirsttoken@expandmacros@#1#2{\def#2{#1}}
+\long\def\jlreq at getfirsttoken@expandmacros@#1#2{\def#2{#1}}
 
-\def\jlreq at helper@checktokenlist#1#2{%
+\long\def\jlreq at helper@checktokenlist#1#2{%
   \jlreq at ifendmark{#2}{\@firstoftwo}%
   {%
     \jlreq at if{\ifnum0#1{#2}>0 \fi}%

Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls	2021-05-28 02:55:00 UTC (rev 59375)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls	2021-05-28 20:48:24 UTC (rev 59376)
@@ -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 at 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 at temporary@original@@removeelement
 \let\jlreq at temporary@original@@removeelement=\@undefined
 
-\ifjlreq at option@titlepage\else
-  \ifthenelse{\equal{\jlreq at article@type}{article}}{\@titlepagefalse}{\@titlepagetrue}
-\fi
-\ifjlreq at option@open\else
-  \ifthenelse{\equal{\jlreq at article@type}{book}}{\@openrighttrue}{\@openrightfalse}
-\fi
+\ExplSyntaxOn
+\legacy_if:nF { jlreq at option@titlepage } {
+  \str_if_eq:VnTF \jlreq at article@type { article } { \@titlepagefalse } { \@titlepagetrue }
+}
+\legacy_if:nF { jlreq at option@open } {
+  \str_if_eq:VnTF \jlreq at article@type { book } { \@openrighttrue } { \@openrightfalse }
+}
 % articleではopenrightは効かない.
-\ifthenelse{\equal{\jlreq at article@type}{article}}{%
-  \if at openright
-    \ClassWarningNoLine{jlreq}{The option `openright' is ignored in article}
+\str_if_eq:VnT \jlreq at article@type { article } {
+  \legacy_if:nT { @openright } {
+    \ClassWarningNoLine { jlreq } { The~option~`openright'~is~ignored~in~article }
     \@openrightfalse
-  \fi
-}{}
-\ifjlreq at option@twoside\else
-  \ifthenelse{\equal{\jlreq at article@type}{book}}{\@twosidetrue}{\@twosidefalse}
-\fi
+  }
+}
+\legacy_if:nF { jlreq at option@twoside } {
+  \str_if_eq:VnTF \jlreq at article@type { book } { \@twosidetrue } { \@twosidefalse }
+}
+\ExplSyntaxOff
 
 \def\jlreq at jlreqsetup@keyvallist{}
 \def\jlreq at jlreqsetup@finally{}
@@ -355,6 +358,7 @@
 \fi
 
 %.. JFMとluatexjaのロード
+\ExplSyntaxOn
 \ifx l\jlreq at engine
   \def\ltj at stdyokojfm{jlreq}
   \def\ltj at stdtatejfm{jlreqv}
@@ -376,7 +380,9 @@
   \def\jlreq at jfmname@prefix{}
   \jlreq at aftercls@addtodeletecs{\jlreq at jfmname@prefix}
   \ifjlreq at burasage\edef\jlreq at jfmname@prefix{b\jlreq at jfmname@prefix}\fi
-  \ifthenelse{\equal{\jlreq at open@bracket at pos}{zenkakunibu_nibu}}{\edef\jlreq at jfmname@prefix{\jlreq at jfmname@prefix z}}{}
+  \str_if_eq:VnT \jlreq at open@bracket at pos { zenkakunibu_nibu } {
+    \edef\jlreq at jfmname@prefix { \jlreq at jfmname@prefix z }
+  }
   \ifx u\jlreq at engine\edef\jlreq at jfmname@prefix{u\jlreq at jfmname@prefix}\fi
   \edef\jlreq at jfmname{\jlreq at jfmname@prefix jlreq} % JFMの名前
   \edef\jlreq at jfmnameg{\jlreq at jfmname@prefix jlreqg} % ゴシックなJFMの名前
@@ -383,6 +389,7 @@
   \jlreq at aftercls@addtodeletecs{\jlreq at jfmname}
   \jlreq at aftercls@addtodeletecs{\jlreq at jfmnameg}
 \fi
+\ExplSyntaxOff
 
 % (u)pLaTeXの場合ここで初めて\epTeXinputencodingが発行されるので,
 % これ以前には和文は使えない.
@@ -452,13 +459,17 @@
 
 % 左ページであるか
 % #1 : odd or even or ページ数
+\ExplSyntaxOn
 \def\jlreq at 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 at engine
   \newcommand*{\jlreq at getpostbreakpenalty}[1]{\ltjgetparameter{postbreakpenalty}{#1}}
@@ -694,11 +705,13 @@
 
 
 % 行頭の括弧は \jlreq at open@bracket at before@space \inhibitglue 「みたいにする.
-\ifthenelse{\equal{\jlreq at open@bracket at pos}{zenkakunibu_nibu}}{
+\ExplSyntaxOn
+\str_if_eq:VnTF \jlreq at open@bracket at pos { zenkakunibu_nibu } {
   \def\jlreq at open@bracket at before@space{\hskip\glueexpr-.5\jlreq at zw\relax}
 }{
   \def\jlreq at open@bracket at before@space{}
 }
+\ExplSyntaxOff
 
 \ifx p\jlreq at engine
   \def\jlreq at 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 at 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 at 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 at 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 at useoriginalcs{DeclareFontShape} {#1} {#2} {#3} { #4-jidori } {#5} {#6} }
           }
         }
       }
     \exp_after:wN \group_end: \l_jlreq_do:
-    \jlreq at useoriginalcs{DeclareFontShape}{#1}{#2}{#3}{#4}{#5}{#6}
+    \jlreq at useoriginalcs{DeclareFontShape} {#1} {#2} {#3} {#4} {#5} {#6}
   }
   \ExplSyntaxOff
   \DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdmcfont:jfm=jlreq;script=latn;-kern}{}
@@ -754,23 +770,27 @@
   \DeclareFontShape{\jlreq at tatekanjiencoding}{mc}{m}{n-jidori}{<->s*[\jlreq at jafontscale]\jlreq at tempa jlreq-v-jidori}{}
   \DeclareFontShape{\jlreq at tatekanjiencoding}{gt}{m}{n-jidori}{<->s*[\jlreq at jafontscale]\jlreq at tempa jlreqg-v-jidori}{}
 \fi
-\@for\jlreq at encoding:=\jlreq at yokokanjiencoding,\jlreq at tatekanjiencoding\do{
-  \@for\jlreq at shape:=n,it,sl,sc\do{
-    \@for\jlreq at series:=m,b,bx,sb,c\do{
-      \ifthenelse{\equal{\jlreq at shape}{n} \AND \equal{\jlreq at series}{m}}{}{
-        \DeclareFontShape{\jlreq at encoding}{gt}{\jlreq at series}{\jlreq at shape}{<->ssub*gt/m/n}{}
+\ExplSyntaxOn
+\clist_set:NV  \l_jlreq_tmpa_clist \jlreq at yokokanjiencoding
+\clist_push:NV \l_jlreq_tmpa_clist \jlreq at 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 at series:=bx,b,sb\do{
-      \DeclareFontShape{\jlreq at encoding}{mc}{\jlreq at series}{\jlreq at 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 at series:=m,c\do{
-      \ifthenelse{\equal{\jlreq at shape}{n} \AND \equal{\jlreq at series}{m}}{}{
-        \DeclareFontShape{\jlreq at encoding}{mc}{\jlreq at series}{\jlreq at 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 at hook@everypar}}
 \def\jlreq at hook@everypar{}
 \jlreq at saveoriginalcs{item}
+\ExplSyntaxOn
 \ifx l\jlreq at engine
   % \itemの直後は折り返し行頭と同じにする.
   \def\item{%
@@ -823,7 +844,7 @@
   \def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifx\jlreq at nextchar#11\fi}\jlreq at do}}
   \expandafter\jlreq at do\jlreq at charlist@openingbrackets\jlreq at endmark
   % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる.
-  \ifthenelse{\equal{\jlreq at open@bracket at pos}{nibu_tentsuki}}{
+  \str_if_eq:VnTF \jlreq at open@bracket at pos { nibu_tentsuki } {
     \edef\jlreq at openbracket@hook at ii{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 \unexpanded{\hskip -.5\jlreq at zw\inhibitglue}\noexpand\fi}
   }{% zenkakunibu_nibu,zenkaku_tentsuki
     \edef\jlreq at openbracket@hook at ii{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 \unexpanded{\inhibitglue}\noexpand\fi}
@@ -841,6 +862,7 @@
     \jlreq at useoriginalcs{item}%
   }
 \fi
+\ExplSyntaxOff
 
 %.. 禁則処理
 \ifx l\jlreq at engine
@@ -1141,9 +1163,11 @@
 \ifdim\jlreq at fontsize>\jlreq at baselineskip
   \ClassError{jlreq}{The baselineskip is less than fontsize}{\@ehc}%
 \fi
-\ifthenelse{\lengthtest{\jlreq at baselineskip<1.5\zw} \OR \lengthtest{\jlreq at baselineskip>2\zw}}{
-  \jlreq at note{行間は二分以上全角以下が望ましい (2.4.2.d 注3).}
-}{}
+\ExplSyntaxOn
+\bool_if:nT { \dim_compare_p:n { \jlreq at baselineskip < 1.5\zw } || \dim_compare_p:n { \jlreq at baselineskip > 2\zw } } {
+  \jlreq at note { 行間は二分以上全角以下が望ましい (2.4.2.d~注3).}
+}
+\ExplSyntaxOff
 
 \emergencystretch 3\jlreq at gol
 \setlength{\parindent}{1\zw}
@@ -1332,8 +1356,10 @@
 
 % 縦書きの時は脚注に固定
 % (TODO: 頭注)
-\if at tate\@mparswitchfalse\fi
+\@mparswitchfalse
+\if at tate\else\if at twoside\@mparswitchtrue\fi\fi
 
+
 \setlength{\topskip}{1\zw} % フォントサイズと一致させる
 \ifx\jlreq at option@headfoot at verticalpos\@empty
   \if at tate\def\jlreq at option@headfoot at verticalpos{1zw}
@@ -2663,6 +2689,7 @@
   \fi
 }
 
+\ExplSyntaxOn
 \def\jlreq at BlockHeading@spaces at output@#1#2\jlreq at endmark{%
   \def\jlreq at result{}%
   \jlreq at tempcnta=0
@@ -2669,7 +2696,7 @@
   \jlreq at BlockHeading@spaces at output@@#2\jlreq at endmark
   \jlreq at tempatrue % 周りの行取り処理が必要か
   \jlreq at ifempty{#1}{\jlreq at tempafalse}{}%
-  \ifthenelse{\equal{#1}{{}{}{}}}{\jlreq at tempafalse}{}%
+  \tl_if_eq:nnT {#1} {{}{}{}} { \jlreq at tempafalse }
   \edef\jlreq at do{%
     \ifjlreq at tempa
       \unexpanded{\jlreq at BlockHeading@start at gyodori#1}{%
@@ -2682,6 +2709,7 @@
   \jlreq at BlockHeading@spaces at clear
   \jlreq at do
 }
+\ExplSyntaxOff
 % jlreq at resultに出力すべきものを入れていく
 \def\jlreq at BlockHeading@spaces at output@@#1{%
   \jlreq at ifendmark{#1}{}{%
@@ -2992,23 +3020,28 @@
 
 \ExplSyntaxOn
 \NewDocumentCommand{\ModifyHeading}{m m}{
-  \@ifundefined{jlreq at heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}
+  \@ifundefined { jlreq at 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 at HeadingType{#1}} {
-      {BlockHeading}{
+    \str_case_e:nn { \jlreq at 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 at heading@type@#1}{\exp_not:n {#1}}{\exp_not:v {jlreq at heading@level@#1}}{\exp_not:v {jlreq at heading@setting@#1},\exp_not:V \l_jlreq_tmpa_tl}}
+    \cs_set:Nx \l_jlreq_do: {
+      \exp_not:v { jlreq at heading@type@#1 }
+      { \exp_not:n { #1 } }
+      { \exp_not:v { jlreq at heading@level@#1 } }
+      { \exp_not:v { jlreq at heading@setting@#1 },\exp_not:V \l_jlreq_tmpa_tl }
+    }
   \exp_after:wN \group_end:
   \l_jlreq_do:
 }
@@ -3090,9 +3123,10 @@
 \newcommand*\jlreq at referencemark@format[1]{#1}
 \newif\ifjlreqadjustreferencemark
 \jlreqadjustreferencemarktrue
+\ExplSyntaxOn
 \jlreq at jlreqsetup@add{reference_mark}[inline,interlinear]{
   \def\jlreq at referencemark{#1}
-  \ifthenelse{\equal{\jlreq at referencemark}{inline}}{
+  \str_if_eq:VnTF \jlreq at referencemark { inline } {
     \def\jlreq at notemark##1{%
       \jlreq at ifydir{%
         \hbox{}\hbox{\@textsuperscript{\normalfont\jlreq at referencemark@format{##1}}}\hbox{}%
@@ -3112,7 +3146,7 @@
         \jlreq at getfirsttoken@expandmacros{\jlreq at nextchar}{\jlreq at tempa}%
         \expandafter\let\expandafter\jlreq at tempb\jlreq at tempa
       }%
-      \noexpand\jlreq at if{\noexpand\ifnum 0\expandonce{\@tempa}>0 \noexpand\fi}{}{\noexpand\inhibitglue}%
+      \noexpand\jlreq at if{\noexpand\ifnum 0\expandonce{\@tempa}>0~\noexpand\fi}{}{\noexpand\inhibitglue}%
     }
   }{% reference_mark=interlinear
     \def\jlreq at notemark##1{{%
@@ -3132,12 +3166,12 @@
     \ifx l\jlreq at engine
       \def\jlreq at hook@prenote{%
         \jlreq at lastnodechar=\lastnodechar\relax
-        \ifnum\jlreq at lastnodechar>-1 \inhibitglue\fi
+        \ifnum\jlreq at lastnodechar>-1~\inhibitglue\fi
       }
     \else
       % (u)platexの時は代入すると\inhibitglueが効かなくなる
       \def\jlreq at hook@prenote{%
-        \ifnum\lastnodechar>-1 \inhibitglue\fi
+        \ifnum\lastnodechar>-1~\inhibitglue\fi
         \jlreq at lastnodechar=\lastnodechar\relax
       }
     \fi
@@ -3144,6 +3178,7 @@
     \def\jlreq at hook@postnote{\jlreq at fixjfm}
   }
 }
+\ExplSyntaxOff
 % \@footnotemarkをシンプルなものにする
 \def\jlreq at setdefaultnotemark#1#2{%
   \def#1{%
@@ -3192,13 +3227,14 @@
 }
 
 \newcommand{\@makefntext}[1]{\jlreq at makefntext{#1}}
+\ExplSyntaxOn
 \jlreq at jlreqsetup@add{footnote_second_indent}{%
-  \if at tate\else
-    \ifthenelse{
-      \( \lengthtest{0.99\jlreq at zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < 1.01\jlreq at zw} \) \OR 
-      \( \lengthtest{-1.01\jlreq at zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < -0.99\jlreq at zw} \)
-    }{}{\jlreq at 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 at zw < \dimexpr #1\relax } && \dim_compare_p:n { \dimexpr #1\relax < 1.01\jlreq at zw  } ) ||
+      ( \dim_compare_p:n { -1.01\jlreq at zw < \dimexpr #1\relax } && \dim_compare_p:n { \dimexpr #1\relax < -0.99\jlreq at zw } )
+    }{\jlreq at note{脚注が2行以上となった場合,脚注の2行目以下の字下げを1行目より,脚注の文字サイズの全角アキとするか,逆に,1行目の字下げを2行目より,脚注の文字サイズの全角アキとする (4.2.5.d).}}
+  }
   \ifdim\dimexpr #1\relax<0pt
     \def\jlreq at makefntext{}
   \else
@@ -3215,6 +3251,7 @@
     }##1%
   }
 }
+\ExplSyntaxOff
 
 \jlreq at jlreqsetup@add{footnotetext_indent}{
   \ClassWarningNoLine{jlreq}{footnotetext_indent was removed}
@@ -3263,7 +3300,8 @@
   \let\footnotetext=\jlreq at temporary@saved at 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 at footnote@delayfootnoteslist{}
@@ -3280,7 +3318,7 @@
         \jlreq at setcurrentpage
         \jlreq at resultcnt=\numexpr\jlreq at currentpage\ifodd\jlreq at currentpage\else + 1\fi\relax
         % このページに表示&上の段処理済みだと\output内では間に合わない
-        \ifnum\jlreq at resultcnt=\value{page}\if at firstcolumn\else\jlreq at resultcnt=-1 \fi\fi
+        \ifnum\jlreq at resultcnt=\value{page}\if at firstcolumn\else\jlreq at resultcnt=-1~\fi\fi
       }
     \else
       \def\jlreq at footnote@delayfootnote at page{%
@@ -3291,7 +3329,7 @@
     \fi
     \long\def\jlreq at footnote@delayfootnote at delay#1#2{%
       % 二段組みの場合は上段を組んだ直後に\footnotetextを挿入(そのページの下段に入る)
-      \jlreq at if{\ifnum 0\if at firstcolumn\else 1\fi\ifnum#1>\value{page}1\fi>0 \fi}{%
+      \jlreq at if{\ifnum 0\if at firstcolumn\else 1\fi\ifnum#1>\value{page}1\fi>0~\fi}{%
         \xappto\jlreq at footnote@delayfootnoteslist{\unexpanded{\jlreq at footnote@delayfootnote{#1}{#2}}}%
       }{#2}%
     }
@@ -3306,7 +3344,7 @@
     }
     \long\def\jlreq at footnote@delayfootnote at delay#1#2{%
       % 一段組の場合はその前のページを組んだ直後に\footnotetextを挿入.
-      \jlreq at if{\ifnum\numexpr#1 - 1\relax>\value{page} \fi}{%
+      \jlreq at if{\ifnum\numexpr#1 - 1\relax>\value{page}~\fi}{%
         \xappto\jlreq at footnote@delayfootnoteslist{\unexpanded{\jlreq at footnote@delayfootnote{#1}{#2}}}%
       }{#2}%
     }
@@ -3356,7 +3394,7 @@
       \edef\jlreq at do{%
         \unexpanded{\def\jlreq at result{}#2}[\the\value{footnote}]\noexpand\jlreq at result
         \unexpanded{\def\jlreq at result{}#3}[\the\value{footnote}]\unexpanded{{#4}}%
-        \jlreq at if{\ifnum\jlreq at resultcnt=-1 \fi}{\noexpand\jlreq at result}{\unexpanded{%
+        \jlreq at if{\ifnum\jlreq at resultcnt=-1~\fi}{\noexpand\jlreq at result}{\unexpanded{%
           \xappto\jlreq at footnote@delayfootnoteslist{%
             \noexpand\jlreq at footnote@delayfootnote{\the\jlreq at resultcnt}{%
               \noexpand\jlreq at restore@original at footnotes
@@ -3383,6 +3421,7 @@
     \jlreq at hook@postnote
   }
 }
+\ExplSyntaxOff
 
 % 合印
 \renewcommand*{\@makefnmark}{%
@@ -4740,24 +4779,19 @@
     }%
   \fi
   \setbox\@tempboxa=\hbox{\jlreq at tempa}%
-  \edef\jlreq at tempc{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at align@setting}{\jlreq at tempb}}%
-  \expandafter\let\expandafter\jlreq at align\jlreq at tempc
   \ifdim\wd\@tempboxa>\hsize\relax
-    {%
-      \ifx c\jlreq at align\centering\fi
-      \ifx r\jlreq at align\raggedleft\fi
-      \unhbox\@tempboxa\par
-    }%
+    \edef\jlreq at tempc{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at align@setting at large}{\jlreq at tempb}}%
   \else
     \global\@minipagefalse
-    \hbox to\hsize{%
-      \ifnum0\ifx c\jlreq at align 1\fi\ifx r\jlreq at align 1\fi>0 \hfil\fi
-      \unhbox\@tempboxa
-      \ifnum0\ifx c\jlreq at align 1\fi\ifx l\jlreq at align 1\fi>0 \hfil\fi
-      \par
-    }%
+    \edef\jlreq at tempc{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at align@setting at small}{\jlreq at tempb}}%
   \fi
-  \vskip\belowcaptionskip}}
+  \expandafter\let\expandafter\jlreq at align\jlreq at tempc
+  \ifx c\jlreq at align\centering\fi
+  \ifx r\jlreq at align\raggedleft\fi
+  \unhbox\@tempboxa
+  \par
+  \vskip\belowcaptionskip
+}}
 
 \jlreq at jlreqsetup@add{caption_font}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at font@envlist}{jlreq@@makecaption at font@setting}{#1}}
 \jlreq at jlreqsetup@add{caption_label_font}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at label@font at envlist}{jlreq@@makecaption at label@font at setting}{#1}}
@@ -4764,50 +4798,103 @@
 \jlreq at jlreqsetup@add{caption_label_format}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at label@format at envlist}{jlreq@@makecaption at label@format at setting}{#1}}
 \jlreq at jlreqsetup@add{caption_after_label_space}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at after@label at space@envlist}{jlreq@@makecaption at after@label at space@setting}{#1}}
 
-\def\jlreq@@makecaption at align@clearandsetalign#1{%
-  \@for\jlreq at tempa:=\jlreq@@makecaption at align@envlist\do{%
-    \ifx\jlreq at tempa\@empty\else
-      \eappto\jlreq at generalset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@\jlreq at tempa\endcsname}=\noexpand\@undefined}%
-    \fi
-  }%
-  \appto\jlreq at generalset{%
-    \def\jlreq@@makecaption at align@envlist{}%
-    \let\jlreq@@makecaption at align@setting=#1%
-  }%
+\ExplSyntaxOn
+%% 
+%% \jlreq@@makecaption at align@setting at small(@env)に小さい時のalign,jlreq@@makecaption at align@setting at 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_ at makecaption_align_envlist_clist
+\cs_set:Nn \__jlreq_ at makecaption_align_set:nn {
+  \str_case:nnF {#2} {
+    { center }  { \__jlreq_ at makecaption_align_set_aux:nnn {#1} { } {c} }
+    { left }    { \__jlreq_ at makecaption_align_set_aux:nnn {#1} { } {l} }
+    { right }   { \__jlreq_ at makecaption_align_set_aux:nnn {#1} { } {r} }
+    { top }     { \__jlreq_ at makecaption_align_set_aux:nnn {#1} { } {l} }
+    { bottom }  { \__jlreq_ at makecaption_align_set_aux:nnn {#1} { } {r} }
+    { *center } { \__jlreq_ at makecaption_align_set_aux:nnn {#1} {*} {c} }
+    { *left }   { \__jlreq_ at makecaption_align_set_aux:nnn {#1} {*} {l} }
+    { *right }  { \__jlreq_ at makecaption_align_set_aux:nnn {#1} {*} {r} }
+    { *top }    { \__jlreq_ at makecaption_align_set_aux:nnn {#1} {*} {l} }
+    { *bottom } { \__jlreq_ at makecaption_align_set_aux:nnn {#1} {*} {r} }
+  }{
+    \ClassWarning { jlreq } { Unknown~position~`#2`~in~caption_align,~ignored }
+  }
 }
+\cs_generate_variant:Nn \__jlreq_ at makecaption_align_set:nn { VV }
+\cs_set:Nn \__jlreq_ at makecaption_align_set_aux:nnn {
+  \tl_if_empty:nTF {#1} {
+    \clist_map_inline:Nn \g__jlreq_ at makecaption_align_envlist_clist {
+      \tl_put_right:Nx \l_jlreq_tmpb_tl {
+        \exp_not:N \let \exp_not:o {\csname jlreq@@makecaption at align@setting at 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 at align@setting at small##1\endcsname}=\exp_not:N \@undefined
+        }
+      }
+    }
+  }{
+    \tl_put_right:Nn \l_jlreq_tmpb_tl {
+      \clist_gput_right:Nn \g__jlreq_ at makecaption_align_envlist_clist {#1}
+    }
+  }
+  \tl_if_empty:nTF {#2} {
+    \tl_put_right:Nn \l_jlreq_tmpc_tl {
+      \expandafter\let\csname jlreq@@makecaption at align@setting at small#1\endcsname=#3
+      \expandafter\let\csname jlreq@@makecaption at align@setting at large#1\endcsname=#3
+    }
+  }{
+    \tl_put_right:Nn \l_jlreq_tmpd_tl {
+      \expandafter\let\csname jlreq@@makecaption at align@setting at large#1\endcsname=#3
+    }
+  }
+}
+\cs_set:Nn \__jlreq_ at makecaption_align_set_with_check_value:nn {
+  \tl_if_empty:nTF {#2}
+    { \__jlreq_ at makecaption_align_set:nn {}    {#1} }
+    { \__jlreq_ at makecaption_align_set:nn {@#1} {#2} }
+}
+\cs_generate_variant:Nn \__jlreq_ at makecaption_align_set_with_check_value:nn {Vn}
+
+\keys_define:nn { __jlreqsetup_caption_align } {
+  center .code:n =  { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  left .code:n =    { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  right .code:n =   { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  top .code:n =     { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  bottom .code:n =  { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  *center .code:n = { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  *left .code:n =   { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  *right .code:n =  { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  *top .code:n =    { \__jlreq_ at makecaption_align_set_with_check_value:Vn \l_keys_key_str {#1} },
+  *bottom .code:n = { \__jlreq_ at 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_ at makecaption_align_set:VV \l_jlreq_tmpa_str \l_jlreq_tmpa_tl
+    }
+  }
+}
+
 \jlreq at jlreqsetup@add{caption_align}{%
-  \@ifundefined{jlreq@@makecaption at align@envlist}{\def\jlreq@@makecaption at align@envlist{}}{}%
-  \begingroup
-    \def\jlreq at generalset{}\def\jlreq at envset{}%
-    \jlreq at parsekeyval@nokey{%
-      \jlreq at ifempty{##1}{}{%
-        \jlreq at switch{##1}{%
-          {center}{\jlreq@@makecaption at align@clearandsetalign{c}}
-          {left}{\jlreq@@makecaption at align@clearandsetalign{l}}
-          {right}{\jlreq@@makecaption at align@clearandsetalign{r}}
-          {top}{\jlreq@@makecaption at align@clearandsetalign{l}}
-          {bottom}{\jlreq@@makecaption at align@clearandsetalign{r}}
-          {%
-            \jlreq at switch{##2}{%
-              {center}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=c}}%
-              {left}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=l}}%
-              {right}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=r}}%
-              {top}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=l}}%
-              {bottom}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=r}}%
-            }%
-            \appto\jlreq at envset{%
-              \def\jlreq at tempa{\jlreq at helper@removeelement{##1}}%
-              \expandafter\jlreq at tempa\expandafter{\jlreq@@makecaption at align@envlist}{\jlreq@@makecaption at align@envlist}%
-              \appto\jlreq@@makecaption at align@envlist{,##1}%
-            }%
-          }%
-        }%
-      }%
-    }{#1}%
-    \edef\jlreq at do{\expandonce{\jlreq at generalset}\expandonce{\jlreq at envset}}%
-  \expandafter\endgroup
-  \jlreq at 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 at gol}
 \setlength\belowcaptionskip{0pt}
@@ -4814,7 +4901,8 @@
 
 %.. figure環境
 \newcounter{figure}
-\ifthenelse{\equal{\jlreq at article@type}{article}}{%
+\ExplSyntaxOn
+\str_if_eq:VnTF \jlreq at article@type { article } {
   \renewcommand{\thefigure}{\@arabic\c at figure}
 }{%
   \@addtoreset{figure}{chapter}
@@ -4829,7 +4917,7 @@
 
 %.. table環境
 \newcounter{table}
-\ifthenelse{\equal{\jlreq at article@type}{article}}{%
+\str_if_eq:VnTF \jlreq at article@type { article } {
   \renewcommand{\thetable}{\@arabic\c at table}
 }{%
   \@addtoreset{table}{chapter}
@@ -4841,6 +4929,7 @@
 \newcommand*{\fnum at table}{\tablename\thetable}
 \newenvironment{table}{\@float{table}}{\end at float}
 \newenvironment{table*}{\@dblfloat{table}}{\end at 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 at endofmaketitle
@@ -4969,7 +5058,8 @@
 
 %.. abstract
 \def\jlreq at parhook@abstract{}
-\ifthenelse{\equal{\jlreq at article@type}{book}}{}{% article,report
+\ExplSyntaxOn
+\str_if_eq:VnF \jlreq at article@type { book } {
   \newbox\jlreq at abstractbox
   \newcommand*{\abstractname}{概要}
   \if at titlepage
@@ -5055,6 +5145,7 @@
     }
   \fi
 }
+\ExplSyntaxOff
 %. 箇条書き. cf. JISX4051 8.4
 % 用語定義型
 \newenvironment{description}{\list{}{%
@@ -5094,6 +5185,7 @@
         }%
         \appto\jlreq at 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 at tempa\expandafter:\expandafter=\csname #1\endcsname\do{
@@ -5128,6 +5220,7 @@
   \jlreq at do
 }
 
+
 \def\jlreq at itemization@beforeafter at space@envlist{}
 \jlreq at jlreqsetup@add{itemization_beforeafter_space}{\jlreq at jlreqsetup@itemization{jlreq at itemization@beforeafter at space@envlist}{jlreq at itemization@beforeafter at space@setting}{#1}}
 \jlreq at jlreqsetup@add{itemization_itemsep}{\jlreq at jlreqsetup@withenv{jlreq at itemization@itemsep at envlist}{jlreq at itemization@itemsep at setting}{#1}}
@@ -5236,12 +5329,14 @@
 \setlength\fboxsep{.3\zw}
 \setlength\fboxrule{\jlreq at omotekeiwidth} % 根拠はない
 % 後で
-\ifthenelse{\equal{\jlreq at article@type}{article}}{%
+\ExplSyntaxOn
+\str_if_eq:VnTF \jlreq at article@type { article } {
   \renewcommand{\theequation}{\@arabic\c at equation}
 }{%
   \@addtoreset{equation}{chapter}
   \renewcommand{\theequation}{\ifnum\c at chapter>\z@\thechapter.\fi \@arabic\c at equation}
 }
+\ExplSyntaxOff
 
 %. 目次
 \setcounter{tocdepth}{3}
@@ -5271,7 +5366,8 @@
     \jlreq at top@contents=#1\relax
   \fi
 }
-\ifthenelse{\equal{\jlreq at article@type}{article}}{
+\ExplSyntaxOn
+\str_if_eq:VnTF \jlreq at article@type { article } {
   \newcommand{\tableofcontents}{%
     \jlreq at top@contents=-100\relax
     \if at twocolumn
@@ -5298,6 +5394,8 @@
     \if at restonecol\twocolumn\fi
   }
 }
+\ExplSyntaxOff
+
 % JIS X 4051自身の目次に近づけようかと……なりきれてないけど.
 % 文字の大きさは全て同じ(\normalsize)にする.
 % 見出しのレベルがあがると1文字分ずつ字下げしていく.
@@ -5714,16 +5812,16 @@
 \jlreq at saveoriginalcs{kanjishape}
 \ifx l\jlreq at 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 at 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 at 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 at zw,
   caption_label_format={#1},
-  caption_align=center
+  caption_align={center,*left}
 }
 
 %.. 箇条書き
@@ -6041,6 +6139,7 @@
 }
 
 %.. 引用
+\ExplSyntaxOn
 \jlreqsetup{
   quote_indent=2\jlreq at zw,
   quote_end_indent=0pt,
@@ -6049,7 +6148,7 @@
 }
 
 %.. その他
-\ifthenelse{\equal{\jlreq at article@type}{book}}{
+\str_if_eq:VnT \jlreq at 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 at article@type}{article}}{
+}
+\str_if_eq:VnTF \jlreq at article@type { article } {
   \if at tate
     \jlreqsetup{
       appendix_counter = {
@@ -6129,7 +6228,7 @@
      chapter = {label_format = {付録\thechapter}}
    },
    appendix_postcode = {%
-     \ifthenelse{\equal{\jlreq at current@pagestyle}{headings}}{%
+     \str_if_eq:VnT \jlreq at 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{



More information about the tex-live-commits mailing list.