From 4dcb634d23314d66dc0c44d4f8226133ab0e05b0 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sat, 9 Oct 2021 03:01:01 +0000
Subject: CTAN sync 202110090301

---
 language/japanese/jlreq/jlreq.cls | 306 ++++++++++++++++++++------------------
 1 file changed, 162 insertions(+), 144 deletions(-)

(limited to 'language/japanese/jlreq/jlreq.cls')

diff --git a/language/japanese/jlreq/jlreq.cls b/language/japanese/jlreq/jlreq.cls
index 4cffe13825..bd208994b0 100644
--- a/language/japanese/jlreq/jlreq.cls
+++ b/language/japanese/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/08/12 jlreq]
+\ProvidesClass{jlreq}[2021/10/09 jlreq]
 \RequirePackage{l3keys2e}
 \RequirePackage{ifthen}
 \RequirePackage{jlreq-helpers}
@@ -81,15 +81,16 @@
 % ものは\jlreq@option@<key>に格納する．
 % _とかは@に変換する．
 % エンジン類
-\keys_define:nn { jlreq } { uplatex .code:n = { \let\jlreq@engine=u }, uplatex .value_forbidden:n = true }
-\keys_define:nn { jlreq } { platex .code:n = { \let\jlreq@engine=p }, platex .value_forbidden:n = true }
-\keys_define:nn { jlreq } { lualatex .code:n = { \let\jlreq@engine=l }, lualatex .value_forbidden:n = true }
-
-% 文書のタイプ
-\keys_define:nn { jlreq } { article_type .choices:nn = {article,report,book}{\def\jlreq@article@type{#1}} }
-\keys_define:nn { jlreq } { article .code:n = { \def\jlreq@article@type{article} }, article .value_forbidden:n = true }
-\keys_define:nn { jlreq } { report .code:n = { \def\jlreq@article@type{report} }, report .value_forbidden:n = true }
-\keys_define:nn { jlreq } { book .code:n = { \def\jlreq@article@type{book} }, book .value_forbidden:n = true }
+\keys_define:nn { jlreq } {
+  uplatex .code:n = { \let\jlreq@engine=u }, uplatex .value_forbidden:n = true,
+  platex .code:n = { \let\jlreq@engine=p }, platex .value_forbidden:n = true,
+  lualatex .code:n = { \let\jlreq@engine=l }, lualatex .value_forbidden:n = true,
+  % 文書のタイプ
+  article_type .choices:nn = {article,report,book}{\def\jlreq@article@type{#1}},
+  article .code:n = { \def\jlreq@article@type{article} }, article .value_forbidden:n = true,
+  report .code:n = { \def\jlreq@article@type{report} }, report .value_forbidden:n = true,
+  book .code:n = { \def\jlreq@article@type{book} }, book .value_forbidden:n = true
+}
 
 %.. 基本版面．まずは紙サイズ．
 \tl_new:N \g__jlreq_papersizelist_tl
@@ -171,14 +172,14 @@
 
 %.. フォントサイズ，行長，1ページあたりの行数で基本版面のサイズを決める（2.4.1.a）
 \__jlreq_aftercls_addtodeletecs:N \jlreq@option@fontsize
-\keys_define:nn { jlreq } { fontsize .tl_set:N = \jlreq@option@fontsize }
 \keys_define:nn { jlreq } {
+  fontsize .tl_set:N = \jlreq@option@fontsize,
   10pt .code:n = {\def\jlreq@option@fontsize{10pt}}, 10pt .value_forbidden:n = true,
   11pt .code:n = {\def\jlreq@option@fontsize{11pt}}, 11pt .value_forbidden:n = true,
   12pt .code:n = {\def\jlreq@option@fontsize{12pt}}, 12pt .value_forbidden:n = true,
+  jafontsize .tl_set:N = \jlreq@option@jafontsize,
+  jafontscale .tl_set:N = \jlreq@option@jafontscale
 }
-\keys_define:nn { jlreq } { jafontsize .tl_set:N = \jlreq@option@jafontsize }
-\keys_define:nn { jlreq } { jafontscale .tl_set:N = \jlreq@option@jafontscale }
 \__jlreq_aftercls_addtodeletecs:N \jlreq@option@jafontsize
 \__jlreq_aftercls_addtodeletecs:N \jlreq@option@jafontscale
 %.. 行の長さ
@@ -253,29 +254,35 @@
 \newif\if@tate \@tatefalse
 \newif\ifjlreq@option@titlepage \jlreq@option@titlepagefalse % titlepageかnotitlepageかが指定された
 \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@titlepage
-\keys_define:nn { jlreq } { landscape .code:n = {\@landscapetrue}, landscape .value_forbidden:n = true }
-\keys_define:nn { jlreq } { tombo .code:n = {\ClassWarningNoLine{jlreq}{The~option~`tombo'~is~not~supported~by~jlreq~class.~Please~use~the~jlreq-trimmarks~package}} }
-\keys_define:nn { jlreq } { tombow .code:n = {\ClassWarningNoLine{jlreq}{The~option~`tombow'~is~not~supported~by~jlreq~class.~Please~use~the~jlreq-trimmarks~package}} }
-\keys_define:nn { jlreq } { mentuke .code:n = {\ClassWarningNoLine{jlreq}{The~option~`mentuke'~is~not~supported~by~jlreq~class.~Please~use~the~jlreq-trimmarks~package}} }
-\keys_define:nn { jlreq } { tate .code:n = { \@tatetrue }, tate .value_forbidden:n = true}
+\keys_define:nn { jlreq } {
+  landscape .code:n = {\@landscapetrue}, landscape .value_forbidden:n = true,
+  tombo .code:n = {\ClassWarningNoLine{jlreq}{The~option~`tombo'~is~not~supported~by~jlreq~class.~Please~use~the~jlreq-trimmarks~package}},
+  tombow .code:n = {\ClassWarningNoLine{jlreq}{The~option~`tombow'~is~not~supported~by~jlreq~class.~Please~use~the~jlreq-trimmarks~package}}, 
+  mentuke .code:n = {\ClassWarningNoLine{jlreq}{The~option~`mentuke'~is~not~supported~by~jlreq~class.~Please~use~the~jlreq-trimmarks~package}},
+  tate .code:n = { \@tatetrue }, tate .value_forbidden:n = true
+}
 
 \newif\ifjlreq@option@twoside\jlreq@option@twosidefalse % onesideかtwosideが指定された
 \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@twoside
-\keys_define:nn { jlreq } { oneside .code:n = { \@twosidefalse\@mparswitchfalse\jlreq@option@twosidetrue }, oneside .value_forbidden:n = true }
-\keys_define:nn { jlreq } { twoside .code:n = { \@twosidetrue\@mparswitchtrue\jlreq@option@twosidetrue }, twoside .value_forbidden:n = true }
-\keys_define:nn { jlreq } { onecolumn .code:n = { \@twocolumnfalse }, onecolumn .value_forbidden:n = true }
-\keys_define:nn { jlreq } { twocolumn .code:n = { \@twocolumntrue }, twocolumn .value_forbidden:n = true }
-\keys_define:nn { jlreq } { titlepage .code:n = { \jlreq@option@titlepagetrue\@titlepagetrue }, titlepage .value_forbidden:n = true }
-\keys_define:nn { jlreq } { notitlepage .code:n = { \jlreq@option@titlepagetrue\@titlepagefalse }, notitlepage .value_forbidden:n = true }
-\keys_define:nn { jlreq } { draft .code:n = { \setlength\overfullrule{5pt} }, draft .value_forbidden:n = true }
-\keys_define:nn { jlreq } { final .code:n = { \setlength\overfullrule{0pt} }, final .value_forbidden:n = true }
+\keys_define:nn { jlreq } {
+  oneside .code:n = { \@twosidefalse\@mparswitchfalse\jlreq@option@twosidetrue }, oneside .value_forbidden:n = true,
+  twoside .code:n = { \@twosidetrue\@mparswitchtrue\jlreq@option@twosidetrue }, twoside .value_forbidden:n = true,
+  onecolumn .code:n = { \@twocolumnfalse }, onecolumn .value_forbidden:n = true,
+  twocolumn .code:n = { \@twocolumntrue }, twocolumn .value_forbidden:n = true,
+  titlepage .code:n = { \jlreq@option@titlepagetrue\@titlepagetrue }, titlepage .value_forbidden:n = true,
+  notitlepage .code:n = { \jlreq@option@titlepagetrue\@titlepagefalse }, notitlepage .value_forbidden:n = true,
+  draft .code:n = { \setlength\overfullrule{5pt} }, draft .value_forbidden:n = true,
+  final .code:n = { \setlength\overfullrule{0pt} }, final .value_forbidden:n = true
+}
 \newif\if@openright
 \newif\ifjlreq@option@open \jlreq@option@openfalse % openrightかopenanyが指定された
 \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@open
-\keys_define:nn { jlreq } { openright .code:n = { \@openrighttrue\jlreq@option@opentrue }, openright .value_forbidden:n = true}
-\keys_define:nn { jlreq } { openany .code:n = { \@openrightfalse\jlreq@option@opentrue }, openany .value_forbidden:n = true}
-\keys_define:nn { jlreq } { leqno .code:n = { \input{leqno.clo } }, leqno .value_forbidden:n = true}
-\keys_define:nn { jlreq } { fleqn .code:n = { \input{fleqn.clo } }, fleqn .value_forbidden:n = true}
+\keys_define:nn { jlreq } {
+  openright .code:n = { \@openrighttrue\jlreq@option@opentrue }, openright .value_forbidden:n = true,
+  openany .code:n = { \@openrightfalse\jlreq@option@opentrue }, openany .value_forbidden:n = true,
+  leqno .code:n = { \input{leqno.clo } }, leqno .value_forbidden:n = true,
+  fleqn .code:n = { \input{fleqn.clo } }, fleqn .value_forbidden:n = true
+}
 \newif\ifjlreq@option@enablejfam \jlreq@option@enablejfamtrue
 \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@enablejfam
 \keys_define:nn { jlreq } { disablejfam .code:n = { \jlreq@option@enablejfamfalse }, disablejfam .value_forbidden:n = true}
@@ -291,7 +298,7 @@
   sidenote_length=0pt,column_gap={2zw},
   headfoot_verticalposition = {},headfoot_sidemargin={0pt},
   open_bracket_pos=zenkaku_tentsuki,
-  onecolumn,final}
+  onecolumn,final }
 \ProcessKeysOptions { jlreq }
 
 \legacy_if:nF { jlreq@option@titlepage } {
@@ -1042,7 +1049,11 @@
 % 和文ファミリと欧文ファミリの連動
 \AddToHook{rmfamily}{\prepare@family@series@update@kanji{mc}\mcdefault}
 \AddToHook{sffamily}{\prepare@family@series@update@kanji{gt}\gtdefault}
-\AddToHook{ttfamily}{\prepare@family@series@update@kanji{gt}\gtdefault}
+\ifx l\jlreq@engine
+  \AddToHook{ttfamily}{\prepare@family@series@update@kanji{jtt}\jttdefault}
+\else
+  \AddToHook{ttfamily}{\prepare@family@series@update@kanji{gt}\gtdefault}
+\fi
 
 % 数式フォント設定
 \ifjlreq@option@enablejfam
@@ -1060,17 +1071,17 @@
 \fi
 
 % 和文間隔
-\DeclareRobustCommand*\　{\futurelet\jlreq@nextchar\jlreq@zenkakuspace@ignorespaces}
+\NewDocumentCommand{\　} {} {\futurelet\jlreq@nextchar\jlreq@zenkakuspace@ignorespaces}
 % 後続の空白を無視する処理
 \edef\jlreq@zenkakuspace@ignorespaces{%
   \noexpand\ifx\exp_not:o {\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@zenkakuspace@ignorespaces@\else\expandafter\jlreq@zenkakuspace@main\fi}%
 }
-\expandafter\def\expandafter\jlreq@zenkakuspace@ignorespaces@\space{\　}
+\expandafter\def\expandafter\jlreq@zenkakuspace@ignorespaces@\space{\futurelet\jlreq@nextchar\jlreq@zenkakuspace@ignorespaces}
 \def\jlreq@tempa{}
 \def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\tl_put_right:Nn \jlreq@tempa{\ifnum\lastnodechar=`#1~1\fi}\jlreq@do}}
 \expandafter\jlreq@do\jlreq@charlist@dividingpunctuationmarks\jlreq@endmark
 \edef\@tempa{\noexpand\ifnum0\exp_not:o {\jlreq@tempa}>0~}
-\expandafter\DeclareRobustCommand\expandafter*\expandafter\jlreq@zenkakuspace@main\expandafter{\@tempa
+\expandafter\long\expandafter\def\expandafter\jlreq@zenkakuspace@main\expandafter{\@tempa
     \hskip 1\jlreq@zw\hbox{}%
     \jlreq@lastnodechar=`　
     \expandafter\jlreq@fixjfm
@@ -1103,8 +1114,8 @@
 }
 \def\jlreq@do#1{%
   \jlreq@ifendmark{#1}{}{
-    \expandafter\DeclareRobustCommand\expandafter*\csname #1\endcsname{%
-      \jlreq@ifstar
+    \expandafter\NewDocumentCommand\expandafter{\csname #1\endcsname} { s } {
+      \IfBooleanTF{##1}
         {\hskip .25\jlreq@zw #1\hskip .25\jlreq@zw\ignorespaces}%
         {#1\futurelet\jlreq@nextchar\jlreq@dividingpunctuationmarkscommand}%
     }
@@ -1141,14 +1152,14 @@
 \emergencystretch 3\jlreq@gol
 \setlength{\parindent}{1\zw}
 \hook_gput_code:nnn { cmd/set@fontsize/after } {.} {
-  \expandafter\def\expandafter\size@update\expandafter{\size@update\g__jlreq_setfontsizehook}
+  \expandafter\def\expandafter\size@update\expandafter{\size@update\g__jlreq_setfontsizehook_tl}
 }
-\tl_new:N \g__jlreq_setfontsizehook
-\tl_set:Nn \g__jlreq_setfontsizehook { \dim_compare:nT { \parindent>0pt } { \setlength{\parindent}{1\jlreq@zw} } }
+\tl_new:N \g__jlreq_setfontsizehook_tl
+\tl_set:Nn \g__jlreq_setfontsizehook_tl { \dim_compare:nT { \parindent>0pt } { \setlength{\parindent}{1\jlreq@zw} } }
 \ifx l\jlreq@engine
   \@tempskipa=\ltjgetparameter{kanjiskip}
   \ifdim\@tempskipa=\maxdimen\else
-    \tl_put_right:Nn \g__jlreq_setfontsizehook {%
+    \tl_put_right:Nn \g__jlreq_setfontsizehook_tl {%
       \ltj@setpar@global
       \ltjsetkanjiskip\jlreqkanjiskip
       \@tempskipa=\ltjgetparameter{xkanjiskip}%
@@ -1158,7 +1169,7 @@
     }
   \fi
 \else
-  \tl_put_right:Nn \g__jlreq_setfontsizehook {%
+  \tl_put_right:Nn \g__jlreq_setfontsizehook_tl {%
     \kanjiskip=\jlreqkanjiskip
     \ifdim\xkanjiskip>0pt
       \xkanjiskip=\jlreqxkanjiskip
@@ -1256,7 +1267,6 @@
 \newdimen\jlreq@urakeiwidth
 \jlreq@urakeiwidth=0.4mm
 % 脚注のインデント
-\newdimen\jlreq@footnoteindent
 
 %\RequirePackage{jlreq-debug}
 
@@ -3152,7 +3162,7 @@
 % 罫線の前は行間分，最大＋文字サイズ分伸びる（4.2.5.g）
 \setlength{\skip\footins}{\dimexpr\baselineskip - 1\jlreq@gol \relax plus 1\jlreq@gol}
 % 罫線の長さは，基本版面で設定した行長にもよるが，行長の1/3くらいにする．
-\def\jlreq@footnote@rulewidth{.333\textwidth}
+\def\jlreq@footnote@rulewidth{0.333\columnwidth}
 \begingroup
   \footnotesize
   \edef\jlreq@do{
@@ -3167,21 +3177,12 @@
 \expandafter\endgroup
 \jlreq@do
 
-% インデントの計算：脚注の長さが文字の整数倍になるように字下げする（4.2.5.b）
 \keys_define:nn { jlreqsetup } {
   footnote_indent .code:n = {
     \bool_if:nT { \legacy_if_p:n { @tate } && \dim_compare_p:n { #1 = 0pt } } {
       \jlreq@note{脚注は，一般にその前に区切りのための罫線を挿入するので，字下げは行わなくてよい（4.2.5.b）．}
     }
-    \begingroup
-      \footnotesize
-      \jlreq@footnoteindent=\dimexpr#1\relax
-      \@tempdima=\dimexpr\textwidth - \jlreq@footnoteindent\relax
-      \@tempdimb=1\jlreq@zw
-      \divide\@tempdima\@tempdimb \multiply\@tempdima\@tempdimb
-      \edef\jlreq@do{\noexpand\jlreq@footnoteindent=\the\dimexpr\textwidth - \@tempdima\relax}%
-    \expandafter\endgroup
-    \jlreq@do
+    \def\jlreq@footnoteindent{#1}
   }
 }
 
@@ -3194,20 +3195,26 @@
         ( \dim_compare_p:n { -1.01\jlreq@zw < #1 } && \dim_compare_p:n { #1 < -0.99\jlreq@zw } )
       }{\jlreq@note{脚注が2行以上となった場合，脚注の2行目以下の字下げを1行目より，脚注の文字サイズの全角アキとするか，逆に，1行目の字下げを2行目より，脚注の文字サイズの全角アキとする~(4.2.5.d)．}}
     }
-    \dim_compare:nTF { #1 < 0pt } {
-      \def\jlreq@makefntext{}
-    }{
-      \def\jlreq@makefntext{\addtolength{\leftskip}{\glueexpr #1\relax}}
-    }
-    \long\edef\jlreq@makefntext##1{\exp_not:o {\jlreq@makefntext}%
-      \unexpanded{%
-        \addtolength{\leftskip}{\jlreq@footnoteindent}%
-        \parindent=1\jlreq@zw
-        \noindent
-        \hskip-\glueexpr #1\relax
-        \jlreq@referencemark@format{\@thefnmark}%
-        \hskip\glueexpr 1\jlreq@zw\relax
-      }##1%
+    \cs_set:Npn \jlreq@makefntext ##1 {
+      \skip_if_eq:nnF { #1 } { 0pt } { \addtolength{\leftskip}{\glueexpr #1\relax} }
+      % インデントの計算：脚注の長さが文字の整数倍になるように字下げする（4.2.5.b）
+      \group_begin:
+        \@tempdima=\dimexpr\columnwidth - \jlreq@footnoteindent\relax
+        \@tempdimb=1\jlreq@zw
+        \divide\@tempdima\@tempdimb \multiply\@tempdima\@tempdimb
+        \cs_set:Nx \l__jlreq_do: {
+          \exp_not:N \addtolength { \exp_not:N \leftskip } {\dim_eval:n { \columnwidth - \@tempdima - 0.0001pt } }
+          \exp_not:n {
+            \parindent=1\jlreq@zw
+            \noindent
+            \hskip-\glueexpr #1\relax
+            \jlreq@referencemark@format{\@thefnmark}%
+            \hskip\glueexpr 1\jlreq@zw\relax
+          }
+        }
+      \exp_after:wN \group_end:
+      \l__jlreq_do:
+      ##1
     }
   }
 }
@@ -3393,7 +3400,8 @@
 
 %.. 後注（4.2.4）
 \def\jlreq@endnotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
-\def\jlreq@endnotecounter{footnote}% 後注用のカウンタ名
+\keys_define:nn { jlreqsetup } { endnote_counter .tl_set:N = \jlreq@endnotecounter }
+\keys_set:nn { jlreqsetup } { endnote_counter = footnote }
 % 文字サイズは\footnotesizeを使う
 \newdimen\jlreq@endnote@prepostspace
 % 前の分との間は行間分空ける（4.2.4.f）
@@ -3510,7 +3518,8 @@
 \let\@makeendmark=\@makefnmark
 
 % \theendnoteの出力を仕込む
-\keys_define:nn { jlreqsetup } {endnote_position .code:n = {
+\keys_define:nn { jlreqsetup } {
+  endnote_position .code:n = {
     \AddToHook{jlreq/heading/before}[jlreq/endnote]{}
     \RemoveFromHook{jlreq/heading/before}[jlreq/endnote]
     \jlreq@tempafalse % headingsが指定された
@@ -3583,11 +3592,11 @@
     }%
   }
   \jlreq@setdefaultnotemark\@sidenotemark\@makesidemark
-  \def\jlreq@sidenotecounter{footnote}% 傍注用のカウンタ名
   \keys_define:nn { jlreqsetup } {
-    sidenote_type .choices:nn = { number, symbol } { \def\jlreq@sidenote@type{#1} }
+    sidenote_type .choices:nn = { number, symbol } { \def\jlreq@sidenote@type{#1} },
+    sidenote_counter .tl_set:N = \jlreq@sidenotecounter
   }
-  \def\jlreq@sidenote@type{number}
+  \keys_set:nn { jlreqsetup } { sidenote_type = number, sidenote_counter = footnote}
   \__jlreq_jlreqsetup_addtofinally:n {
     \str_if_eq:VnT \jlreq@sidenote@type { number } {
       \DeclareDocumentCommand { \sidenote } { O{} +m } {
@@ -3656,8 +3665,10 @@
       \let\@makesidemark=\@makefnmark
     }
   }
-  \keys_define:nn { jlreqsetup } { sidenote_symbol .tl_set:N = \jlreq@sidenote@defaultmark }
-  \keys_define:nn { jlreqsetup } { sidenote_keyword_font .tl_set:N = \jlreq@sidenote@keywordfont }
+  \keys_define:nn { jlreqsetup } {
+    sidenote_symbol .tl_set:N = \jlreq@sidenote@defaultmark,
+    sidenote_keyword_font .tl_set:N = \jlreq@sidenote@keywordfont
+  }
 }
 
 %.. 割注（3.4）
@@ -4495,13 +4506,13 @@
         \legacy_if_p:n { @tate } && (
           \str_if_eq_p:ee { \expandafter\@secondoftwo\jlreq@nombre@i@position } { right } ||
           \str_if_eq_p:ee { \expandafter\@secondoftwo\jlreq@running@head@i@position }{ right }
-          ))}{
-      )) || (
+        )
+      ) || (
         (! \legacy_if_p:n { @tate } ) && (
           \str_if_eq_p:ee { \expandafter\@secondoftwo\jlreq@nombre@i@position }{ left } ||
           \str_if_eq_p:ee { \expandafter\@secondoftwo\jlreq@running@head@i@position }{ left }
         )
-      )}{
+      ) } {
         \if@twoside
           \jlreq@note{柱やノンブルは，左ページでは，基本版面の左端の延長線にノンブル又は柱の先頭をそろえて配置するか，基本版面の左端の延長線から基本版面の文字サイズの全角アキだけ右に寄せた位置に配置する (ページスタイル #1 内，2.6.1.b)．}%
         \fi
@@ -4793,10 +4804,12 @@
   \vskip\belowcaptionskip
 }}
 
-\keys_define:nn { jlreqsetup } {caption_font .code:n = {\jlreq@jlreqsetup@withenv{jlreq@@makecaption@font@envlist}{jlreq@@makecaption@font@setting}{#1}}}
-\keys_define:nn { jlreqsetup } {caption_label_font .code:n = {\jlreq@jlreqsetup@withenv{jlreq@@makecaption@label@font@envlist}{jlreq@@makecaption@label@font@setting}{#1}}}
-\keys_define:nn { jlreqsetup } {caption_label_format .code:n = {\jlreq@jlreqsetup@withenv{jlreq@@makecaption@label@format@envlist}{jlreq@@makecaption@label@format@setting}{#1}}}
-\keys_define:nn { jlreqsetup } {caption_after_label_space .code:n = {\jlreq@jlreqsetup@withenv{jlreq@@makecaption@after@label@space@envlist}{jlreq@@makecaption@after@label@space@setting}{#1}}}
+\keys_define:nn { jlreqsetup } {
+  caption_font .code:n = {\jlreq@jlreqsetup@withenv{jlreq@@makecaption@font@envlist}{jlreq@@makecaption@font@setting}{#1}},
+  caption_label_font .code:n = {\jlreq@jlreqsetup@withenv{jlreq@@makecaption@label@font@envlist}{jlreq@@makecaption@label@font@setting}{#1}},
+  caption_label_format .code:n = {\jlreq@jlreqsetup@withenv{jlreq@@makecaption@label@format@envlist}{jlreq@@makecaption@label@format@setting}{#1}},
+  caption_after_label_space .code:n = {\jlreq@jlreqsetup@withenv{jlreq@@makecaption@after@label@space@envlist}{jlreq@@makecaption@after@label@space@setting}{#1}}
+}
 
 %% 
 %% \jlreq@@makecaption@align@setting@small(@env)に小さい時のalign，jlreq@@makecaption@align@setting@large(@env)に大きいときのalignを入れる．
@@ -5219,10 +5232,12 @@
 
 
 \def\jlreq@itemization@beforeafter@space@envlist{}
-\keys_define:nn { jlreqsetup } {itemization_beforeafter_space .code:n = {\jlreq@jlreqsetup@itemization{jlreq@itemization@beforeafter@space@envlist}{jlreq@itemization@beforeafter@space@setting}{#1}}}
-\keys_define:nn { jlreqsetup } {itemization_itemsep .code:n = {\jlreq@jlreqsetup@withenv{jlreq@itemization@itemsep@envlist}{jlreq@itemization@itemsep@setting}{#1}}}
-\keys_define:nn { jlreqsetup } {itemization_labelsep .code:n = {\jlreq@jlreqsetup@withenv{jlreq@itemization@labelsep@envlist}{jlreq@itemization@labelsep@setting}{#1}}}
-\keys_define:nn { jlreqsetup } {itemization_label_length .code:n = {\jlreq@jlreqsetup@itemization{jlreq@itemization@label@length@envlist}{jlreq@itemization@label@length@setting}{#1}}}
+\keys_define:nn { jlreqsetup } {
+  itemization_beforeafter_space .code:n = {\jlreq@jlreqsetup@itemization{jlreq@itemization@beforeafter@space@envlist}{jlreq@itemization@beforeafter@space@setting}{#1}},
+  itemization_itemsep .code:n = {\jlreq@jlreqsetup@withenv{jlreq@itemization@itemsep@envlist}{jlreq@itemization@itemsep@setting}{#1}},
+  itemization_labelsep .code:n = {\jlreq@jlreqsetup@withenv{jlreq@itemization@labelsep@envlist}{jlreq@itemization@labelsep@setting}{#1}},
+  itemization_label_length .code:n = {\jlreq@jlreqsetup@itemization{jlreq@itemization@label@length@envlist}{jlreq@itemization@label@length@setting}{#1}}
+}
 % enumerate, itemize用初期化，#1 = i,ii,...
 \def\jlreq@init@list#1{%
   \setlength{\partopsep}{0pt}%
@@ -5245,14 +5260,14 @@
 \def\@listvi{\jlreq@init@list{vi}}
 
 % 引用系．3.5.2の例．
-\keys_define:nn { jlreqsetup } { quote_indent .tl_set:N = \jlreq@quote@indent }
-\keys_define:nn { jlreqsetup } { quote_end_indent .tl_set:N = \jlreq@quote@end@indent }
-\keys_define:nn { jlreqsetup }{
+\keys_define:nn { jlreqsetup } {
+  quote_indent .tl_set:N = \jlreq@quote@indent,
+  quote_end_indent .tl_set:N = \jlreq@quote@end@indent,
   quote_fontsize .choices:nn = {normalsize,small,footnotesize,scriptsize,tiny,{}}{
     \jlreq@ifempty{#1}{\def\jlreq@quote@fontsize{}}{\edef\jlreq@quote@fontsize{\exp_not:c {#1}}}
-  }
+  },
+  quote_beforeafter_space .tl_set:N = \jlreq@quote@beforeafter@space
 }
-\keys_define:nn { jlreqsetup } { quote_beforeafter_space .tl_set:N = \jlreq@quote@beforeafter@space }
 
 \newenvironment{verse}
   {\let\\\@centercr
@@ -5490,7 +5505,8 @@
 \newcommand{\subsubitem}{\@idxitem \hspace*{3\jlreq@mol}}
 \newcommand{\indexspace}{\par \vskip 1\jlreq@gol \@plus .5\jlreq@gol \@minus .3\jlreq@gol\relax}
 \def\jlreq@theindex@pagestyle{}
-\keys_define:nn { jlreqsetup } {theindex_pagestyle .code:n = {
+\keys_define:nn { jlreqsetup } {
+  theindex_pagestyle .code:n = {
     \def\jlreq@tempa{}% ページスタイル名
     \def\jlreq@theindex@pagestyle{}%
     \jlreq@tempafalse % restore
@@ -5595,10 +5611,11 @@
 \str_if_eq:VnT \jlreq@article@type { book } {
   \newif\if@mainmatter
   \@mainmattertrue
-  \keys_define:nn { jlreqsetup } {frontmatter_pagebreak .code:n = {%
-    \edef\jlreq@frontmatter@pagebreak{\jlreq@ifempty{#1}{}{\exp_not:c {#1}}}%
-  }}
-  \keys_define:nn { jlreqsetup } {frontmatter_counter .code:n = {%
+  \keys_define:nn { jlreqsetup } {
+    frontmatter_pagebreak .code:n = {
+      \edef\jlreq@frontmatter@pagebreak{\jlreq@ifempty{#1}{}{\exp_not:c {#1}}}
+    },
+    frontmatter_counter .code:n = {%
       \def\jlreq@frontmatter@counter{}%
       \tl_set:Nn \jlreq@frontmatter@counter { \seq_gclear:N \g__jlreq_frontmatter_resetcounter_seq }
       \jlreq@parsekeyval@nokey{%
@@ -5619,10 +5636,9 @@
         \fi
         \tl_put_right:NV \jlreq@frontmatter@counter \jlreq@tempb
       }{#1}%
-    }
-  }
-  \keys_define:nn { jlreqsetup } {frontmatter_heading .code:n = {\jlreq@matter@heading[\jlreq@frontmatter@restoreheadings]{jlreq@frontmatter@savedheading}{\jlreq@frontmatter@heading}{#1}}}
-  \keys_define:nn { jlreqsetup } {frontmatter_pagestyle .code:n = {%
+    },
+    frontmatter_heading .code:n = {\jlreq@matter@heading[\jlreq@frontmatter@restoreheadings]{jlreq@frontmatter@savedheading}{\jlreq@frontmatter@heading}{#1}},
+    frontmatter_pagestyle .code:n = {%
       \def\jlreq@tempa{}% ページスタイル名
       \def\jlreq@frontmatter@pagestyle{}%
       \jlreq@tempatrue % restore
@@ -5637,11 +5653,10 @@
       \ifx\jlreq@tempa\@empty\else
         \tl_put_right:Nx \jlreq@frontmatter@pagestyle { \exp_not:N \pagestyle{\exp_not:o {\jlreq@tempa}} }%
       \fi
-    }
-  }
-  \keys_define:nn { jlreqsetup } {frontmatter_precode .code:n = {\edef\jlreq@frontmatter@precode{\unexpanded{#1}}}}
-  \keys_define:nn { jlreqsetup } {frontmatter_postcode .code:n = {\edef\jlreq@frontmatter@postcode{\unexpanded{#1}}}}
-  \keys_define:nn { jlreqsetup } {frontmatter_pagination .code:n = {%
+    },
+    frontmatter_precode .code:n = {\edef\jlreq@frontmatter@precode{\unexpanded{#1}}},
+    frontmatter_postcode .code:n = {\edef\jlreq@frontmatter@postcode{\unexpanded{#1}}},
+    frontmatter_pagination .code:n = {%
       \def\jlreq@pagination@frontmatterstyle{arabic}%
       \let\jlreq@pagination@mainmatterpagecommand=\pagenumbering
       \clist_map_variable:nNn {#1} \jlreq@tempa {
@@ -5669,17 +5684,19 @@
   \seq_new:N \g__jlreq_frontmatter_resetcounter_seq
   \def\jlreq@frontmatter@restoreheadings{}
   \def\jlreq@frontmatter@restorecommands{}
-  \keys_define:nn { jlreqsetup } {mainmatter_pagebreak .code:n = {%
-    \edef\jlreq@mainmatter@pagebreak{\jlreq@ifempty{#1}{}{\exp_not:c {#1}}}%
-  }}
-  \keys_define:nn { jlreqsetup } {mainmatter_pagestyle .code:n = {%
-    \edef\jlreq@mainmatter@pagestyle{\jlreq@ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
-  }}
-  \keys_define:nn { jlreqsetup } {mainmatter_counter .code:n = {\jlreq@matter@counter@norestore{\jlreq@mainmatter@counter}{#1}}}
-  \keys_define:nn { jlreqsetup } {mainmatter_heading .code:n = {\jlreq@matter@heading{\jlreq@mainmatter@heading}{#1}}}
-  \keys_define:nn { jlreqsetup } {mainmatter_precode .code:n = {\edef\jlreq@mainmatter@precode{\unexpanded{#1}}}}
-  \keys_define:nn { jlreqsetup } {mainmatter_postcode .code:n = {\edef\jlreq@mainmatter@postcode{\unexpanded{#1}}}}
-  \keys_define:nn { jlreqsetup } {mainmatter_pagination .tl_set:N = \jlreq@pagination@mainmatterstyle}
+  \keys_define:nn { jlreqsetup } {
+    mainmatter_pagebreak .code:n = {%
+      \edef\jlreq@mainmatter@pagebreak{\jlreq@ifempty{#1}{}{\exp_not:c {#1}}}%
+    },
+    mainmatter_pagestyle .code:n = {%
+      \edef\jlreq@mainmatter@pagestyle{\jlreq@ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
+    },
+    mainmatter_counter .code:n = {\jlreq@matter@counter@norestore{\jlreq@mainmatter@counter}{#1}},
+    mainmatter_heading .code:n = {\jlreq@matter@heading{\jlreq@mainmatter@heading}{#1}},
+    mainmatter_precode .code:n = {\edef\jlreq@mainmatter@precode{\unexpanded{#1}}},
+    mainmatter_postcode .code:n = {\edef\jlreq@mainmatter@postcode{\unexpanded{#1}}},
+    mainmatter_pagination .tl_set:N = \jlreq@pagination@mainmatterstyle
+  }
   \NewDocumentCommand{\mainmatter}{}{%
     \jlreq@mainmatter@precode
     \jlreq@mainmatter@pagebreak
@@ -5702,17 +5719,18 @@
     \expandafter\jlreq@pagination@mainmatterpagecommand\expandafter{\jlreq@pagination@mainmatterstyle}%
     \jlreq@mainmatter@postcode
   }
-  \keys_define:nn { jlreqsetup } {backmatter_pagebreak .code:n = {%
-    \edef\jlreq@backmatter@pagebreak{\jlreq@ifempty{#1}{}{\exp_not:c {#1}}}%
-  }}
-  \keys_define:nn { jlreqsetup } {backmatter_pagestyle .code:n = {%
-    \edef\jlreq@backmatter@pagestyle{\jlreq@ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
-  }}
-  \keys_define:nn { jlreqsetup } {backmatter_counter .code:n = {\jlreq@matter@counter@norestore{\jlreq@backmatter@counter}{#1}}}
-  \keys_define:nn { jlreqsetup } {backmatter_heading .code:n = {\jlreq@matter@heading{\jlreq@backmatter@heading}{#1}}}
-  \keys_define:nn { jlreqsetup } {backmatter_precode .code:n = {\edef\jlreq@backmatter@precode{\unexpanded{#1}}}}
-  \keys_define:nn { jlreqsetup } {backmatter_postcode .code:n = {\edef\jlreq@backmatter@postcode{\unexpanded{#1}}}}
-  \keys_define:nn { jlreqsetup } {backmatter_pagination .code:n = {
+  \keys_define:nn { jlreqsetup } {
+    backmatter_pagebreak .code:n = {%
+      \edef\jlreq@backmatter@pagebreak{\jlreq@ifempty{#1}{}{\exp_not:c {#1}}}%
+    },
+    backmatter_pagestyle .code:n = {%
+      \edef\jlreq@backmatter@pagestyle{\jlreq@ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
+    },
+    backmatter_counter .code:n = {\jlreq@matter@counter@norestore{\jlreq@backmatter@counter}{#1}},
+    backmatter_heading .code:n = {\jlreq@matter@heading{\jlreq@backmatter@heading}{#1}},
+    backmatter_precode .code:n = {\edef\jlreq@backmatter@precode{\unexpanded{#1}}},
+    backmatter_postcode .code:n = {\edef\jlreq@backmatter@postcode{\unexpanded{#1}}},
+    backmatter_pagination .code:n = {
       \let\jlreq@pagination@backmatterpagecommand=\pagenumbering
       \def\jlreq@pagination@backmatterstyle{arabic}%
       \clist_map_variable:nNn {#1} \jlreq@tempa {
@@ -5738,10 +5756,12 @@
   }
 }
 
-\keys_define:nn { jlreqsetup } {appendix_counter .code:n = {\jlreq@matter@counter@norestore{\jlreq@appendix@counter}{#1}}}
-\keys_define:nn { jlreqsetup } {appendix_heading .code:n = {\jlreq@matter@heading{\jlreq@appendix@heading}{#1}}}
-\keys_define:nn { jlreqsetup } {appendix_precode .code:n = {\edef\jlreq@appendix@precode{\unexpanded{#1}}}}
-\keys_define:nn { jlreqsetup } {appendix_postcode .code:n = {\edef\jlreq@appendix@postcode{\unexpanded{#1}}}}
+\keys_define:nn { jlreqsetup } {
+  appendix_counter .code:n = {\jlreq@matter@counter@norestore{\jlreq@appendix@counter}{#1}},
+  appendix_heading .code:n = {\jlreq@matter@heading{\jlreq@appendix@heading}{#1}},
+  appendix_precode .code:n = {\edef\jlreq@appendix@precode{\unexpanded{#1}}},
+  appendix_postcode .code:n = {\edef\jlreq@appendix@postcode{\unexpanded{#1}}}
+}
 \NewDocumentCommand{\appendix}{}{%
   \par
   \jlreq@appendix@precode
@@ -5974,29 +5994,27 @@
 \def\jlreq@setupamsthm{
   \newtheoremstyle{jlreq}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\jlreq@theorem@font}{\dimexpr\jlreq@theorem@indent\relax}{\jlreq@theorem@label@font}{}{1\jlreq@zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{（##3）}}
 }
-\keys_define:nn { jlreqsetup } {theorem_beforeafter_space .code:n = {
+\keys_define:nn { jlreqsetup } {
+  theorem_beforeafter_space .code:n = {
     \def\jlreq@theorem@beforeafter@space{#1}
     \begingroup\jlreq@tempdima=\dimexpr\jlreq@theorem@beforeafter@space\relax\endgroup
     \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
-  }
-}
-\keys_define:nn { jlreqsetup } {theorem_indent .code:n = {
+  },
+  theorem_indent .code:n = {
     \def\jlreq@theorem@indent{#1}
     \begingroup\jlreq@tempdima=\dimexpr\jlreq@theorem@indent\relax\endgroup
     \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
-  }
-}
-\keys_define:nn { jlreqsetup } {theorem_font .code:n = {
+  },
+  theorem_font .code:n = {
     \def\jlreq@theorem@font{#1}
     \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
-  }
-}
-\keys_define:nn { jlreqsetup } {theorem_label_font .code:n = {
+  },
+  theorem_label_font .code:n = {
     \def\jlreq@theorem@label@font{#1}
     \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
-  }
+  },
+  proof_label_font .tl_set:N = \jlreq@proof@label@font
 }
-\keys_define:nn { jlreqsetup } {proof_label_font .tl_set:N = \jlreq@proof@label@font}
 
 %. デフォルト設定
 %.. 見出し
@@ -6069,7 +6087,7 @@
 }
 
 %.. ページスタイル
-\RenewPageStyle{empty}{nombre={},odd_running_head={},even_running_head={}}
+\RenewPageStyle{empty}{nombre={},odd_running_head={},even_running_head={},clear_markcommand=false}
 \str_if_eq:VnTF \jlreq@article@type { article } {
   \legacy_if:nTF { @twoside } {
     \NewPageStyle{headings}{odd_running_head={_subsection},even_running_head={_section}}
-- 
cgit v1.2.3

