From 07801f7ec3e3482aba8553fd75f9f190ac3f9f0a Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 13 Aug 2021 03:00:43 +0000
Subject: CTAN sync 202108130300

---
 language/japanese/jlreq/jlreq.cls | 1119 +++++++++++++++++++------------------
 1 file changed, 574 insertions(+), 545 deletions(-)

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

diff --git a/language/japanese/jlreq/jlreq.cls b/language/japanese/jlreq/jlreq.cls
index f1883d08b2..4cffe13825 100644
--- a/language/japanese/jlreq/jlreq.cls
+++ b/language/japanese/jlreq/jlreq.cls
@@ -5,8 +5,8 @@
 %%
 % (based on JLReq 20200811 https://www.w3.org/TR/2020/NOTE-jlreq-20200811/)
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2021/07/30 jlreq]
-\RequirePackage{l3keys2e,etoolbox}
+\ProvidesClass{jlreq}[2021/08/12 jlreq]
+\RequirePackage{l3keys2e}
 \RequirePackage{ifthen}
 \RequirePackage{jlreq-helpers}
 
@@ -18,26 +18,35 @@
 \str_new:N \l_jlreq_tmpc_str
 \bool_new:N \l_jlreq_tmpa_bool
 \clist_new:N \l_jlreq_tmpa_clist
+\seq_new:N \l_jlreq_tmpa_seq
 \dim_new:N \l_jlreq_tmpa_dim
 \skip_new:N \l_jlreq_tmpa_skip
 \box_new:N \l_jlreq_tmpa_box
 \box_new:N \l_jlreq_tmpb_box
 \box_new:N \l_jlreq_tmpc_box
 
-\def\jlreq@undeferr#1{\ClassError{jlreq}{Trying~to~delete~\string#1~even~though~it~is~not~defined,~may~be~a~bug}{\@ehc}}
+\cs_set:Nn \__jlreq_undeferr:n {\ClassError{jlreq}{Trying~to~delete~\string#1~even~though~it~is~not~defined,~may~be~a~bug}{\@ehc}}
 % クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする
-\def\jlreq@aftercls@addtodeletecs#1{%
-  \appto\jlreq@aftercls@deletecslist{\jlreq@helper@undefcs{#1}{\jlreq@undeferr}}%
+\seq_new:N \g__jlreq_aftercls_deletecs_seq
+\seq_new:N \g__jlreq_aftercls_deleteif_seq
+\cs_set:Nn \__jlreq_aftercls_addtodeletecs:N {
+  \seq_gput_right:Nn \g__jlreq_aftercls_deletecs_seq {#1}
 }
-\def\jlreq@aftercls@addtodeleteif#1{%
-  \appto\jlreq@aftercls@deletecslist{\jlreq@helper@undefif{#1}{\jlreq@undeferr}}%
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_aftercls_addtodeletecs:N
+\cs_set:Nn \__jlreq_aftercls_addtodeleteif:N {
+  \seq_gput_right:Nn \g__jlreq_aftercls_deleteif_seq {#1}
 }
-\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeletecs}
-\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeleteif}
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_aftercls_addtodeleteif:N
 \AtEndOfClass{%
-  \jlreq@aftercls@deletecslist
-  \jlreq@helper@undefcs{\jlreq@aftercls@deletecslist}{\jlreq@undeferr}%
-  \undef{\jlreq@undeferr}%
+  \seq_map_inline:Nn \g__jlreq_aftercls_deletecs_seq {
+    \jlreq@helper@undefcs{#1}{\__jlreq_undeferr:n}
+  }
+  \seq_map_inline:Nn \g__jlreq_aftercls_deleteif_seq {
+    \jlreq@helper@undefif{#1}{\__jlreq_undeferr:n}
+  }
+  \cs_undefine:N \g__jlreq_aftercls_deletecs_seq
+  \cs_undefine:N \g__jlreq_aftercls_deleteif_seq
+  \cs_undefine:N \__jlreq_undeferr:n
 }
 
 % preambleにいるかのスイッチ
@@ -53,7 +62,7 @@
     \ClassError{jlreq}{Trying~to~save~#1~twice,~may~be~a~bug}{\@ehc}%
   }
   \begingroup
-    \edef\jlreq@do{\noexpand\let\expandonce{\csname jlreq@original@#1\endcsname}=\expandonce{\csname #1\endcsname}}
+    \edef\jlreq@do{\noexpand\let\exp_not:c {jlreq@original@#1}=\exp_not:c {#1}}
   \expandafter\endgroup
   \jlreq@do
 }
@@ -83,121 +92,114 @@
 \keys_define:nn { jlreq } { book .code:n = { \def\jlreq@article@type{book} }, book .value_forbidden:n = true }
 
 %.. 基本版面．まずは紙サイズ．
-\def\jlreq@switchpapersize{}
-\jlreq@aftercls@addtodeletecs{\jlreq@switchpapersize}
-% \jlreq@addpapersize{paper=に指定するもの}{単独オプション名}{横}{縦}
-
-\def\jlreq@addpapersize#1#2{%
-  \@ifnextchar[{\jlreq@addpapersize@{#1}{#2}}{\jlreq@addpapersize@@{#1}{#2}}%
+\tl_new:N \g__jlreq_papersizelist_tl
+\cs_set:Nn \__jlreq_addpapersize:nnn {
+  \exp_args:Nnnv \__jlreq_addpapersize_aux:nnn {#1}{#2}{jlreq@helper@papersizelist@#3}
 }
-\def\jlreq@addpapersize@#1#2[#3]{%
-  \edef\@tempa{\unexpanded{\jlreq@addpapersize@@{#1}{#2}}\csexpandonce{jlreq@helper@papersizelist@#3}}%
-  \@tempa
+\cs_set:Nn \__jlreq_addpapersize_aux:nnn {
+  \__jlreq_addpapersize_auxi:nnnn {#1}{#2}#3
 }
-\def\jlreq@addpapersize@@#1#2#3#4{%
-  \clist_map_variable:nNn {#1} \@tempa {
-    \eappto\jlreq@switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}}}%
-  }%
-  \clist_map_inline:nn {#2}  {
-    \keys_define:nn { jlreq } {
-      ##1 .code:n = { \setlength{\paperwidth}{#3}\setlength{\paperheight}{#4} },
-      ##1 .value_forbidden:n = true
-    }
+\cs_set:Nn \__jlreq_addpapersize_auxi:nnnn {
+  \clist_map_inline:nn {#1} {
+    \tl_gput_right:Nn \g__jlreq_papersizelist_tl { { ##1 } { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} } }
+  }
+  \clist_map_inline:nn {#2} {
+    \keys_define:nn { jlreq } { ##1 .code:n = { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} } }
   }
 }
-\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize}
-\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize@}
-\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize@@}
 \keys_define:nn { jlreq } {
   paper .code:n = {
-    \edef\jlreq@do{%
-      \unexpanded{\jlreq@switch{#1}}{\expandonce{\jlreq@switchpapersize}}%
-      [\unexpanded{%
-        \jlreq@helper@dividebycomma{#1}%
-        \ifjlreq@result
-          \setlength{\paperwidth}{\dimexpr\jlreq@resulta\relax}%
-          \setlength{\paperheight}{\dimexpr\jlreq@resultb\relax}%
-        \else
-          \ClassError{jlreq}{The~paper~#1~is~unknown}{\@ehc}%
-        \fi
-      }]%
-    }%
-    \jlreq@do
+    \str_case:nVF {#1} \g__jlreq_papersizelist_tl
+    {
+      \jlreq@helper@dividebycomma{#1}%
+      \legacy_if:nTF { jlreq@result } {
+        \setlength{\paperwidth}{\dimexpr\jlreq@resulta\relax}
+        \setlength{\paperheight}{\dimexpr\jlreq@resultb\relax}
+      } {
+        \ClassError { jlreq } { The~paper~#1~is~unknown } {\@ehc}
+      }
+    }
   }
 }
+
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize:nnn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize_aux:nnn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_addpapersize_auxi:nnnn
+\__jlreq_aftercls_addtodeletecs:N \g__jlreq_papersizelist_tl
+
 % 紙サイズ一覧．b*はJIS B．
-\jlreq@addpapersize{a0,A0}{}[a0]
-\jlreq@addpapersize{a1,A1}{}[a1]
-\jlreq@addpapersize{a2,A2}{}[a2]
-\jlreq@addpapersize{a3,A3}{a3paper}[a3]
-\jlreq@addpapersize{a4,A4}{a4paper}[a4]
-\jlreq@addpapersize{a5,A5}{a5paper}[a5]
-\jlreq@addpapersize{a6,A6}{a6paper}[a6]
-\jlreq@addpapersize{a7,A7}{}[a7]
-\jlreq@addpapersize{a8,A8}{}[a8]
-\jlreq@addpapersize{a9,A9}{}[a9]
-\jlreq@addpapersize{a10,A10}{}[a10]
-
-\jlreq@addpapersize{b0,B0}{}[b0]
-\jlreq@addpapersize{b1,B1}{}[b1]
-\jlreq@addpapersize{b2,B2}{}[b2]
-\jlreq@addpapersize{b3,B3}{}[b3]
-\jlreq@addpapersize{b4,B4}{b4paper}[b4]
-\jlreq@addpapersize{b5,B5}{b5paper}[b5]
-\jlreq@addpapersize{b6,B6}{b6paper}[b6]
-\jlreq@addpapersize{b7,B7}{}[b7]
-\jlreq@addpapersize{b8,B8}{}[b8]
-\jlreq@addpapersize{b9,B9}{}[b9]
-\jlreq@addpapersize{b10,B10}{}[b10]
-
-\jlreq@addpapersize{c2,C2}{}[c2]
-\jlreq@addpapersize{c3,C3}{}[c3]
-\jlreq@addpapersize{c4,C4}{}[c4]
-\jlreq@addpapersize{c5,C5}{}[c5]
-\jlreq@addpapersize{c6,C6}{}[c6]
-\jlreq@addpapersize{c7,C7}{}[c7]
-\jlreq@addpapersize{c8,C8}{}[c8]
-
-\jlreq@addpapersize{a4var}{}[a4var]
-\jlreq@addpapersize{b5var}{}[b5var]
-
-\jlreq@addpapersize{letter}{letterpaper}[letter]
-\jlreq@addpapersize{legal}{legalpaper}[legal]
-\jlreq@addpapersize{executive}{executivepaper}[executive]
-\jlreq@addpapersize{hagaki}{}[hagaki]
+\__jlreq_addpapersize:nnn{a0,A0}{}{a0}
+\__jlreq_addpapersize:nnn{a1,A1}{}{a1}
+\__jlreq_addpapersize:nnn{a2,A2}{}{a2}
+\__jlreq_addpapersize:nnn{a3,A3}{a3paper}{a3}
+\__jlreq_addpapersize:nnn{a4,A4}{a4paper}{a4}
+\__jlreq_addpapersize:nnn{a5,A5}{a5paper}{a5}
+\__jlreq_addpapersize:nnn{a6,A6}{a6paper}{a6}
+\__jlreq_addpapersize:nnn{a7,A7}{}{a7}
+\__jlreq_addpapersize:nnn{a8,A8}{}{a8}
+\__jlreq_addpapersize:nnn{a9,A9}{}{a9}
+\__jlreq_addpapersize:nnn{a10,A10}{}{a10}
+
+\__jlreq_addpapersize:nnn{b0,B0}{}{b0}
+\__jlreq_addpapersize:nnn{b1,B1}{}{b1}
+\__jlreq_addpapersize:nnn{b2,B2}{}{b2}
+\__jlreq_addpapersize:nnn{b3,B3}{}{b3}
+\__jlreq_addpapersize:nnn{b4,B4}{b4paper}{b4}
+\__jlreq_addpapersize:nnn{b5,B5}{b5paper}{b5}
+\__jlreq_addpapersize:nnn{b6,B6}{b6paper}{b6}
+\__jlreq_addpapersize:nnn{b7,B7}{}{b7}
+\__jlreq_addpapersize:nnn{b8,B8}{}{b8}
+\__jlreq_addpapersize:nnn{b9,B9}{}{b9}
+\__jlreq_addpapersize:nnn{b10,B10}{}{b10}
+
+\__jlreq_addpapersize:nnn{c2,C2}{}{c2}
+\__jlreq_addpapersize:nnn{c3,C3}{}{c3}
+\__jlreq_addpapersize:nnn{c4,C4}{}{c4}
+\__jlreq_addpapersize:nnn{c5,C5}{}{c5}
+\__jlreq_addpapersize:nnn{c6,C6}{}{c6}
+\__jlreq_addpapersize:nnn{c7,C7}{}{c7}
+\__jlreq_addpapersize:nnn{c8,C8}{}{c8}
+
+\__jlreq_addpapersize:nnn{a4var}{}{a4var}
+\__jlreq_addpapersize:nnn{b5var}{}{b5var}
+
+\__jlreq_addpapersize:nnn{letter}{letterpaper}{letter}
+\__jlreq_addpapersize:nnn{legal}{legalpaper}{legal}
+\__jlreq_addpapersize:nnn{executive}{executivepaper}{executive}
+\__jlreq_addpapersize:nnn{hagaki}{}{hagaki}
 
 
 %.. フォントサイズ，行長，1ページあたりの行数で基本版面のサイズを決める（2.4.1.a）
-\jlreq@aftercls@addtodeletecs{\jlreq@option@fontsize}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@fontsize
 \keys_define:nn { jlreq } { fontsize .tl_set:N = \jlreq@option@fontsize }
 \keys_define:nn { jlreq } {
   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,
 }
-\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{\jlreq@option@jafontsize}
-\jlreq@aftercls@addtodeletecs{\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
 %.. 行の長さ
-\keys_define:nn { jlreq } { line_length .tl_set:N = \jlreq@option@line@length}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@line@length}
+\keys_define:nn { jlreq } { line_length .tl_set:N = \jlreq@option@line@length }
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@line@length
 %.. 1ページあたりの行数
-\keys_define:nn { jlreq } { number_of_lines .tl_set:N = \jlreq@option@number@of@lines}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@number@of@lines}
+\keys_define:nn { jlreq } { number_of_lines .tl_set:N = \jlreq@option@number@of@lines }
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@number@of@lines
 
 % 地の空き量，のどの空き量で配置位置を決める（2.4.1.b）省略されたら中央配置．
 %.. 天
-\keys_define:nn { jlreq } { head_space .tl_set:N = \jlreq@option@head@space}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@head@space}
+\keys_define:nn { jlreq } { head_space .tl_set:N = \jlreq@option@head@space }
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@head@space
 %.. 地
-\keys_define:nn { jlreq } { foot_space .tl_set:N = \jlreq@option@foot@space}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@foot@space}
+\keys_define:nn { jlreq } { foot_space .tl_set:N = \jlreq@option@foot@space }
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@foot@space
 %.. のど
-\keys_define:nn { jlreq } { gutter .tl_set:N = \jlreq@option@gutter}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@gutter}
+\keys_define:nn { jlreq } { gutter .tl_set:N = \jlreq@option@gutter }
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@gutter
 %.. 小口
-\jlreq@aftercls@addtodeletecs{\jlreq@option@fore@edge}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@fore@edge
 \keys_define:nn { jlreq } {
   fore_edge .tl_set:N = \jlreq@option@fore@edge,
   fore-edge .tl_set:N = \jlreq@option@fore@edge
@@ -206,20 +208,20 @@
 %.. 柱とノンブル
 % 本文とヘッダ/フッタの間の空き
 \keys_define:nn { jlreq } { headfoot_verticalposition .tl_set:N = \jlreq@option@headfoot@verticalpos}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@headfoot@verticalpos}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@headfoot@verticalpos
 % 柱やノンブルの左右の空き
 \keys_define:nn { jlreq } { headfoot_sidemargin .tl_set:N = \jlreq@headfoot@sidemargin}
 
 %.. 段間
 \keys_define:nn { jlreq } { column_gap .tl_set:N = \jlreq@option@column@gap}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@column@gap}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@column@gap
 
 %.. 行送り，指定無しの場合は文字サイズの1.7倍とする．（1.5から2倍が好ましい：2.4.2.d 注3）
 \keys_define:nn { jlreq } {
   baselineskip .tl_set:N = \jlreq@option@baselineskip,
   linegap .code:n = { \def\jlreq@option@baselineskip{1zw + #1} }
 }
-\jlreq@aftercls@addtodeletecs{\jlreq@option@baselineskip}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@baselineskip
 
 %.. 組み方系
 % 行頭に括弧が来たときの配置：3.1.5
@@ -231,16 +233,16 @@
 % jsarticleと同じkanjiskipを使う
 \newif\ifjlreq@narrow@kanjiskip\jlreq@narrow@kanjiskipfalse
 \keys_define:nn { jlreq } { narrow_kanjiskip .code:n = {\jlreq@narrow@kanjiskiptrue}, narrow_kanjiskip .value_forbidden:n = true}
-\jlreq@aftercls@addtodeleteif{\ifjlreq@narrow@kanjiskip}
+\__jlreq_aftercls_addtodeleteif:N \ifjlreq@narrow@kanjiskip
 
 %.. 注
 % 傍注のタイプ
 \keys_define:nn { jlreq } { sidenote_length .tl_set:N = \jlreq@option@sidenote@length }
-\jlreq@aftercls@addtodeletecs{\jlreq@option@sidenote@length}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@option@sidenote@length
 
 %.. 逆ノンブル
 \newif\ifjlreq@option@use@reverse@pagination
-\jlreq@aftercls@addtodeleteif{\ifjlreq@option@use@reverse@pagination}
+\__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@use@reverse@pagination
 \jlreq@option@use@reverse@paginationfalse
 \keys_define:nn { jlreq } { use_reverse_pagination .code:n = {\jlreq@option@use@reverse@paginationtrue}, use_reverse_pagination .value_forbidden:n = true }
 
@@ -250,7 +252,7 @@
 \newif\if@landscape\@landscapefalse
 \newif\if@tate \@tatefalse
 \newif\ifjlreq@option@titlepage \jlreq@option@titlepagefalse % titlepageかnotitlepageかが指定された
-\jlreq@aftercls@addtodeleteif{\ifjlreq@option@titlepage}
+\__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}} }
@@ -258,7 +260,7 @@
 \keys_define:nn { jlreq } { tate .code:n = { \@tatetrue }, tate .value_forbidden:n = true}
 
 \newif\ifjlreq@option@twoside\jlreq@option@twosidefalse % onesideかtwosideが指定された
-\jlreq@aftercls@addtodeleteif{\ifjlreq@option@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 }
@@ -269,19 +271,18 @@
 \keys_define:nn { jlreq } { 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{\ifjlreq@option@open}
+\__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}
 \newif\ifjlreq@option@enablejfam \jlreq@option@enablejfamtrue
-\jlreq@aftercls@addtodeleteif{\ifjlreq@option@enablejfam}
+\__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@enablejfam
 \keys_define:nn { jlreq } { disablejfam .code:n = { \jlreq@option@enablejfamfalse }, disablejfam .value_forbidden:n = true}
 
 \def\jlreq@note#1{}
 \keys_define:nn { jlreq } { jlreq_notes .code:n = { \def\jlreq@note##1{\message{^^JJLReq note: ##1^^J}}}, jlreq_notes .value_forbidden:n = true}
 
-%\ExecuteOptionsX{article_type=article,paper=a4,open_bracket_pos=zenkaku_tentsuki,onecolumn,final}
 \keys_set:nn { jlreq } {
   article_type=article,paper=a4,
   number_of_lines={},line_length = {},
@@ -317,7 +318,7 @@
 }
 % \jlreqsetupの最後に必ず実行される処理を入れる．
 \cs_set:Nn \__jlreq_jlreqsetup_addtofinally:n { \tl_gput_right:Nx \g__jlreq_jlreqsetup_finally_tl { \exp_not:n {#1} } }
-\jlreq@aftercls@addtodeletecs{\__jlreq_jlreqsetup_addtofinally:n}
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_jlreqsetup_addtofinally:n
 \@onlypreamble\jlreqsetup
 
 % エンジンの設定
@@ -352,7 +353,7 @@
 \else
   \RequirePackage{everyhook}
   \def\jlreq@jfmname@prefix{}
-  \jlreq@aftercls@addtodeletecs{\jlreq@jfmname@prefix}
+  \__jlreq_aftercls_addtodeletecs:N \jlreq@jfmname@prefix
   \ifjlreq@burasage\edef\jlreq@jfmname@prefix{b\jlreq@jfmname@prefix}\fi
   \str_if_eq:VnT \jlreq@open@bracket@pos { zenkakunibu_nibu } {
     \edef\jlreq@jfmname@prefix { \jlreq@jfmname@prefix z }
@@ -360,8 +361,8 @@
   \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}
+  \__jlreq_aftercls_addtodeletecs:N \jlreq@jfmname
+  \__jlreq_aftercls_addtodeletecs:N \jlreq@jfmnameg
 \fi
 
 % (u)pLaTeXの場合ここで初めて\epTeXinputencodingが発行されるので，
@@ -599,7 +600,7 @@
     \jlreq@getfirsttoken@expandmacros{\jlreq@nextchar}{\jlreq@tempa}%
     \expandafter\jlreq@ifletter\expandafter{\jlreq@tempa}{%
       \jlreq@calc@jfmglue{\char\jlreq@lastnodechar}{\jlreq@tempa}%
-%      \message{fixjfm Insert: \the\jlreq@resultskip}%
+%      \message{fixjfm,~before~lastnodechar~=~\the\jlreq@lastnodechar,~after~=~\meaning\jlreq@nextchar,~Insert:~\the\jlreq@resultskip}
       \edef\jlreq@do{%
         \noexpand\hskip\the\jlreq@resultskip\space
         \noexpand\inhibitglue
@@ -655,7 +656,7 @@
 \else
   \def\jlreq@expand@optionfontsize#1{\dimexpr#1\relax}
 \fi
-\jlreq@aftercls@addtodeletecs{\jlreq@expand@optionfontsize}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@expand@optionfontsize
 \ifx\jlreq@option@fontsize\@empty
   \ifx\jlreq@option@jafontsize\@empty
     \jlreq@fontsize=10pt
@@ -696,7 +697,7 @@
 \fi
 \jlreq@divide{\jlreq@jafontsize}{\jlreq@fontsize}
 \edef\jlreq@jafontscale{\strip@pt\jlreq@resultdimen}
-\jlreq@aftercls@addtodeletecs{\jlreq@jafontscale}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@jafontscale
 \ifx l\jlreq@engine
   \jlreq@saveoriginalcs{DeclareFontShape}
     \def\DeclareFontShape#1#2#3#4#5#6{
@@ -737,9 +738,8 @@
   \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
-\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
+
+\exp_args:Nx \clist_map_inline:nn {\jlreq@yokokanjiencoding,\jlreq@tatekanjiencoding} {% #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} } {
@@ -792,7 +792,7 @@
 \ifx l\jlreq@engine
   % \itemの直後は折り返し行頭と同じにする．
   \cs_set:Nn \__jlreq_hook_everypar: {}
-  \def\item{%
+  \renewcommand*{\item}{%
     \cs_set:Nn \__jlreq_hook_everypar: { \cs_set:Nn \__jlreq_hook_everypar: {} \inhibitglue }
     \expandafter\everypar\expandafter{\the\everypar\__jlreq_hook_everypar:}
     \jlreq@useoriginalcs{item}%
@@ -804,20 +804,20 @@
   % 行頭括弧に対して\inhibitglueを入れたりする命令を作る
   % \jlreq@charlist@openingbracketsの各括弧に対して，\ifx\jlreq@nextchar 「1\fiみたいなのが並んだのを作る
   \def\jlreq@tempa{}
-  \def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifx\jlreq@nextchar#11\fi}\jlreq@do}}
+  \def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\tl_put_right:Nn \jlreq@tempa{\ifx\jlreq@nextchar#11\fi}\jlreq@do}}
   \expandafter\jlreq@do\jlreq@charlist@openingbrackets\jlreq@endmark
   % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる．
   \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}
+    \edef\jlreq@openbracket@hook@ii{\noexpand\ifnum0\exp_not:o {\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}
+    \edef\jlreq@openbracket@hook@ii{\noexpand\ifnum0\exp_not:o {\jlreq@tempa}>0~\unexpanded{\inhibitglue}\noexpand\fi}
   }
   % source special対策
   \def\jlreq@openbracket@hook@i{\ifx\jlreq@nextchar\special\expandafter\jlreq@openbracket@hook@iii\else\expandafter\jlreq@openbracket@hook@ii\fi}
   \def\jlreq@openbracket@hook@iii#1#2{#1{#2}\futurelet\jlreq@nextchar\jlreq@openbracket@hook@i}
   \def\jlreq@openbracket@hook{\futurelet\jlreq@nextchar\jlreq@openbracket@hook@i}
   \let\jlreq@hook@everypar=\jlreq@openbracket@hook
-  \def\item{%
+  \renewcommand*{\item}{%
     \def\jlreq@hook@everypar{%
       \let\jlreq@hook@everypar=\jlreq@openbracket@hook
       \inhibitglue
@@ -828,19 +828,19 @@
 
 %.. 禁則処理
 \ifx l\jlreq@engine
-  \def\jlreq@setpostbreakpenalty@#1#2{\ltjsetparameter{postbreakpenalty={`#1,#2}}}
-  \def\jlreq@setprebreakpenalty@#1#2{\ltjsetparameter{prebreakpenalty={`#1,#2}}}
-  \def\jlreq@addjaxspmode@#1#2{%
+  \cs_set:Nn \__jlreq_setpostbreakpenalty_aux:nn {\ltjsetparameter{postbreakpenalty={`#1,#2}}}
+  \cs_set:Nn \__jlreq_setprebreakpenalty_aux:nn {\ltjsetparameter{prebreakpenalty={`#1,#2}}}
+  \cs_set:Nn \__jlreq_addjaxspmode_aux:nn {%
     \jlreq@tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
-    \jlreq@switch{#2}{
-      {pre}{%
+    \str_case:nn {#2} {
+      { pre } {%
         \ifnum\jlreq@tempcnta=2
           \ltjsetparameter{jaxspmode={`#1,allow}}%
         \else\ifnum\jlreq@tempcnta=0
           \ltjsetparameter{jaxspmode={`#1,preonly}}%
         \fi\fi
       }
-      {post}{%
+      { post } {%
         \ifnum\jlreq@tempcnta=1
           \ltjsetparameter{jaxspmode={`#1,allow}}%
         \else\ifnum\jlreq@tempcnta=0
@@ -849,17 +849,17 @@
       }
     }%
   }
-  \def\jlreq@deljaxspmode@#1#2{%
+  \cs_set:Nn \__jlreq_deljaxspmode_aux:nn {
     \jlreq@tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
-    \jlreq@switch{#2}{
-      {pre}{%
+    \str_case:nn {#2} {
+      { pre } {%
         \ifnum\jlreq@tempcnta=2
           \ltjsetparameter{jaxspmode={`#1,postonly}}%
         \else\ifnum\jlreq@tempcnta=1
           \ltjsetparameter{jaxspmode={`#1,inhibit}}%
         \fi\fi
       }
-      {post}{%
+      { post } {%
         \ifnum\jlreq@tempcnta=3
           \ltjsetparameter{jaxspmode={`#1,preonly}}%
         \else\ifnum\jlreq@tempcnta=2
@@ -869,19 +869,19 @@
     }%
   }
 \else
-  \def\jlreq@setpostbreakpenalty@#1#2{\postbreakpenalty`#1=#2}
-  \def\jlreq@setprebreakpenalty@#1#2{\prebreakpenalty`#1=#2}
-  \def\jlreq@addjaxspmode@#1#2{%
+  \cs_set:Nn \__jlreq_setpostbreakpenalty_aux:nn {\postbreakpenalty`#1=#2}
+  \cs_set:Nn \__jlreq_setprebreakpenalty_aux:nn {\prebreakpenalty`#1=#2}
+  \cs_set:Nn \__jlreq_addjaxspmode_aux:nn {
     \jlreq@tempcnta=\inhibitxspcode`#1
-    \jlreq@switch{#2}{
-      {pre}{%
+    \str_case:nn {#2} {
+      { pre }{%
         \ifnum\jlreq@tempcnta=1
           \inhibitxspcode`#1=3
         \else\ifnum\jlreq@tempcnta=0
           \inhibitxspcode`#1=2
         \fi\fi
       }
-      {post}{%
+      { post }{%
         \ifnum\jlreq@tempcnta=2
           \inhibitxspcode`#1=3
         \else\ifnum\jlreq@tempcnta=0
@@ -890,17 +890,17 @@
       }
     }%
   }
-  \def\jlreq@deljaxspmode@#1#2{%
+  \cs_set:Nn \__jlreq_deljaxspmode_aux:nn {
     \jlreq@tempcnta=\inhibitxspcode`#1
-    \jlreq@switch{#2}{
-      {pre}{%
+    \str_case;nn {#2} {
+      { pre } {%
         \ifnum\jlreq@tempcnta=3
           \inhibitxspcode`#1=1
         \else\ifnum\jlreq@tempcnta=2
           \inhibitxspcode`#1=0
         \fi\fi
       }
-      {post}{%
+      { post } {%
         \ifnum\jlreq@tempcnta=3
           \inhibitxspcode`#1=2
         \else\ifnum\jlreq@tempcnta=1
@@ -911,33 +911,33 @@
   }
 \fi
 % #1{...}{#3}を...が#2のリストに対して適用．
-\cs_set:Nn \__jlreq_iterateapply:nnn {
+\cs_set:Nn \__jlreq_iterateapply:Nnn {
   \tl_map_inline:nn {#2} {
     #1{##1}{#3}
   }
 }
-\cs_set:Nn \__jlreq_setpostbreakpenalty:nn { \__jlreq_iterateapply:nnn {\jlreq@setpostbreakpenalty@} {#1} {#2}}
+\cs_set:Nn \__jlreq_setpostbreakpenalty:nn { \__jlreq_iterateapply:Nnn \__jlreq_setpostbreakpenalty_aux:nn {#1} {#2}}
 \cs_generate_variant:Nn \__jlreq_setpostbreakpenalty:nn { Vn }
-\cs_set:Nn \__jlreq_setprebreakpenalty:nn { \__jlreq_iterateapply:nnn {\jlreq@setprebreakpenalty@} {#1} {#2} }
+\cs_set:Nn \__jlreq_setprebreakpenalty:nn { \__jlreq_iterateapply:Nnn \__jlreq_setprebreakpenalty_aux:nn {#1} {#2} }
 \cs_generate_variant:Nn \__jlreq_setprebreakpenalty:nn { Vn }
-\cs_set:Nn \__jlreq_addjaxspmode:nn {\__jlreq_iterateapply:nnn {\jlreq@addjaxspmode@} {#1} {#2} }
+\cs_set:Nn \__jlreq_addjaxspmode:nn {\__jlreq_iterateapply:Nnn \__jlreq_addjaxspmode_aux:nn {#1} {#2} }
 \cs_generate_variant:Nn \__jlreq_addjaxspmode:nn { Vn }
-\cs_set:Nn \__jlreq_deljaxspmode:nn { \__jlreq_iterateapply:nnn{\jlreq@deljaxspmode@} {#1} {#2} }
+\cs_set:Nn \__jlreq_deljaxspmode:nn { \__jlreq_iterateapply:Nnn \__jlreq_deljaxspmode_aux:nn {#1} {#2} }
 \cs_generate_variant:Nn \__jlreq_deljaxspmode:nn { Vn }
 
-\jlreq@aftercls@addtodeletecs{\__jlreq_iterateapply:nnn}
-\jlreq@aftercls@addtodeletecs{\__jlreq_setpostbreakpenalty:nn}
-\jlreq@aftercls@addtodeletecs{\__jlreq_setpostbreakpenalty:Vn}
-\jlreq@aftercls@addtodeletecs{\jlreq@setpostbreakpenalty@}
-\jlreq@aftercls@addtodeletecs{\__jlreq_setprebreakpenalty:nn}
-\jlreq@aftercls@addtodeletecs{\__jlreq_setprebreakpenalty:Vn}
-\jlreq@aftercls@addtodeletecs{\jlreq@setprebreakpenalty@}
-\jlreq@aftercls@addtodeletecs{\__jlreq_addjaxspmode:nn}
-\jlreq@aftercls@addtodeletecs{\__jlreq_addjaxspmode:Vn}
-\jlreq@aftercls@addtodeletecs{\jlreq@addjaxspmode@}
-\jlreq@aftercls@addtodeletecs{\__jlreq_deljaxspmode:nn}
-\jlreq@aftercls@addtodeletecs{\__jlreq_deljaxspmode:Vn}
-\jlreq@aftercls@addtodeletecs{\jlreq@deljaxspmode@}
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_iterateapply:Nnn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_setpostbreakpenalty:nn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_setpostbreakpenalty:Vn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_setpostbreakpenalty_aux:nn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_setprebreakpenalty:nn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_setprebreakpenalty:Vn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_setprebreakpenalty_aux:nn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_addjaxspmode:nn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_addjaxspmode:Vn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_addjaxspmode_aux:nn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_deljaxspmode:nn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_deljaxspmode:Vn
+\__jlreq_aftercls_addtodeletecs:N \__jlreq_deljaxspmode_aux:nn
 
 % 行末禁則
 \__jlreq_setpostbreakpenalty:Vn \jlreq@charlist@openingbrackets {10000}
@@ -977,7 +977,7 @@
   \cs_set:Nn \__jlreq_setkcatcode:nn {
     \clist_map_inline:nn {#1} { \kcatcode"##1=#2\relax }
   }
-  \jlreq@aftercls@addtodeletecs{\__jlreq_setkcatcode:nn}
+  \__jlreq_aftercls_addtodeletecs:N \__jlreq_setkcatcode:nn
   % LuaTeX-jaのデフォルトのままに近い設定をする
   % 範囲1＆8
   \__jlreq_setkcatcode:nn {80} {15} % Latin-1 Supplement，どうしよう……
@@ -1063,13 +1063,13 @@
 \DeclareRobustCommand*\　{\futurelet\jlreq@nextchar\jlreq@zenkakuspace@ignorespaces}
 % 後続の空白を無視する処理
 \edef\jlreq@zenkakuspace@ignorespaces{%
-  \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@zenkakuspace@ignorespaces@\else\expandafter\jlreq@zenkakuspace@main\fi}%
+  \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{\　}
 \def\jlreq@tempa{}
-\def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifnum\lastnodechar=`#1~1\fi}\jlreq@do}}
+\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\expandonce{\jlreq@tempa}>0~}
+\edef\@tempa{\noexpand\ifnum0\exp_not:o {\jlreq@tempa}>0~}
 \expandafter\DeclareRobustCommand\expandafter*\expandafter\jlreq@zenkakuspace@main\expandafter{\@tempa
     \hskip 1\jlreq@zw\hbox{}%
     \jlreq@lastnodechar=`　
@@ -1096,10 +1096,10 @@
 % 区切り約物．\？ みたいな命令を作る．直後の空きが自動で入る．
 % \？*とすると文中の？として扱われる．
 \def\jlreq@tempa{}
-\def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifx\jlreq@nextchar #11\fi}\jlreq@do}}
+\def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\tl_put_right:Nn \jlreq@tempa{\ifx\jlreq@nextchar #11\fi}\jlreq@do}}
 \expandafter\jlreq@do\jlreq@charlist@closingbrackets\jlreq@endmark
 \edef\jlreq@dividingpunctuationmarkscommand{%
-  \noexpand\ifnum 0\expandonce{\jlreq@tempa}>0~\unexpanded{\expandafter\ignorespaces\else\expandafter\　\fi}%
+  \noexpand\ifnum 0\exp_not:o {\jlreq@tempa}>0~\unexpanded{\expandafter\ignorespaces\else\expandafter\　\fi}%
 }
 \def\jlreq@do#1{%
   \jlreq@ifendmark{#1}{}{
@@ -1140,14 +1140,15 @@
 
 \emergencystretch 3\jlreq@gol
 \setlength{\parindent}{1\zw}
-\def\jlreq@setfontsizehook{}
-\jlreq@saveoriginalcs{set@fontsize}
-\apptocmd{\set@fontsize}{\expandafter\def\expandafter\size@update\expandafter{\size@update\jlreq@setfontsizehook}}{}{}
-\appto\jlreq@setfontsizehook{ \dim_compare:nT { \parindent>0pt } { \setlength{\parindent}{1\jlreq@zw} } }
+\hook_gput_code:nnn { cmd/set@fontsize/after } {.} {
+  \expandafter\def\expandafter\size@update\expandafter{\size@update\g__jlreq_setfontsizehook}
+}
+\tl_new:N \g__jlreq_setfontsizehook
+\tl_set:Nn \g__jlreq_setfontsizehook { \dim_compare:nT { \parindent>0pt } { \setlength{\parindent}{1\jlreq@zw} } }
 \ifx l\jlreq@engine
   \@tempskipa=\ltjgetparameter{kanjiskip}
   \ifdim\@tempskipa=\maxdimen\else
-    \appto\jlreq@setfontsizehook{%
+    \tl_put_right:Nn \g__jlreq_setfontsizehook {%
       \ltj@setpar@global
       \ltjsetkanjiskip\jlreqkanjiskip
       \@tempskipa=\ltjgetparameter{xkanjiskip}%
@@ -1157,7 +1158,7 @@
     }
   \fi
 \else
-  \appto\jlreq@setfontsizehook{%
+  \tl_put_right:Nn \g__jlreq_setfontsizehook {%
     \kanjiskip=\jlreqkanjiskip
     \ifdim\xkanjiskip>0pt
       \xkanjiskip=\jlreqxkanjiskip
@@ -1357,8 +1358,8 @@
     \jlreq@determine@kihonhanmen@warning@firstfalse
   \fi
 }
-\jlreq@aftercls@addtodeletecs{\jlreq@determine@kihonhanmen@warning}
-\jlreq@aftercls@addtodeleteif{\ifjlreq@determine@kihonhanmen@warning@first}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@determine@kihonhanmen@warning
+\__jlreq_aftercls_addtodeleteif:N \ifjlreq@determine@kihonhanmen@warning@first
 \@tempdima=1\zw
 \ifx\jlreq@option@line@length\@empty
   \if@tate
@@ -1412,7 +1413,7 @@
   \divide\textheight\baselineskip \multiply\textheight\baselineskip
   \addtolength{\textheight}{\topskip}
 }
-\jlreq@aftercls@addtodeletecs{\jlreq@adjusttextheight}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@adjusttextheight
 \ifx\jlreq@option@number@of@lines\@empty
   \if@tate
     \ifnum 0\ifx\jlreq@option@gutter\@empty 1\fi\ifx\jlreq@option@fore@edge\@empty 1\fi>0
@@ -1457,8 +1458,8 @@
     \jlreq@note{基本版面の配置はのどの空き量を指定する (2.4.1.b)．}
   \fi
 }
-\jlreq@aftercls@addtodeletecs{\jlreq@setsidemargin@by@gutter}
-\jlreq@aftercls@addtodeletecs{\jlreq@setsidemargin@by@fore@edge}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@setsidemargin@by@gutter
+\__jlreq_aftercls_addtodeletecs:N \jlreq@setsidemargin@by@fore@edge
 
 \ifx\jlreq@option@gutter\@empty
   \ifx\jlreq@option@fore@edge\@empty
@@ -1511,7 +1512,7 @@
     \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - \topskip + \Cht\relax}
   \fi
 }
-\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyhead}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@settopmarginbyhead
 % 地の値から
 \def\jlreq@settopmarginbyfoot#1{
   \if@tate
@@ -1521,7 +1522,7 @@
     \setlength{\topmargin}{\dimexpr\paperheight - \textheight + \topskip - 1\zh - \headsep - \headheight - #1\relax}
   \fi
 }
-\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyfoot}
+\__jlreq_aftercls_addtodeletecs:N \jlreq@settopmarginbyfoot
 \ifx\jlreq@option@head@space\@empty
   \ifx\jlreq@option@foot@space\@empty
     \if@tate
@@ -1624,7 +1625,7 @@
       \jlreq@tempdimb=\dimexpr\the\numexpr\jlreq@tempdima/\dimexpr 1\jlreq@zw\relax + 2\relax\jlreq@zw\relax
       \edef\jlreq@do{%
         \unexpanded{\def\jlreq@result}{%
-          \noexpand\def\expandonce{\csname l@#1\endcsname}{%
+          \noexpand\def\exp_not:c {l@#1}{%
             \unexpanded{\@dottedtocline{#2}{0pt}}{\the\jlreq@tempdimb}%
           }%
         }%
@@ -1669,7 +1670,7 @@
   \begingroup
     \let\jlreq@contents@label@format=\@undefined
     \let\jlreq@format=\@undefined
-    \edef\jlreq@label@format{\expandonce{\csname the#1\endcsname}}%
+    \edef\jlreq@label@format{\exp_not:c {the#1}}%
     \newif\ifjlreq@number
     \keys_define:nn { DeclareTobiraHeading:#1 } {
       label_format .tl_set:N = \jlreq@label@format,
@@ -1686,12 +1687,12 @@
     \ifx\jlreq@format\@undefined
       \def\jlreq@format##1##2{##1##2}%
     \fi
-    \edef\jlreq@formatwlabel{\noexpand\jlreq@format{\expandonce{\jlreq@label@format}}}%
+    \edef\jlreq@formatwlabel{\noexpand\jlreq@format{\exp_not:o {\jlreq@label@format}}}%
     \jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
-    \eappto\jlreq@do{\expandonce{\jlreq@result}}%
+    \tl_put_right:Nx \jlreq@do {\exp_not:o {\jlreq@result}}%
     \edef\jlreq@do{%
-      \expandonce{\jlreq@do}%
-      \noexpand\def\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}[####1]####2{%
+      \exp_not:o {\jlreq@do}%
+      \noexpand\def\exp_not:c {jlreq@TobiraHeading@start@#1}[####1]####2{%
         \ifjlreq@number
           \unexpanded{\ifnum#2>\c@secnumdepth\else}%
             \unexpanded{\refstepcounter{#1}}%
@@ -1704,41 +1705,41 @@
         \ifjlreq@number
           \unexpanded{\jlreq@if{\ifnum#2>\c@secnumdepth\relax\fi}}{%
             \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
-            \expandonce{\jlreq@format{}{##1}}%
+            \exp_not:o {\jlreq@format{}{##1}}%
           }{%
             \unexpanded{\long\gdef\jlreqHeadingLabel####1{####1}}%
-            \expandafter\expandonce\expandafter{\jlreq@formatwlabel{##2}}%
+            \expandafter\exp_not:o \expandafter{\jlreq@formatwlabel{##2}}%
           }%
         \else
           \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
-          \expandonce{\jlreq@format{}{##1}}%
+          \exp_not:o {\jlreq@format{}{##1}}%
         \fi
-        \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{\ifjlreq@number\else -\fi}{\expandonce{\jlreq@label@format}}{####1}%
+        \exp_not:c {jlreq@heading@maketoc@#1}{\ifjlreq@number\else -\fi}{\exp_not:o {\jlreq@label@format}}{####1}%
         \noexpand\@afterheading
-        \expandonce{\jlreq@heading@clearpage}%
+        \exp_not:o {\jlreq@heading@clearpage}%
         \unexpanded{\if@restonecol\twocolumn\fi}%
       }%
-      \noexpand\def\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}####1{%
+      \noexpand\def\exp_not:c {jlreq@TobiraHeading@start@s@#1}####1{%
         \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
         \unexpanded{\jlreq@ifempty{##1}%
           {\long\gdef\jlreqHeadingText####1{}}%
           {\long\gdef\jlreqHeadingText####1{####1}}%
         }%
-        \expandonce{\jlreq@format{}{##1}}
-        \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{*}{\expandonce{\jlreq@label@format}}{####1}%
+        \exp_not:o {\jlreq@format{}{##1}}
+        \exp_not:c {jlreq@heading@maketoc@#1}{*}{\exp_not:o {\jlreq@label@format}}{####1}%
         \noexpand\@afterheading
-        \expandonce{\jlreq@heading@clearpage}%
+        \exp_not:o {\jlreq@heading@clearpage}%
         \unexpanded{\if@restonecol\twocolumn\fi}%
       }%
-      \noexpand\def\expandonce{\csname jlreq@headingcs@#1\endcsname}{%
+      \noexpand\def\exp_not:c {jlreq@headingcs@#1}{%
         % 改丁．これでよいのかな．
         \unexpanded{\if@twocolumn\onecolumn\@restonecoltrue\else\@restonecolfalse\fi\cleartooddpage[empty]}%
-        \ifx\jlreq@pagestyle\@empty\else\noexpand\thispagestyle{\expandonce{\jlreq@pagestyle}}\fi
-        \noexpand\secdef{\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}}{\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}}}%
-      \noexpand\def\expandonce{\csname #1\endcsname}{%
+        \ifx\jlreq@pagestyle\@empty\else\noexpand\thispagestyle{\exp_not:o {\jlreq@pagestyle}}\fi
+        \noexpand\secdef{\exp_not:c {jlreq@TobiraHeading@start@#1}}{\exp_not:c {jlreq@TobiraHeading@start@s@#1}}}%
+      \noexpand\def\exp_not:c {#1}{%
         \noexpand\UseHook{jlreq/heading/before}%
         \noexpand\UseHook{jlreq/heading/before/#1}%
-        \expandonce{\csname jlreq@headingcs@#1\endcsname}%
+        \exp_not:c {jlreq@headingcs@#1}%
       }%
     }%
   \expandafter\endgroup
@@ -1771,8 +1772,8 @@
 \long\def\jlreq@BlockHeading@start#1#2#3#4#5#6{%
   \if@noskipsec\leavevmode\fi
   % #5と#6は\parを含むかもしれないので引数渡しはしない（後の\@ifstarで詰まる）
-  \edef\jlreq@BlockHeading@start@eachformat{\expandonce{\@firstoftwo#5}}%
-  \edef\jlreq@BlockHeading@start@format{\expandonce{\@secondoftwo#5}}%
+  \edef\jlreq@BlockHeading@start@eachformat{\exp_not:o {\@firstoftwo#5}}%
+  \edef\jlreq@BlockHeading@start@format{\exp_not:o {\@secondoftwo#5}}%
   \edef\jlreq@BlockHeading@start@totalformat{\unexpanded{#6}}%
   \jlreq@BlockHeading@start@{#1}{#2}{#3}{#4}%
 }
@@ -1787,20 +1788,20 @@
 
 % {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}{5 = running head}{6 = 見出し}[7 = 副題]
 \long\def\jlreq@BlockHeading@start@@@#1#2#3#4#5#6[#7]{%
-  \edef\jlreq@do{\unexpanded{\jlreq@BlockHeading@start@@@@{#1}{#2}{#3}}{\expandonce{\jlreq@BlockHeading@start@totalformat}}}%
+  \edef\jlreq@do{\unexpanded{\jlreq@BlockHeading@start@@@@{#1}{#2}{#3}}{\exp_not:o {\jlreq@BlockHeading@start@totalformat}}}%
   \jlreq@do{#4}{#5}{#6}{#7}%
 }
 
 % {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = 全フォーマット}{5 = *}{6 = running head}{7 = 見出し}{8 = 副題}
 \long\def\jlreq@BlockHeading@start@@@@#1#2#3#4#5#6#7#8{%
   \edef\jlreq@tempa##1##2##3##4##5##6##7{%
-    \unexpanded{\jlreq@BlockHeading@start@makeoutput{#1}{#2}}{{##1}{##2}{##3}}{\expandonce{\jlreq@BlockHeading@start@eachformat}}{\expandonce{\jlreq@BlockHeading@start@format}}\unexpanded{{#5}{#6}{#7}{#8}}%
+    \unexpanded{\jlreq@BlockHeading@start@makeoutput{#1}{#2}}{{##1}{##2}{##3}}{\exp_not:o {\jlreq@BlockHeading@start@eachformat}}{\exp_not:o {\jlreq@BlockHeading@start@format}}\unexpanded{{#5}{#6}{#7}{#8}}%
     \unexpanded{\def\jlreq@tempb}{{##4}{##5}{##6}}% 縦方向空き
     \noexpand\jlreq@ifempty{##7}{\noexpand\jlreq@tempatrue}{\noexpand\jlreq@tempafalse}% 偶数ページのみで改ページするならば\jlreq@tempatrue
   }%
   \jlreq@tempa#3%
   \global\advance\jlreq@BlockHeading@spaces@current@count by 1
-  \gappto\jlreq@BlockHeading@spaces@current@sequence{_#1}%
+  \tl_gput_right:Nn \jlreq@BlockHeading@spaces@current@sequence {_#1}%
   % 連続する見出しの間の処理をするために，即時では出力せず，いったんマクロに格納する．
   % \jlreq@BlockHeading@spaces@current@before@<n>
   % \jlreq@BlockHeading@start@gyodori\jlreq@BlockHeading@spaces@current@space@<n>{jlreq@BlockHeading@spaces@current@output@<n>}
@@ -1808,16 +1809,16 @@
   % \jlreq@BlockHeading@spaces@current@after@<n>
   % として後に呼び出される．（spaceは書き換えられる可能性がある．）
   \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@output@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
-    \expandonce{\jlreq@resultb}%
+    \exp_not:o {\jlreq@resultb}%
   }%
   \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@space@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
-    \expandonce{\jlreq@tempb}%
+    \exp_not:o {\jlreq@tempb}%
   }%
   \def\@tempa##1##2##3{##1}%
   \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@before@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
     \noexpand\allowbreak
-    \expandonce{\@tempa#4}%
-    \expandonce{\jlreq@resulta}%
+    \exp_not:o {\@tempa#4}%
+    \exp_not:o {\jlreq@resulta}%
     \ifjlreq@tempa\unexpanded{%
       \jlreq@setcurrentpage
       \edef\jlreq@BlockHeading@currentpage{\the\jlreq@currentpage}%
@@ -1825,17 +1826,17 @@
   }%
   \def\@tempa##1##2##3{##2}%
   \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@format@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
-    \expandonce{\@tempa#4}%
+    \exp_not:o {\@tempa#4}%
   }%
   \def\@tempa##1##2##3{##3}%
   \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
-    \expandonce{\jlreq@resultc}%
+    \exp_not:o {\jlreq@resultc}%
     \ifjlreq@tempa\unexpanded{%
       \ifx\jlreq@BlockHeading@currentpage\@empty\nobreak\else
         \ifodd\jlreq@BlockHeading@currentpage\nobreak\else\allowbreak\fi
       \fi
     }\else\noexpand\nobreak\fi
-    \expandonce{\@tempa#4}%
+    \exp_not:o {\@tempa#4}%
   }%
   \ifx\jlreq@BlockHeading@spaces@headingslist\@empty
     \expandafter\jlreq@BlockHeading@spaces@outputwospace
@@ -1847,7 +1848,7 @@
 
 \def\jlreq@BlockHeading@start@afterheading{\futurelet\jlreq@nextchar\jlreq@BlockHeading@start@afterheading@i}
 \edef\jlreq@BlockHeading@start@afterheading@i{%
-  \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@BlockHeading@start@afterheading@skipspaces}%
+  \noexpand\ifx\exp_not:o {\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@BlockHeading@start@afterheading@skipspaces}%
   \unexpanded{\else\expandafter\jlreq@BlockHeading@start@afterheading@ii\fi}%
 }
 % スペースを読み飛ばす
@@ -1873,11 +1874,11 @@
 
 % コントロールシークエンスを保存
 \long\def\jlreq@BlockHeading@start@afterheading@saveafter@cs@noargument#1{%
-  \csgappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{#1}%
+  \tl_put_right:cn {jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count} {#1}
   \jlreq@BlockHeading@start@afterheading
 }
 \long\def\jlreq@BlockHeading@start@afterheading@saveafter@cs#1{%
-  \csgappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{#1}%
+  \tl_put_right:cn {jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count} {#1}
   \jlreq@BlockHeading@start@afterheading@saveafter@option
 }
 % オプションがあれば保存
@@ -1885,7 +1886,7 @@
   \@ifnextchar[{\jlreq@BlockHeading@start@afterheading@saveafter@option@}{\jlreq@BlockHeading@start@afterheading@saveafter@arguments}%
 }
 \long\def\jlreq@BlockHeading@start@afterheading@saveafter@option@[#1]{%
-  \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{[#1]}}%
+  \tl_put_right:cx {jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count} {\exp_not:n {[#1]}}
   \jlreq@BlockHeading@start@afterheading@saveafter@arguments
 }
 % 引数を保存し続けるループ
@@ -1896,14 +1897,14 @@
   \noexpand\ifx\space\unexpanded{\jlreq@nextchar\expandafter\jlreq@BlockHeading@start@afterheading@saveafter@arguments@@\else\expandafter\jlreq@BlockHeading@start@afterheading@saveafter@arguments@@@\fi}%
 }
 \expandafter\def\expandafter\jlreq@BlockHeading@start@afterheading@saveafter@arguments@@\space{%
-  \csgappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{ }%
+  \tl_put_right:cn {jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count} { }
   \jlreq@BlockHeading@start@afterheading@saveafter@arguments
 }
 \def\jlreq@BlockHeading@start@afterheading@saveafter@arguments@@@{%
   \jlreq@ifnextchar\bgroup{\jlreq@BlockHeading@start@afterheading@saveafter@arguments@@@@}{\jlreq@BlockHeading@start@afterheading}%
 }
 \long\def\jlreq@BlockHeading@start@afterheading@saveafter@arguments@@@@#1{%
-  \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{{#1}}}%
+  \tl_put_right:cx {jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count} {\exp_not:n {{#1}}}
   \jlreq@BlockHeading@start@afterheading@saveafter@arguments
 }
 
@@ -1923,9 +1924,9 @@
     \fi
     \edef\jlreq@tempa{\expandafter\jlreq@BlockHeading@start@geteachformat\expandafter{\jlreq@tempc}#4}% {ラベルフォーマット}{本文フォーマット}{副題フォーマット}
     \edef\jlreq@tempb{\expandafter\jlreq@BlockHeading@start@getformat\expandafter{\jlreq@tempc}#5}% {まとめるフォーマット}
-    \edef\jlreq@do{\noexpand\jlreq@BlockHeading@start@makeoutput@@\expandonce{\jlreq@tempa}\expandonce{\jlreq@tempb}\unexpanded{{#8}{#9}}}%
+    \edef\jlreq@do{\noexpand\jlreq@BlockHeading@start@makeoutput@@\exp_not:o {\jlreq@tempa}\exp_not:o {\jlreq@tempb}\unexpanded{{#8}{#9}}}%
     \jlreq@do
-    \edef\jlreq@do{\noexpand\jlreq@BlockHeading@start@makeoutput@\unexpanded{#3}{\expandonce{\jlreq@result}}}%
+    \edef\jlreq@do{\noexpand\jlreq@BlockHeading@start@makeoutput@\unexpanded{#3}{\exp_not:o {\jlreq@result}}}%
     \jlreq@do
     % \jlreq@tempa -> 素のラベルフォーマット
     \edef\jlreq@tempa{\jlreq@BlockHeading@start@getonlylabelformat#4}%
@@ -1945,10 +1946,10 @@
           {\unexpanded{\long\gdef\jlreqHeadingSubtitle####1{####1}}}%
       }%
       \unexpanded{\def\jlreq@resultb}{%
-        \expandonce{\jlreq@result}%
+        \exp_not:o {\jlreq@result}%
       }%
       \unexpanded{\def\jlreq@resultc}{%
-        \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{\unexpanded{#6}}{\expandonce{\jlreq@tempa}}{\unexpanded{#7}}%
+        \exp_not:c {jlreq@heading@maketoc@#1}{\unexpanded{#6}}{\exp_not:o {\jlreq@tempa}}{\unexpanded{#7}}%
       }%
     }%
   \expandafter\endgroup
@@ -1998,9 +1999,9 @@
     }%
     \long\def\jlreq@tempc##1##2##3{#4}% 全体のフォーマット
     % 二度展開すると欲しいものが得られる
-    \edef\jlreq@tempa{\noexpand\jlreq@tempc{\unexpanded{#1}}{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb}}}%
+    \edef\jlreq@tempa{\noexpand\jlreq@tempc{\unexpanded{#1}}{\exp_not:o {\jlreq@tempa}}{\exp_not:o {\jlreq@tempb}}}%
     \edef\jlreq@do{%
-      \unexpanded{\def\jlreq@result}{\expandafter\expandonce\expandafter{\jlreq@tempa}}%
+      \unexpanded{\def\jlreq@result}{\expandafter\exp_not:o \expandafter{\jlreq@tempa}}%
     }%
   \expandafter\endgroup
   \jlreq@do
@@ -2019,7 +2020,7 @@
     \def\jlreq@resultb{}%
   }{%
     \let\jlreq@resulta=#1
-    \edef\jlreq@resultb{\expandonce{\jlreq@BlockHeading@start@removecolumn#2}}%
+    \edef\jlreq@resultb{\exp_not:o {\jlreq@BlockHeading@start@removecolumn#2}}%
   }%
 }
 
@@ -2196,7 +2197,7 @@
     \def\jlreq@parsecomma##1##2{%
       \jlreq@helper@dividebycomma{##1}%
       \jlreq@if{\ifjlreq@result\fi}{%
-        \edef\jlreq@do{\noexpand\jlreq@tempa{\expandonce{\jlreq@resulta}}{\expandonce{\jlreq@resultb}}}%
+        \edef\jlreq@do{\noexpand\jlreq@tempa{\exp_not:o {\jlreq@resulta}}{\exp_not:o {\jlreq@resultb}}}%
       }{%
         \edef\jlreq@do{\noexpand\jlreq@tempa{##1}{}}%
       }%
@@ -2227,7 +2228,7 @@
         \jlreq@parsecomma{##1}{%
           \jlreq@iffirsttoken{####1}{*}{%
             \jlreq@second@text@indent@withlabelfalse
-            \edef\jlreq@second@heading@text@indent@wlabel{\expandonce{\@gobble ####1}}%
+            \edef\jlreq@second@heading@text@indent@wlabel{\exp_not:o {\@gobble ####1}}%
           }{%
             \jlreq@second@text@indent@withlabeltrue
             \def\jlreq@second@heading@text@indent@wlabel{####1}%
@@ -2244,14 +2245,14 @@
       subtitle_indent .code:n = {%
         \jlreq@iffirsttoken{##1}{*}{%
           \jlreq@subtitleindent@withlabelfalse
-          \edef\jlreq@subtitle@indent{\expandonce{\@gobble ##1}}%
+          \edef\jlreq@subtitle@indent{\exp_not:o {\@gobble ##1}}%
         }{%
           \jlreq@subtitleindent@withlabeltrue
           \def\jlreq@subtitle@indent{##1}%
         }%
       },
       subtitle_break .choices:nn = {true,false}{\csname jlreq@subtitle@break##1\endcsname},
-      afterindent .choices:nn = {true,false}{\edef\jlreq@afterindent{\expandonce{\csname @afterindent##1\endcsname}}},
+      afterindent .choices:nn = {true,false}{\edef\jlreq@afterindent{\exp_not:c {@afterindent##1}}},
       allowbreak_if_evenpage .choices:nn = {true,false}{%
         \str_if_eq:nnTF {##1} {true}
           {\def\jlreq@allowbreak@evenpage{}}
@@ -2273,7 +2274,7 @@
             \jlreq@tempafalse
             \def\jlreq@column@spanning{true}%
           }{%
-            \jlreq@switch{##1}{%
+            \str_case_e:nn {##1} {
               {true}{\jlreq@tempafalse\def\jlreq@column@spanning{true}}
               {false}{\jlreq@tempafalse\def\jlreq@column@spanning{false}}
             }%
@@ -2303,20 +2304,20 @@
     % ラベルありフォーマット：前
     \edef\jlreq@pre@format@wlabel{%
       \noexpand\noindent
-      \expandonce{\jlreq@font}%
+      \exp_not:o {\jlreq@font}%
       \ifnum 0\ifjlreq@second@text@indent@withlabel 1\fi\ifjlreq@subtitleindent@withlabel 1\fi>0
-        \unexpanded{\setbox\jlreq@BlockHeading@start@label@box=\hbox}{\expandonce{\jlreq@label@format}}%
+        \unexpanded{\setbox\jlreq@BlockHeading@start@label@box=\hbox}{\exp_not:o {\jlreq@label@format}}%
         \unexpanded{\xdef\jlreq@BlockHeading@start@labellength{\the\wd\jlreq@BlockHeading@start@label@box}}%
         \unexpanded{\def\jlreq@BlockHeading@start@outputlabel{\box\jlreq@BlockHeading@start@label@box}}%
       \else
         \unexpanded{\xdef\jlreq@BlockHeading@start@labellength{0pt}}%
-        \unexpanded{\def\jlreq@BlockHeading@start@outputlabel}{\expandonce{\jlreq@label@format}}%
+        \unexpanded{\def\jlreq@BlockHeading@start@outputlabel}{\exp_not:o {\jlreq@label@format}}%
       \fi
     }%
     % ラベルなしフォーマット：前
     \edef\jlreq@pre@format@wolabel{%
       \noexpand\noindent
-      \expandonce{\jlreq@font}%
+      \exp_not:o {\jlreq@font}%
       \unexpanded{\xdef\jlreq@BlockHeading@start@labellength{0pt}}%
       \unexpanded{\def\jlreq@BlockHeading@start@outputlabel}{}%
     }%
@@ -2325,22 +2326,22 @@
       \noexpand\jlreq@BlockHeading@start@outputlabel
       \unexpanded{\inhibitglue\hbox{}}%
       \ifdim\dimexpr\jlreq@after@label@space\relax=\dimexpr 0pt\relax\else
-        \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq@after@label@space}\noexpand\relax}%
+        \noexpand\hspace*{\noexpand\dimexpr\exp_not:o {\jlreq@after@label@space}\noexpand\relax}%
       \fi
     }%
     \edef\jlreq@heading@text@format@wlabel{%
       \ifnum 0\ifdim\jlreq@second@heading@text@indent@wlabel=\dimexpr 0pt\relax\else 1\fi\ifjlreq@second@text@indent@withlabel 1\fi>0
-        \unexpanded{\hangindent=\glueexpr}(\expandonce{\jlreq@second@heading@text@indent@wlabel})%
-          \ifjlreq@second@text@indent@withlabel + (\expandonce{\jlreq@after@label@space}) + \unexpanded{\jlreq@BlockHeading@start@labellength}\fi
+        \unexpanded{\hangindent=\glueexpr}(\exp_not:o {\jlreq@second@heading@text@indent@wlabel})%
+          \ifjlreq@second@text@indent@withlabel + (\exp_not:o {\jlreq@after@label@space}) + \unexpanded{\jlreq@BlockHeading@start@labellength}\fi
           \noexpand\relax
       \fi
-      \expandonce{\jlreq@heading@text@format}%
+      \exp_not:o {\jlreq@heading@text@format}%
     }%
     \edef\jlreq@heading@text@format@wolabel{%
       \ifdim\dimexpr\jlreq@second@heading@text@indent@wolabel\relax=\dimexpr 0pt\relax\else
-        \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq@second@heading@text@indent@wolabel}\noexpand\relax
+        \unexpanded{\hangindent=\dimexpr}\exp_not:o {\jlreq@second@heading@text@indent@wolabel}\noexpand\relax
       \fi
-      \expandonce{\jlreq@heading@text@format}%
+      \exp_not:o {\jlreq@heading@text@format}%
     }%
     % 副題：ラベルありかなしかはhangindentの扱いだけなので，他はまとめる
     \def\jlreq@make@subtitle@format##1##2{%
@@ -2351,35 +2352,35 @@
           \unexpanded{\nobreak\noindent}%
         \else
           \ifdim\jlreq@subtitle@indent=\dimexpr 0pt\relax\else
-            \noexpand\hspace*{\expandonce{\jlreq@subtitle@indent}}%
+            \noexpand\hspace*{\exp_not:o {\jlreq@subtitle@indent}}%
           \fi
         \fi
-        {\expandonce{\jlreq@subtitle@font}\expandonce{\jlreq@subtitle@format}}%
+        {\exp_not:o {\jlreq@subtitle@font}\exp_not:o {\jlreq@subtitle@format}}%
       }%
     }%
     \jlreq@make@subtitle@format\jlreq@subtitle@format@wlabel{%
       \ifjlreq@subtitleindent@withlabel
         \noexpand\hangafter=0
-        \unexpanded{\hangindent=\dimexpr}\noexpand\jlreq@BlockHeading@start@labellength + (\expandonce{\jlreq@after@label@space}) + (\expandonce{\jlreq@subtitle@indent})\noexpand\relax
+        \unexpanded{\hangindent=\dimexpr}\noexpand\jlreq@BlockHeading@start@labellength + (\exp_not:o {\jlreq@after@label@space}) + (\exp_not:o {\jlreq@subtitle@indent})\noexpand\relax
       \else
         \ifdim\jlreq@subtitle@indent=\dimexpr 0pt\relax\else
           \noexpand\hangafter=0
-          \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq@subtitle@indent}\noexpand\relax
+          \unexpanded{\hangindent=\dimexpr}\exp_not:o {\jlreq@subtitle@indent}\noexpand\relax
         \fi
       \fi
     }%
     \jlreq@make@subtitle@format\jlreq@subtitle@format@wolabel{%
       \ifdim\jlreq@subtitle@indent=\dimexpr 0pt\relax\else
         \noexpand\hangafter=0
-        \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq@subtitle@indent}\noexpand\relax
+        \unexpanded{\hangindent=\dimexpr}\exp_not:o {\jlreq@subtitle@indent}\noexpand\relax
       \fi
     }%
     \jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
-    \eappto\jlreq@do{\expandonce{\jlreq@result}}%
+    \tl_put_right:Nx \jlreq@do {\exp_not:o {\jlreq@result}}%
     \jlreq@BlockHeading@gyodori@parsekeyval*[BlockHeading:#1]{#3}{}{}{1}%
     \let\jlreq@spaceset=\jlreq@result
     \edef\jlreq@totalformat{\unexpanded{##1}}%
-    \edef\jlreq@totalformat@after{\expandonce{\jlreq@afterindent}\noexpand\@afterheading}%
+    \edef\jlreq@totalformat@after{\exp_not:o {\jlreq@afterindent}\noexpand\@afterheading}%
     \if@twocolumn
       \str_if_eq:VnT \jlreq@column@spanning { true }{%
         \def\@tempa##1##2##3{%
@@ -2394,7 +2395,7 @@
                 \jlreq@iffirsttoken{##2}{r}{}{\unexpanded{\vskip\glueexpr\baselineskip - \topskip\relax}}%
               }]%
             }{%
-              \expandonce{\jlreq@totalformat}
+              \exp_not:o {\jlreq@totalformat}
             }%
           }%
         }%
@@ -2403,30 +2404,30 @@
       }%
     \fi
     \edef\jlreq@do{%
-      \expandonce{\jlreq@do}%
-      \noexpand\edef\expandonce{\csname jlreq@headingcs@#1\endcsname}{\noexpand\unexpanded{%
+      \exp_not:o {\jlreq@do}%
+      \noexpand\edef\exp_not:c {jlreq@headingcs@#1}{\noexpand\unexpanded{%
         \noexpand\UseHook{jlreq/heading/before}%
         \noexpand\UseHook{jlreq/heading/before/#1}%
-        \expandonce{\jlreq@pagebreak}%
+        \exp_not:o {\jlreq@pagebreak}%
         \tl_if_empty:NF \l__jlreq_pagestyle_tl { \exp_not:N \thispagestyle {\exp_not:o { \l__jlreq_pagestyle_tl } } }
         \unexpanded{\jlreq@BlockHeading@start{#1}{#2}}%
-        {{\expandonce{\jlreq@align}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@end@indent}}\expandonce{\jlreq@spaceset}{\expandonce{\jlreq@allowbreak@evenpage}}}%
+        {{\exp_not:o {\jlreq@align}}{\exp_not:o {\jlreq@indent}}{\exp_not:o {\jlreq@end@indent}}\exp_not:o {\jlreq@spaceset}{\exp_not:o {\jlreq@allowbreak@evenpage}}}%
         {\ifjlreq@number\else -\fi}%
         {%
           {%
-            {\expandonce{\jlreq@label@format}}{\expandonce{\jlreq@label@format@modified}}%
-            {\expandonce{\jlreq@heading@text@format@wlabel}}{\expandonce{\jlreq@heading@text@format@wolabel}}%
-            {\expandonce{\jlreq@subtitle@format@wlabel}}{\expandonce{\jlreq@subtitle@format@wolabel}}%
+            {\exp_not:o {\jlreq@label@format}}{\exp_not:o {\jlreq@label@format@modified}}%
+            {\exp_not:o {\jlreq@heading@text@format@wlabel}}{\exp_not:o {\jlreq@heading@text@format@wolabel}}%
+            {\exp_not:o {\jlreq@subtitle@format@wlabel}}{\exp_not:o {\jlreq@subtitle@format@wolabel}}%
           }%
           {%
-            {\expandonce{\jlreq@pre@format@wlabel}}{\expandonce{\jlreq@pre@format@wolabel}}%
-            {\expandonce{\jlreq@format}}%
+            {\exp_not:o {\jlreq@pre@format@wlabel}}{\exp_not:o {\jlreq@pre@format@wolabel}}%
+            {\exp_not:o {\jlreq@format}}%
             {}{}%
           }%
         }%
-        {{}{\expandonce{\jlreq@totalformat}}{\expandonce{\jlreq@totalformat@after}}}%
+        {{}{\exp_not:o {\jlreq@totalformat}}{\exp_not:o {\jlreq@totalformat@after}}}%
       }}%
-      \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq@headingcs@#1\endcsname}}%
+      \noexpand\def\exp_not:c {#1}{\exp_not:c {jlreq@headingcs@#1}}%
     }%
   \expandafter\endgroup
   \jlreq@do
@@ -2486,8 +2487,8 @@
           \expandafter\let\csname jlreq@BlockHeading@spaces@setlist@####1\endcsname=\@undefined
         }%
       }%
-      \unexpanded{\def\jlreq@BlockHeading@spaces@headingslist}{\expandonce{\jlreq@tempa}}%
-      \expandonce{\jlreq@tempb}%
+      \unexpanded{\def\jlreq@BlockHeading@spaces@headingslist}{\exp_not:o {\jlreq@tempa}}%
+      \exp_not:o {\jlreq@tempb}%
     }%
   \expandafter\endgroup
   \jlreq@do
@@ -2511,22 +2512,22 @@
     }%
     \expandafter\jlreq@do\jlreq@totalset
     \jlreq@SetBlockHeadingSpaces@iii{#2}%
-    \eappto\jlreq@tempa{,\expandonce{\jlreq@headings}}% \jlreq@tempaに\jlreq@headingsを追加
+    \tl_put_right:Nx \jlreq@tempa {,\exp_not:o{\jlreq@headings}}% \jlreq@tempaに\jlreq@headingsを追加
     \ifjlreq@tempb
       \ifx\jlreq@lastdimen\@empty\else % 最後が寸法だったので\jlreq@SetBlockHeadingSpaces@totalsetを改変
         \def\jlreq@do##1##2##3{%
-          \edef\jlreq@totalset{{\unexpanded{##1}}{r:\expandonce{\jlreq@lastdimen}}{\unexpanded{##3}}}%
+          \edef\jlreq@totalset{{\unexpanded{##1}}{r:\exp_not:o {\jlreq@lastdimen}}{\unexpanded{##3}}}%
         }%
         \expandafter\jlreq@do\jlreq@totalset
       \fi
     \else
-      \eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}%
+      \tl_put_right:Nx \jlreq@set{{\exp_not:o {\jlreq@lastdimen}}}
     \fi
-    \eappto\jlreq@tempb{%
+    \tl_put_right:Nx \jlreq@tempb {%
       \noexpand\@ifundefined{jlreq@BlockHeading@spaces@setlist@\jlreq@headings}{}{%
         \noexpand\ClassError{jlreq}{The~spaces~for~\jlreq@headings\space is~defined~more~than~once~(in~SetBlockHeadingSpaces)}{\noexpand\@ehc}%
       }%
-      \noexpand\def\expandonce{\csname jlreq@BlockHeading@spaces@setlist@\jlreq@headings\endcsname}{{\expandonce{\jlreq@totalset}}\expandonce{\jlreq@set}}%
+      \noexpand\def\exp_not:c {jlreq@BlockHeading@spaces@setlist@\jlreq@headings}{{\exp_not:o {\jlreq@totalset}}\exp_not:o {\jlreq@set}}%
     }%
     \jlreq@SetBlockHeadingSpaces
   }%
@@ -2553,7 +2554,7 @@
   \clist_map_variable:nNn {#1} \@tempa {
     \expandafter\jlreq@helper@trim\expandafter{\@tempa}{\@tempa}%
     \str_if_eq:eeTF {\str_head:N \@tempa} {_} {
-      \ifx\jlreq@lastdimen\@empty\else\eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}\fi%
+      \ifx\jlreq@lastdimen\@empty\else\tl_put_right:Nx \jlreq@set {{\exp_not:o {\jlreq@lastdimen}}}\fi%
       \def\jlreq@lastdimen{}%
       \expandafter\jlreq@SetBlockHeadingSpaces@iv\@tempa{\jlreq@endmark}\jlreq@endmark
     }{%
@@ -2561,11 +2562,11 @@
       \ifjlreq@tempa
         % 最初が寸法なので，全体の設定（\jlreq@totalset）に組み込む．
         \def\jlreq@do##1##2##3{%
-          \edef\jlreq@totalset{{r:\expandonce{\@tempa}}{\unexpanded{##2}}{\unexpanded{##3}}}%
+          \edef\jlreq@totalset{{r:\exp_not:o {\@tempa}}{\unexpanded{##2}}{\unexpanded{##3}}}%
         }%
         \expandafter\jlreq@do\jlreq@totalset
       \else
-        \ifx\jlreq@lastdimen\@empty\else\eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}\fi
+        \ifx\jlreq@lastdimen\@empty\else\tl_put_right:Nx \jlreq@set {{\exp_not:o {\jlreq@lastdimen}}}\fi
         \let\jlreq@lastdimen=\@tempa
       \fi
     }%
@@ -2583,21 +2584,21 @@
     \@tempa#1%
     \ClassWarning{jlreq}{The~heading~name~`\@gobble #1'~ends~with~`*'.~Do~you^mean~`_\@tempa{*}'?~(in~SetBlockHeadingSpaces)}%
   }}{}%
-  \appto\jlreq@headings{#1}%
+  \tl_put_right:Nn \jlreq@headings {#1}%
   \jlreq@SetBlockHeadingSpaces@v
 }
 \def\jlreq@SetBlockHeadingSpaces@v#1{%
   % 空っぽの場合は{_{r:0pt}{r:0pt}{}}
   \jlreq@ifendmark{#1}{%
-    \appto\jlreq@set{{_{r:0pt}{r:0pt}{}}}
+    \tl_put_right:Nn \jlreq@set {{_{r:0pt}{r:0pt}{}}}
     \@gobble
   }{%
     \jlreq@iffirsttoken{#1}{*}{% *始まりの場合は{_*{}{}{}}
       \expandafter\jlreq@BlockHeading@gyodori@parsekeyval\expandafter{\@gobble #1}{}{}{}%
-      \eappto\jlreq@set{{_*\expandonce{\jlreq@result}}}%
+      \tl_put_right:Nx \jlreq@set{{_*\exp_not:o {\jlreq@result}}}%
     }{% それ以外の場合は{_{}{}{}}
       \jlreq@BlockHeading@gyodori@parsekeyval{#1}{}{}{}%
-      \eappto\jlreq@set{{_\expandonce{\jlreq@result}}}%
+      \tl_put_right:Nx \jlreq@set{{_\exp_not:o {\jlreq@result}}}%
     }%
     \jlreq@SetBlockHeadingSpaces@vi
   }%
@@ -2635,19 +2636,19 @@
 \def\jlreq@BlockHeading@spaces@outputwospace@{%
   \ifnum\jlreq@tempcnta<\jlreq@BlockHeading@spaces@current@count
     \advance\jlreq@tempcnta by 1
-    \eappto\jlreq@do{\csexpandonce{jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}}%
+    \tl_put_right:Nx \jlreq@do {\exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}}%
     \edef\jlreq@tempa{%
-      \unexpanded{\long\def\jlreq@tempa##1}{\csexpandonce{jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
+      \unexpanded{\long\def\jlreq@tempa##1}{\exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
     }%
     \jlreq@tempa
     \edef\jlreq@tempb{%
-      \noexpand\expandonce{\noexpand\jlreq@tempa{%
+      \noexpand\exp_not:o {\noexpand\jlreq@tempa{%
         \noexpand\jlreq@BlockHeading@start@gyodori
-          \csexpandonce{jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta}%
-          {\csexpandonce{jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}%
+          \exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta}%
+          {\exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}%
       }}%
     }%
-    \eappto\jlreq@do{\jlreq@tempb\csexpandonce{jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}}%
+    \tl_put_right:Nx \jlreq@do {\jlreq@tempb\exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}}%
     \expandafter\jlreq@BlockHeading@spaces@outputwospace@
   \fi
 }
@@ -2662,10 +2663,10 @@
   \edef\jlreq@do{%
     \ifjlreq@tempa
       \unexpanded{\jlreq@BlockHeading@start@gyodori#1}{%
-        \expandonce{\jlreq@result}%
+        \exp_not:o {\jlreq@result}%
       }%
     \else
-      \expandonce{\jlreq@result}%
+      \exp_not:o {\jlreq@result}%
     \fi
   }%
   \jlreq@BlockHeading@spaces@clear
@@ -2678,7 +2679,7 @@
       \advance\jlreq@tempcnta by 1
       \expandafter\jlreq@BlockHeading@spaces@output@@@\expandafter{\@gobble #1}%
     }{%
-      \appto\jlreq@result{\vskip\glueexpr #1\relax}%
+      \tl_put_right:Nn \jlreq@result {\vskip\glueexpr #1\relax}%
     }%
     \jlreq@BlockHeading@spaces@output@@
   }%
@@ -2686,20 +2687,20 @@
 \def\jlreq@BlockHeading@spaces@output@@@#1{%
   \edef\jlreq@do{%
     \noexpand\jlreq@BlockHeading@spaces@output@@@@
-    \jlreq@iffirsttoken@ignorespaces{#1}{*}{{*}\expandonce{\@gobble #1}}{\unexpanded{{}#1}}%
-      \csexpandonce{jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta}%
-      {\csexpandonce{jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}%
+    \jlreq@iffirsttoken@ignorespaces{#1}{*}{{*}\exp_not:o {\@gobble #1}}{\unexpanded{{}#1}}%
+      \exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta}%
+      {\exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}%
   }%
   \jlreq@do
 }
 % #1: デフォルト値を使うならば*，#2#3#4が設定された値，#5#6#7がデフォルト値，#8は偶数ページの，#9が出力
 \def\jlreq@BlockHeading@spaces@output@@@@#1#2#3#4#5#6#7#8{%
   \edef\jlreq@tempa{%
-    \unexpanded{\long\def\jlreq@tempa##1}{\csexpandonce{jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
+    \unexpanded{\long\def\jlreq@tempa##1}{\exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
   }%
   \jlreq@tempa
   \edef\jlreq@tempb{%
-    \noexpand\expandonce{\noexpand\jlreq@tempa{%
+    \noexpand\exp_not:o {\noexpand\jlreq@tempa{%
       \noexpand\jlreq@BlockHeading@start@gyodori
       \jlreq@ifempty{#1}{\unexpanded{{#2}{#3}{#4}}}{%
         {\jlreq@ifempty{#2}{\unexpanded{#5}}{\unexpanded{#2}}}%
@@ -2708,10 +2709,10 @@
       }\unexpanded{{#8}}%
     }}%
   }%
-  \eappto\jlreq@result{%
-    \csexpandonce{jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}%
+  \tl_put_right:Nx \jlreq@result {%
+    \exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}%
     \jlreq@tempb
-    \csexpandonce{jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}%
+    \exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}%
   }%
 }
 
@@ -2742,7 +2743,7 @@
 }
 % {1 = 命令名}{2 = レベル}{3 = */-}{4 = running head}{5 = 見出し}
 \long\def\jlreq@RuninHeading@start@#1#2#3[#4]#5{%
-  \edef\jlreq@do{\unexpanded{\jlreq@RuninHeading@start@@{#1}{#2}{#3}{#4}{#5}}{\expandonce{\jlreq@RuninHeading@start@format@label}}{\expandonce{\jlreq@RuninHeading@start@format@wlabel}}{\expandonce{\jlreq@RuninHeading@start@format@wolabel}}}%
+  \edef\jlreq@do{\unexpanded{\jlreq@RuninHeading@start@@{#1}{#2}{#3}{#4}{#5}}{\exp_not:o {\jlreq@RuninHeading@start@format@label}}{\exp_not:o {\jlreq@RuninHeading@start@format@wlabel}}{\exp_not:o {\jlreq@RuninHeading@start@format@wolabel}}}%
   \jlreq@do
 }
 % {1 = 命令名}{2 = レベル}{3 = *}{4 = running head}{5 = 見出し}{6 = ラベルフォーマット}{7 = ラベルありフォーマット}{8 = ラベルなしフォーマット}
@@ -2755,19 +2756,19 @@
       \ifnum0\jlreq@ifempty{#3}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0
         \def\jlreq@tempa##1{#8}%
       \else
-        \appto\jlreq@do{\refstepcounter{#1}}%
+        \tl_put_right:Nn \jlreq@do {\refstepcounter{#1}}%
         \def\jlreq@tempa##1{#7}%
       \fi
       \par}%
-      \unexpanded{\eappto\jlreq@do}{%
+      \unexpanded{\tl_put_right:Nx \jlreq@do}{%
         \unexpanded{\noexpand\everypar}{%
           \unexpanded{%
           \noexpand\if@noskipsec
             \unexpanded{\global\@noskipsecfalse}%
             \unexpanded{{\setbox\jlreq@tempboxa\lastbox}}%
             \noexpand\begingroup
-              \expandonce{\jlreq@tempa{#5}}%
-              \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}\unexpanded{{#3}{#6}{#4}}%
+              \exp_not:o {\jlreq@tempa{#5}}%
+              \exp_not:c {jlreq@heading@maketoc@#1}\unexpanded{{#3}{#6}{#4}}%
             \noexpand\endgroup
             \noexpand\inhibitglue
           \noexpand\else
@@ -2848,7 +2849,7 @@
     \cs_set:Nx \l__jlreq_do: {
       \exp_not:o { \jlreq@result }
       % パラメータトークンを含むので，\edefして\unexpandedで包む
-      \noexpand\edef\expandonce{\csname #1\endcsname}{%
+      \noexpand\edef\exp_not:c {#1}{%
         \noexpand\unexpanded{%
           \exp_not:N \UseHook{jlreq/heading/before}%
           \exp_not:N \UseHook{jlreq/heading/before/#1}
@@ -3010,10 +3011,10 @@
       }
     }
     \cs_set:Nx \l_jlreq_do: {
-      \exp_not:v { jlreq@heading@type@#1 }
+      \exp_args:Nc \exp_not:o { 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_args:Nc \exp_not:o { jlreq@heading@level@#1 } }
+      { \exp_args:Nc \exp_not:o { jlreq@heading@setting@#1 },\exp_not:V \l_jlreq_tmpa_tl }
     }
   \exp_after:wN \group_end:
   \l_jlreq_do:
@@ -3022,7 +3023,7 @@
 \NewDocumentCommand{\SaveHeading}{ m m }{%
   \@ifundefined{jlreq@heading@setting@#1}{\ClassError{jlreq}{Unknown~heading:~#1}{\@ehc}}{}%
   \edef#2{%
-    \csexpandonce{jlreq@heading@type@#1}{\unexpanded{#1}}{\csexpandonce{jlreq@heading@level@#1}}{\csexpandonce{jlreq@heading@setting@#1}}%
+    \exp_args:Nc \exp_not:o {jlreq@heading@type@#1}{\unexpanded{#1}}{\exp_args:Nc \exp_not:o {jlreq@heading@level@#1}}{\exp_args:Nc \exp_not:o {jlreq@heading@setting@#1}}%
   }%
 }
 
@@ -3062,10 +3063,9 @@
 %.. カウンターの定義（見出し本体はこのファイルの末尾で）
 \setcounter{secnumdepth}{3}
 \newcounter{part}
-\jlreq@switch{\jlreq@article@type}{
-  {article}{\newcounter{section}}
-  {\newcounter{chapter}\newcounter{section}[chapter]}% book, report
-}
+\str_if_eq:VnTF \jlreq@article@type { article } 
+  { \newcounter{section} }
+  { \newcounter{chapter}\newcounter{section}[chapter] }
 \newcounter{subsection}[section]
 \newcounter{subsubsection}[subsection]
 \newcounter{paragraph}[subsubsection]
@@ -3095,14 +3095,14 @@
     % 後ろ側に始め括弧類（cl-01）が配置される場合を除いて，ベタ組（4.2.3，二つ目のc，三つ目のb）．
     \def\jlreq@hook@postnote{\futurelet\jlreq@nextchar\jlreq@postnote@checkopenbracket}%
     \def\@tempa{}
-    \def\jlreq@do##1{\jlreq@ifendmark{##1}{}{\appto\@tempa{\ifx\jlreq@tempb##11\fi}\jlreq@do}}
+    \def\jlreq@do##1{\jlreq@ifendmark{##1}{}{\tl_put_right:Nn \@tempa {\ifx\jlreq@tempb##11\fi}\jlreq@do}}
     \expandafter\jlreq@do\jlreq@charlist@openingbrackets\jlreq@endmark
     \edef\jlreq@postnote@checkopenbracket{%
       \unexpanded{%
         \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\exp_not:o {\@tempa}>0~\noexpand\fi}{}{\noexpand\inhibitglue}%
     }
   },
   reference_mark / interlinear .code:n = {
@@ -3199,7 +3199,7 @@
     }{
       \def\jlreq@makefntext{\addtolength{\leftskip}{\glueexpr #1\relax}}
     }
-    \long\edef\jlreq@makefntext##1{\expandonce{\jlreq@makefntext}%
+    \long\edef\jlreq@makefntext##1{\exp_not:o {\jlreq@makefntext}%
       \unexpanded{%
         \addtolength{\leftskip}{\jlreq@footnoteindent}%
         \parindent=1\jlreq@zw
@@ -3265,7 +3265,7 @@
     \expandafter\gdef\expandafter\jlreq@footnote@delayfootnoteslist\expandafter{\expandafter}%
     \jlreq@footnote@delayfootnoteslist
   }
-  \preto\@opcol{\jlreq@hook@@opcol}
+  \tl_put_left:Nn \@opcol{\jlreq@hook@@opcol}
   % \jlreq@footnote@delayfootnote@delay#1#2：#1ページ目に#2を出す
   % \jlreq@footnote@delayfootnote@page：何ページ目に\footnotetextを入れるかを\jlreq@resultcntに入れる．その場での場合は-1．
   \if@twocolumn
@@ -3286,7 +3286,7 @@
     \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}{%
-        \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}}}%
+        \tl_gput_right:Nx \jlreq@footnote@delayfootnoteslist {\exp_not:n { \jlreq@footnote@delayfootnote{#1}{#2} } }
       }{#2}%
     }
   \else
@@ -3301,13 +3301,13 @@
     \long\def\jlreq@footnote@delayfootnote@delay#1#2{%
       % 一段組の場合はその前のページを組んだ直後に\footnotetextを挿入．
       \jlreq@if{\ifnum\numexpr#1 - 1\relax>\value{page}~\fi}{%
-        \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}}}%
+        \tl_gput_right:Nx \jlreq@footnote@delayfootnoteslist { \exp_not:n {\jlreq@footnote@delayfootnote{#1}{#2} } }
       }{#2}%
     }
   \fi
   \long\def\jlreq@footnote@delayfootnote@immediate#1#2{%
     \jlreq@if{\ifnum #1<\jlreq@currentpage\relax\fi}{%
-      \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}}}%
+      \tl_gput_right:Nx \jlreq@footnote@delayfootnoteslist{ \exp_not:n { \jlreq@footnote@delayfootnote{#1}{#2} } }
     }{#2}%
   }
   \let\jlreq@footnote@delayfootnote=\jlreq@footnote@delayfootnote@delay
@@ -3321,7 +3321,7 @@
     }%
   }
   \AtEndDocument{\jlreq@footnote@flushdelayfootnoteslist}
-  \preto\newpage{\jlreq@footnote@flushdelayfootnoteslist}
+  \tl_put_left:Nn \newpage {\jlreq@footnote@flushdelayfootnoteslist}
   \long\def\jlreq@footnote@impl@woption#1#2#3[#4]#5{%
     \jlreq@footnote@delayfootnote@page
     \begingroup
@@ -3331,10 +3331,10 @@
         \def\jlreq@result{}#3[#4]{#5}%
         \jlreq@restore@jlreq@footnotes}%
         \int_compare:nTF { \jlreq@resultcnt=-1 }{\noexpand\jlreq@result}{\unexpanded{%
-          \xappto\jlreq@footnote@delayfootnoteslist{%
+          \tl_gput_right:Nx \jlreq@footnote@delayfootnoteslist {%
             \noexpand\jlreq@footnote@delayfootnote{\the\jlreq@resultcnt}{%
               \noexpand\jlreq@restore@original@footnotes
-              \expandonce{\jlreq@result}%
+              \exp_not:o {\jlreq@result}%
               \noexpand\jlreq@restore@jlreq@footnotes
             }%
           }%
@@ -3351,10 +3351,10 @@
         \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{%
-          \xappto\jlreq@footnote@delayfootnoteslist{%
+          \tl_gput_right:Nx \jlreq@footnote@delayfootnoteslist {%
             \noexpand\jlreq@footnote@delayfootnote{\the\jlreq@resultcnt}{%
               \noexpand\jlreq@restore@original@footnotes
-              \expandonce{\jlreq@result}%
+              \exp_not:o {\jlreq@result}%
               \noexpand\jlreq@restore@jlreq@footnotes
             }%
           }%
@@ -3401,13 +3401,28 @@
 \newdimen\jlreq@endnote@indent
 % 現在の後注一覧を，\jlreq@endnote@textsに{{合印1}{後注1}}{{合印2}{後注2}}...の形で保持する
 \def\jlreq@endnote@texts{}
-\long\def\jlreq@endnote@addtext#1#2{\xappto\jlreq@endnote@texts{\unexpanded{{{#1}{#2}}}}}
+\long\def\jlreq@endnote@addtext#1#2{\tl_gput_right:Nx \jlreq@endnote@texts { \exp_not:n {{{#1}{#2}}} } }
 % \endnote自身は後で定義する
-\def\jlreq@endnote@impl{\jlreq@hook@prenote\@ifnextchar[{\jlreq@endnote}{\jlreq@endnote[]}}  
-\def\endnotemark{\jlreq@hook@prenote\@ifnextchar[{\jlreq@endnotemark}{\jlreq@endnotemark[]}}
-\def\endnotetext{\@ifnextchar[{\jlreq@endnotetext}{\jlreq@endnotetext[]}}
-\long\def\jlreq@endnote[#1]#2{\jlreq@endnotemark[#1]\@endnotetext{#2}\jlreq@hook@postnote}
-\def\jlreq@endnotemark[#1]{%
+\NewHook{cmd/endnote/before}
+\NewHook{cmd/endnote/after}
+\NewHook{cmd/endnotemark/before}
+\NewHook{cmd/endnotemark/after}
+\NewDocumentCommand { \endnotemark }{ O{} } {
+  \jlreq@hook@prenote
+  \UseHook{cmd/endnote/before}
+  \jlreq@endnotemark{#1}
+  \UseHook{cmd/endnote/after}
+  \jlreq@hook@postnote
+}
+\NewDocumentCommand { \endnotetext } { O{} +m } { \jlreq@endnotetext{#1}{#2} }
+\long\def\jlreq@endnote#1#2{
+  \jlreq@hook@prenote
+  \UseHook{ cmd/endnote/before }
+  \jlreq@endnotemark{#1}\@endnotetext{#2}
+  \UseHook{ cmd/endnote/after }
+  \jlreq@hook@postnote
+}
+\def\jlreq@endnotemark#1{%
   \jlreq@ifempty{#1}{%
     \stepcounter{\jlreq@endnotecounter}%
     \expandafter\protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
@@ -3418,10 +3433,9 @@
     \endgroup
   }%
   \@endnotemark
-  \jlreq@hook@postnote
 }
 \jlreq@setdefaultnotemark\@endnotemark\@makeendmark
-\long\def\jlreq@endnotetext[#1]#2{%
+\long\def\jlreq@endnotetext#1#2{%
   \jlreq@ifempty{#1}{%
     \expandafter\protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
   }{%
@@ -3502,35 +3516,39 @@
     \jlreq@tempafalse % headingsが指定された
     \jlreq@tempbfalse % paragraphが指定された
     % \jlreq@tempcにセクション名たちを入れていく
-    \def\jlreq@tempc{}
+    \seq_clear:N \l_jlreq_tmpa_seq
     \clist_map_variable:nNn {#1} \jlreq@tempa {
-      \expandafter\jlreq@helper@trim\expandafter{\jlreq@tempa}{\jlreq@tempa}%
-      \jlreq@switch{\jlreq@tempa}{
+      \tl_set:Nx \@tempa { \tl_trim_spaces:o \@tempa }
+      \str_case_e:nnF {\jlreq@tempa} {
         {headings}{\jlreq@tempatrue}
         {paragraph}{
           \jlreq@tempatrue% _paragraphの時は_headingsも有効にする
           \jlreq@tempbtrue
         }
-        {
-          \str_if_eq:eeTF { \str_head:N \jlreq@tempa } {_} {
-            \edef\jlreq@tempc{\jlreq@tempc,\expandafter\@gobble\jlreq@tempa}
-          }{
-            \ClassError{jlreq}{Invalid~value~\jlreq@tempa\space in~endnote_position}{\@ehc}
-          }
+      }{
+        \str_if_eq:eeTF { \str_head:N \jlreq@tempa } {_} {
+          \seq_put_left:Nx \l_jlreq_tmpa_seq { \tl_tail:N \jlreq@tempa }
+        }{
+         \ClassError{jlreq}{Invalid~value~\jlreq@tempa\space in~endnote_position}{\@ehc}
         }
       }
     }
     
     \ifjlreq@tempb
-      \edef\endnote{\unexpanded{\def\par{\@restorepar\theendnotes\par}}\expandonce{\jlreq@endnote@impl}}
+      \DeclareDocumentCommand { \endnote } { O{} +m } {
+        \AddToHookNext { para/after } { \theendnotes }
+        \jlreq@endnote{##1}{##2}
+      }
     \else
-      \let\endnote=\jlreq@endnote@impl
+      \DeclareDocumentCommand { \endnote } { O{} +m } {
+        \jlreq@endnote{##1}{##2}
+      }
     \fi
 
     \ifjlreq@tempa
       \AddToHook{jlreq/heading/before}[jlreq/endnote]{\theendnotes}
     \else
-      \clist_map_variable:NNn \jlreq@tempc \@tempa {
+      \seq_map_variable:NNn \l_jlreq_tmpa_seq \@tempa {
         \tl_if_empty:VF \@tempa {
           \AddToHook{jlreq/heading/before/\@tempa}[jlreq/endnote]{}
           \RemoveFromHook{jlreq/heading/before/\@tempa}[jlreq/endnote]
@@ -3551,8 +3569,11 @@
 % (1) では\sidenote[]{}を定義
 % (2) では\sidenote{見出し}{注中身}を定義
 % sidenote_length>0ptの時のみ定義する
-\jlreq@if{\ifdim\jlreq@sidenote@length>0pt\relax\fi}
-{
+\dim_compare:nT { \jlreq@sidenote@length > 0pt } {
+  \ProvideHook{ cmd/sidenote/before }
+  \ProvideHook{ cmd/sidenote/after }
+  \ProvideHook{ cmd/sidenotemark/before }
+  \ProvideHook{ cmd/sidenotemark/after }
   \def\jlreq@sidenotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
   \long\def\@sidenotetext#1{%
     \marginpar{\reset@font\footnotesize
@@ -3569,12 +3590,20 @@
   \def\jlreq@sidenote@type{number}
   \__jlreq_jlreqsetup_addtofinally:n {
     \str_if_eq:VnT \jlreq@sidenote@type { number } {
-      \def\sidenote{\jlreq@hook@prenote\@ifnextchar[{\jlreq@sidenote}{\jlreq@sidenote[]}}
-      \def\sidenotemark{\jlreq@hook@prenote\@ifnextchar[{\jlreq@sidenotemark}{\jlreq@sidenotemark[]}}
-      \def\sidenotetext{\@ifnextchar[{\jlreq@sidenotetext}{\jlreq@sidenotetext[]}}
-      \long\def\jlreq@sidenote[#1]#2{\jlreq@sidenotemark[#1]\@sidenotetext{#2}\jlreq@hook@postnote}
-      \def\jlreq@sidenotemark[#1]{%
-        \jlreq@ifempty{#1}{%
+      \DeclareDocumentCommand { \sidenote } { O{} +m } {
+        \jlreq@hook@prenote\UseHook{cmd/sidenote/before}
+        \jlreq@sidenote{#1}{#2}
+        \UseHook{cmd/sidenote/after}\jlreq@hook@postnote
+      }
+      \DeclareDocumentCommand { \sidenotemark } { O{}   } {
+        \jlreq@hook@prenote\UseHook{cmd/sidenotemark/before}
+        \jlreq@sidenotemark{#1}
+        \UseHook{cmd/sidenotemark/after}\jlreq@hook@postnote
+      }
+      \DeclareDocumentCommand { \sidenotetext } { O{} +m } { \jlreq@sidenotetext{#1}{#2} }
+      \long\def\jlreq@sidenote#1#2{\jlreq@sidenotemark{#1}\@sidenotetext{#2}}
+      \def\jlreq@sidenotemark#1{%
+        \tl_if_empty:nTF{#1}{%
           \stepcounter{\jlreq@sidenotecounter}%
           \expandafter\protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
         }{%
@@ -3584,10 +3613,9 @@
           \endgroup
         }%
         \@sidenotemark
-        \jlreq@hook@postnote
       }
-      \long\def\jlreq@sidenotetext[#1]#2{%
-        \jlreq@ifempty{#1}{%
+      \long\def\jlreq@sidenotetext#1#2{%
+        \tl_if_empty:nTF{#1}{%
           \expandafter\protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
         }{%
          \begingroup
@@ -3607,15 +3635,15 @@
       \let\@makesidemark=\@makefnmark
     }
     \str_if_eq:VnT \jlreq@sidenote@type { symbol } {% sidenote_type = symbol
-      \long\def\sidenote#1#2{\jlreq@sidenote{#1}{#2}}
-      \def\sidenotemark#1{\jlreq@sidenotemark{#1}}
-      \long\def\sidenotetext#1#2{\jlreq@sidenotetext{#1}{#2}}
+      \DeclareDocumentCommand { \sidenote     } { m +m } { \UseHook{cmd/sidenote/before}\jlreq@sidenote{#1}{#2}\UseHook{cmd/sidenote/after} }
+      \DeclareDocumentCommand { \sidenotemark } { m   } { \UseHook{cmd/sidenotemark/before}\jlreq@sidenotemark{#1}\UseHook{cmd/sidenote/after} }
+      \DeclareDocumentCommand { \sidenotetext } { m +m } { \jlreq@sidenotetext{#1}{#2} }
       \long\def\jlreq@sidenote#1#2{\jlreq@sidenotemark{#1}\jlreq@sidenotetext{#1}{#2}}
       \edef\jlreq@sidenotemark#1{%
         {\unexpanded{\reset@font\jlreq@sidenote@keywordfont}#1}%
         \noexpand\jlreq@hook@prenote
         \ifx\jlreq@sidenote@defaultmark\@empty\else
-          \expandafter\edef\expandonce{\csname\jlreq@sidenotemarkname\endcsname}{\expandonce{\jlreq@sidenote@defaultmark}}%
+          \expandafter\edef\exp_not:c {\jlreq@sidenotemarkname}{\exp_not:o {\jlreq@sidenote@defaultmark}}%
           \noexpand\@sidenotemark
         \fi
       }
@@ -3626,14 +3654,11 @@
       }
       \long\def\@makesidetext#1{{\sffamily\gtfamily\bfseries\csname\jlreq@sidenotemarkname\endcsname}\hspace*{1\jlreq@mol}#1}
       \let\@makesidemark=\@makefnmark
-
-      \apptocmd{\sidenote}{\jlreq@hook@postnote}{}{}
-      \apptocmd{\sidenotemark}{\jlreq@hook@postnote}{}{}
     }
   }
   \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 }
-}{}
+}
 
 %.. 割注（3.4）
 \def\inlinenotesize{.6\jlreq@jafontsize} % 割注の文字サイズ
@@ -3956,9 +3981,9 @@
 
 % #1のleftとrightを入れ替えて#1に代入
 \def\jlreq@reverse@leftright#1{%
-  \jlreq@switch{#1}{
-    {left}{\def#1{right}}
-    {right}{\def#1{left}}
+  \str_case_e:nn {#1} {
+    { left  }{ \def#1{right} }
+    { right }{ \def#1{left}  }
   }%
 }
 
@@ -4015,13 +4040,14 @@
         }%
       }%
       \edef\jlreq@headingname{\expandafter\@gobble#1}% 見出し命令名
-      \edef\jlreq@tempa{\noexpand\@removeelement{\expandonce{\jlreq@headingname}}}%
+      \edef\jlreq@tempa{\noexpand\@removeelement{\exp_not:o {\jlreq@headingname}}}%
       \expandafter\jlreq@tempa\expandafter{#5}{#5}%
       \@ifundefined{#4@\jlreq@headingname}{\expandafter\def\csname #4@\jlreq@headingname\endcsname{}}{}%
-      \eappto\jlreq@do{%
-        \noexpand\let\expandonce{\csname\expandafter\@gobble\string #1@heading@level\endcsname}=\expandonce{\csname jlreq@heading@level@\jlreq@headingname\endcsname}%
-        \unexpanded{\def#5}{\expandonce{#5},\expandonce{\jlreq@headingname}}%
-        \noexpand\appto\expandonce{\csname #4@\jlreq@headingname\endcsname}{{{\int_compare:nT {#2=0} {#3}}{#2}{\ifx r\jlreq@leftright r\else l\fi}}}%
+      \tl_put_right:Nx \jlreq@do {%
+        \exp_not:N \@ifundefined {#4@\jlreq@headingname} { \exp_not:N \@namedef {#4@\jlreq@headingname} {} } {}
+        \noexpand\let\exp_not:c {\expandafter\@gobble\string #1@heading@level}=\exp_not:c {jlreq@heading@level@\jlreq@headingname}%
+        \exp_not:n {\def#5}{\exp_not:o {#5},\exp_not:o {\jlreq@headingname}}%
+        \exp_not:N \tl_put_right:Nn \exp_not:c {#4@\jlreq@headingname} {{{\int_compare:nT {#2=0} {#3}}{#2}{\ifx r\jlreq@leftright r\else l\fi}}}%
       }%
     }{\def\jlreq@do{}}%
   \expandafter\endgroup
@@ -4043,28 +4069,32 @@
     % leftを設定する時は対応するrightを空にする．
     \expandafter\ifx\csname jlreq@leftmark@0\endcsname\@empty
       \expandafter\ifx\csname jlreq@rightmark@0\endcsname\@empty\else
-        \eappto\jlreq@do{\jlreq@ifempty{#1}{\noexpand\markright}{\noexpand\jlreq@markright}{\csexpandonce{jlreq@rightmark@0}}}%
+        \tl_put_right:Nx \jlreq@do {
+          \jlreq@ifempty{#1}{\noexpand\markright}{\noexpand\jlreq@markright}{\exp_args:Nc \exp_not:o {jlreq@rightmark@0}}
+        }%
       \fi
     \else
-      \eappto\jlreq@do{\jlreq@ifempty{#1}{\noexpand\markboth}{\noexpand\jlreq@markboth}{\csexpandonce{jlreq@leftmark@0}}{\csexpandonce{jlreq@rightmark@0}}}%
+      \tl_put_right:Nx \jlreq@do {
+        \jlreq@ifempty{#1}{\noexpand\markboth}{\noexpand\jlreq@markboth}{\exp_args:Nc \exp_not:o {jlreq@leftmark@0}}{\exp_args:Nc \exp_not:o {jlreq@rightmark@0}}
+      }%
     \fi
     \clist_map_variable:nNn {1,2} \jlreq@i {
       \expandafter\ifx\csname jlreq@leftmark@\jlreq@i\endcsname\@empty
         \expandafter\ifx\csname jlreq@rightmark@\jlreq@i\endcsname\@empty\else
-          \eappto\jlreq@do{\noexpand\jlreq@setextrarightmark{\jlreq@i}{\csexpandonce{jlreq@rightmark@\jlreq@i}}}%
+          \tl_put_right:Nx \jlreq@do {\noexpand\jlreq@setextrarightmark{\jlreq@i}{\exp_args:Nc \exp_not:o {jlreq@rightmark@\jlreq@i}}}%
         \fi
       \else
-        \eappto\jlreq@do{%
-          \noexpand\jlreq@setextraleftmark{\jlreq@i}{\csexpandonce{jlreq@leftmark@\jlreq@i}}%
-          \noexpand\jlreq@setextrarightmark{\jlreq@i}{\csexpandonce{jlreq@rightmark@\jlreq@i}}%
+        \tl_put_right:Nx \jlreq@do{%
+          \noexpand\jlreq@setextraleftmark{\jlreq@i}{\exp_args:Nc \exp_not:o {jlreq@leftmark@\jlreq@i}}%
+          \noexpand\jlreq@setextrarightmark{\jlreq@i}{\exp_args:Nc \exp_not:o {jlreq@rightmark@\jlreq@i}}%
         }%
       \fi
     }%
     \ifx\jlreq@do\@empty\else
       \edef\jlreq@do{%
         \unexpanded{\edef\jlreq@result}{\noexpand\unexpanded{%
-          \noexpand\def\expandonce{\csname #2mark\endcsname}\unexpanded{##1}{%
-            \expandonce{\jlreq@do}%
+          \noexpand\def\exp_not:c {#2mark}\unexpanded{##1}{%
+            \exp_not:o {\jlreq@do}%
           }}%
         }%
       }%
@@ -4079,8 +4109,8 @@
 \def\jlreq@pagestyle@make@headingmark@@#1#2#3#4#5{%
   % \jlreq@tempbに\***markの定義を入れる
   \edef\jlreq@tempb{%
-    \expandonce{\csname the#1\endcsname}%
-    \noexpand\ifx\expandonce{\csname the#1\endcsname}\unexpanded{\@empty\else\protect\quad\fi}%
+    \exp_not:c {the#1}%
+    \noexpand\ifx\exp_not:c {the#1}\unexpanded{\@empty\else\protect\quad\fi}%
     \unexpanded{##1}%
   }%
   \jlreq@parsekeyval@nokey{%
@@ -4088,9 +4118,9 @@
     \str_if_eq:nnT {##1} {_#1} {\edef\jlreq@tempb{\unexpanded{##2}}}%
   }{#2}%
   \ifx l#5%
-    \expandafter\edef\csname jlreq@leftmark@#4\endcsname{\expandonce{\jlreq@tempb}}%
+    \expandafter\edef\csname jlreq@leftmark@#4\endcsname{\exp_not:o {\jlreq@tempb}}%
   \else
-    \expandafter\edef\csname jlreq@rightmark@#4\endcsname{\expandonce{\jlreq@tempb}}%
+    \expandafter\edef\csname jlreq@rightmark@#4\endcsname{\exp_not:o {\jlreq@tempb}}%
   \fi
   \jlreq@pagestyle@make@headingmark@{#1}{#2}%
 }
@@ -4098,7 +4128,7 @@
 % #2 #3 #4と並んだヘッダを作り#1に入れる．#1，#2，#3はコンロトールシークエンスの名前とする．
 \def\jlreq@pagestyle@setheadfoot#1#2#3#4{%
   \begingroup
-    \edef\jlreq@do{\noexpand\jlreq@pagestyle@setheadfoot@{\unexpanded{#1}}{\csexpandonce{#2}}{\csexpandonce{#3}}{\csexpandonce{#4}}}%
+    \edef\jlreq@do{\noexpand\jlreq@pagestyle@setheadfoot@{\unexpanded{#1}}{\exp_args:Nc \exp_not:o {#2}}{\exp_args:Nc \exp_not:o {#3}}{\exp_args:Nc \exp_not:o {#4}}}%
   \expandafter\endgroup
   \jlreq@do
 }
@@ -4114,13 +4144,13 @@
     % +\topskip - \Chtは\jlreq@headfoot@sidemargin = 0ptの時に本文の右に一致させるための補正．
     \jlreq@ifempty{#4}{\def\jlreq@right{}}{\edef\jlreq@right{\unexpanded{#4}\jlreq@pagestyle@hskip{\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate + \topskip - \Cht\fi}}}%
     \jlreq@ifempty{#3}{%
-      \edef\jlreq@do{\unexpanded{\def#1}{\expandonce{\jlreq@left}\hfil\expandonce{\jlreq@right}}}%
+      \edef\jlreq@do{\unexpanded{\def#1}{\exp_not:o {\jlreq@left}\hfil\exp_not:o {\jlreq@right}}}%
       \jlreq@ifempty{#2}{\jlreq@ifempty{#4}{\def\jlreq@do{\def#1{}}}{}}{}%
     }{% #3を完全に真ん中に配置するために左右の幅を0にしておく
-      \ifx\jlreq@left\@empty\else\edef\jlreq@left{\noexpand\hbox to 0pt{\expandonce{\jlreq@left}\noexpand\hss}}\fi
-      \ifx\jlreq@right\@empty\else\edef\jlreq@right{\noexpand\hbox to 0pt{\noexpand\hss\expandonce{\jlreq@right}}}\fi
+      \ifx\jlreq@left\@empty\else\edef\jlreq@left{\noexpand\hbox to 0pt{\exp_not:o {\jlreq@left}\noexpand\hss}}\fi
+      \ifx\jlreq@right\@empty\else\edef\jlreq@right{\noexpand\hbox to 0pt{\noexpand\hss\exp_not:o {\jlreq@right}}}\fi
       \edef\jlreq@do{%
-        \unexpanded{\def#1}{\expandonce{\jlreq@left}\hfil\unexpanded{#3}\hfil\expandonce{\jlreq@right}}%
+        \unexpanded{\def#1}{\exp_not:o {\jlreq@left}\hfil\unexpanded{#3}\hfil\exp_not:o {\jlreq@right}}%
       }%
     }%
   \expandafter\endgroup
@@ -4142,7 +4172,7 @@
   \ifx#1\@empty\else
     \edef#1{%
       \jlreq@ifempty{#2}{}{\unexpanded{\hskip-\dimexpr #2\relax}}%
-      \expandonce{#1}%
+      \exp_not:o {#1}%
       \jlreq@ifempty{#3}{}{\unexpanded{\hskip-\dimexpr #3\relax}}%
     }%
   \fi
@@ -4150,7 +4180,7 @@
 
 % #1が空かつ#4が空でないならば#2に#3と#4の中身を追加し，#4を空にする．引数は全てコントロールシークエンス
 \def\jlreq@pagestyle@addifempty#1#2#3#4{%
-  \ifx#1\@empty\ifx#4\@empty\else\eappto#2{\expandonce{#3}\expandonce{#4}}\def#4{}\fi\fi
+  \ifx#1\@empty\ifx#4\@empty\else\tl_put_right:Nx #2{ \exp_not:o {#3}\exp_not:o {#4} }\def#4{}\fi\fi
 }
 
 \newif\ifjlreq@PageStyle@first
@@ -4161,23 +4191,23 @@
   \jlreq@if{\expandafter\ifx\csname #1\endcsname\@empty\fi}{}{%
     \edef\jlreq@do{%
       \noexpand\jlreq@tempatrue % 最初の処理かフラグ
-      \unexpanded{\jlreq@pagestyle@make@runninghead@{#1}{#2}{#3}}\csexpandonce{#1}\noexpand\jlreq@endmark
+      \unexpanded{\jlreq@pagestyle@make@runninghead@{#1}{#2}{#3}}\exp_args:Nc \exp_not:o {#1}\noexpand\jlreq@endmark
     }%
     \expandafter\def\csname #1\endcsname{}%
     \jlreq@do
     % 項目が二つ以上あった．
-    \ifjlreq@tempa\else\cspreto{#1}{\jlreq@PageStyle@firsttrue}\fi
+    \ifjlreq@tempa\else\tl_put_left:cn {#1} {\jlreq@PageStyle@firsttrue} \fi
   }%
 }
 \def\jlreq@pagestyle@make@runninghead@#1#2#3#4#5{%
   \jlreq@if{\ifnum\numexpr\jlreq@ifendmark{#5}{1}{0}*\ifjlreq@tempa 1\else 0\fi\relax=1~\fi}{%
     % 項目が一つしか無い
-    \jlreq@ifempty{#2}{\csappto}{\cspreto}{#1}{#4}%
+    \jlreq@ifempty{#2}{\tl_put_right:cn}{\tl_put_left:cn}{#1}{#4}%
   }{%
     % 最初の空でない柱に出会うまでは柱の間の空白を入れない．
     % 空でない柱に出会ってないならば\ifjlreq@PageStyle@firstはtrue．
     % 一番最初の\jlreq@PageStyle@firsttrueは後で入れる．
-    \jlreq@ifempty{#2}{\csappto}{\cspreto}{#1}{%
+    \jlreq@ifempty{#2}{\tl_put_right:cn}{\tl_put_left:cn}{#1}{%
       \protected@edef\jlreq@tempa{#4}%
       \ifx\jlreq@tempa\@empty\else
         \ifjlreq@PageStyle@first\else\hskip\glueexpr#3\relax\fi
@@ -4194,8 +4224,8 @@
 \def\jlreq@pagestyle@applyformat#1#2#3{%
   % デフォルト時に限り，\hbox to ***{空トークン}を避ける
   \ifnum 0\ifx#1\@empty\else 1\fi\ifx#2\relax\else 1\fi>0
-    \edef\jlreq@do{\unexpanded{\def\jlreq@tempa##1}{\ifx#2\relax\expandonce{#3}\else\expandonce{#2}\fi}}\jlreq@do
-    \edef#1{\expandafter\expandonce\expandafter{\expandafter\jlreq@tempa\expandafter{#1}}}%
+    \edef\jlreq@do{\unexpanded{\def\jlreq@tempa##1}{\ifx#2\relax\exp_not:o {#3}\else\exp_not:o {#2}\fi}}\jlreq@do
+    \edef#1{\expandafter\exp_not:o \expandafter{\expandafter\jlreq@tempa\expandafter{#1}}}%
   \fi
 }
 
@@ -4203,20 +4233,20 @@
 \def\jlreq@pagestyle@addfont@tocs#1#2{%
   \expandafter\ifx\csname #1\endcsname\@empty\else
     \expandafter\ifx\csname #2\endcsname\@empty\else
-      \expandafter\edef\csname #1\endcsname{{\csexpandonce{#2}\csexpandonce{#1}}}%
+      \expandafter\edef\csname #1\endcsname{{\exp_args:Nc \exp_not:o {#2}\exp_args:Nc \exp_not:o {#1}}}%
     \fi
   \fi
 }
 % こちらは#1にトークン列を与える．\edefで展開される．制御綴名#3に代入．
 \def\jlreq@pagestyle@addfont@totokens#1#2#3{%
   \begingroup
-    \edef\jlreq@do{\noexpand\edef\expandonce{\csname#3\endcsname}{\unexpanded{#1}}}%
+    \edef\jlreq@do{\noexpand\edef\exp_not:c {#3}{\unexpanded{#1}}}%
     \expandafter\ifx\csname #2\endcsname\@empty\else
       \edef\jlreq@tempa{#1}%
       \ifx\jlreq@tempa\@empty\else
         \edef\jlreq@do{%
-          \noexpand\edef\expandonce{\csname #3\endcsname}{\noexpand\unexpanded{%
-            {\csexpandonce{#2}\expandonce{\jlreq@tempa}}%
+          \noexpand\edef\exp_not:c {#3}{\noexpand\unexpanded{%
+            {\exp_args:Nc \exp_not:o {#2}\exp_not:o {\jlreq@tempa}}%
           }}%
         }%
       \fi
@@ -4317,7 +4347,7 @@
     \clist_map_variable:nNn { odd, even } \jlreq@parity {
       \clist_map_variable:nNn { 0, 1, 2 } \jlreq@i {
         % \jlreq@pagestyle@setmarkが上の処理を行う．
-        \edef\jlreq@next{\noexpand\jlreq@pagestyle@setmark{\expandonce{\csname jlreq@\jlreq@parity @running@head@\@roman\numexpr\jlreq@i + 1\relax\endcsname}}{\expandonce{\jlreq@i}}{\expandonce{\jlreq@parity}}{jlreq@markdata}{\noexpand\jlreq@headingmarklist}}%
+        \edef\jlreq@next{\noexpand\jlreq@pagestyle@setmark{\exp_not:c {jlreq@\jlreq@parity @running@head@\@roman\numexpr\jlreq@i + 1\relax}}{\exp_not:o {\jlreq@i}}{\exp_not:o {\jlreq@parity}}{jlreq@markdata}{\noexpand\jlreq@headingmarklist}}%
         \jlreq@next
       }%
     }%
@@ -4332,13 +4362,13 @@
           \else\ifnum\jlreq@minimumlevel>\jlreq@level\space\let\jlreq@minimumlevel=\jlreq@level\fi\fi
         \fi
         % \jlreq@markdata@<見出し命令>にある情報とmark_formatをもとに，\<見出し命令>markを定義するマクロを作成，\jlreq@markdefinecommandに入れる．
-        \edef\jlreq@do{\noexpand\jlreq@pagestyle@make@headingmark{\ifjlreq@headii@exist *\fi}{\expandonce{\jlreq@heading}}{\expandonce{\jlreq@mark@format}}{\csexpandonce{jlreq@markdata@\jlreq@heading}}}%
+        \edef\jlreq@do{\noexpand\jlreq@pagestyle@make@headingmark{\ifjlreq@headii@exist *\fi}{\exp_not:o {\jlreq@heading}}{\exp_not:o {\jlreq@mark@format}}{\exp_args:Nc \exp_not:o {jlreq@markdata@\jlreq@heading}}}%
         \jlreq@do
-        \eappto\jlreq@markdefinecommand{\expandonce{\jlreq@result}}%
+        \tl_put_right:Nx \jlreq@markdefinecommand { \exp_not:o {\jlreq@result} }%
       \fi
     }%
     \ifx\jlreq@minimumlevel\@undefined\else
-      \eappto\jlreq@markdefinecommand{\noexpand\jlreq@pagestyle@setclearmark{\expandonce{\jlreq@minimumlevel}}}%
+      \tl_put_right:Nx \jlreq@markdefinecommand { \exp_not:N \jlreq@pagestyle@setclearmark { \exp_not:o {\jlreq@minimumlevel} } }
     \fi
     % 見出しを出す場合：evenに章などの高いレベルの見出しを出す（2.6.3.a）
     \@ifundefined{jlreq@odd@running@head@i@heading@level}{}{\@ifundefined{jlreq@even@running@head@i@heading@level}{}{%
@@ -4359,10 +4389,10 @@
       \def\jlreq@oddfoot{}\def\jlreq@evenfoot{}%
       \ifx\jlreq@nombre@i@position\@empty\def\jlreq@nombre@i@position{5\jlreq@zw}\fi
       \ifx\jlreq@running@head@i@position\@empty\def\jlreq@running@head@i@position{4\jlreq@zw}\fi
-      \edef\jlreq@gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq@nombre@gap}\noexpand\relax}%
+      \edef\jlreq@gapcs{\noexpand\hskip\noexpand\glueexpr\exp_not:o {\jlreq@nombre@gap}\noexpand\relax}%
       \jlreq@pagestyle@addifempty{\jlreq@nombre@iii@position}{\jlreq@nombre@ii}{\jlreq@gapcs}{\jlreq@nombre@iii}%
       \jlreq@pagestyle@addifempty{\jlreq@nombre@ii@position}{\jlreq@nombre@i}{\jlreq@gapcs}{\jlreq@nombre@ii}%
-      \edef\jlreq@gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq@running@head@gap}\noexpand\relax}%
+      \edef\jlreq@gapcs{\noexpand\hskip\noexpand\glueexpr\exp_not:o {\jlreq@running@head@gap}\noexpand\relax}%
       \jlreq@pagestyle@addifempty{\jlreq@running@head@iii@position}{\jlreq@odd@running@head@ii}{\jlreq@gapcs}{\jlreq@odd@running@head@iii}%
       \jlreq@pagestyle@addifempty{\jlreq@running@head@ii@position}{\jlreq@odd@running@head@i}{\jlreq@gapcs}{\jlreq@odd@running@head@ii}%
       \jlreq@pagestyle@addifempty{\jlreq@running@head@iii@position}{\jlreq@even@running@head@ii}{\jlreq@gapcs}{\jlreq@even@running@head@iii}%
@@ -4374,10 +4404,10 @@
           \jlreq@ifgluezero{\glueexpr\jlreq@position\relax}{\def\jlreq@position{}}{}%
           \expandafter\let\expandafter\jlreq@tempa\expandafter=\csname jlreq@nombre@\jlreq@i\endcsname
           \jlreq@pagestyle@addfont@tocs{jlreq@tempa}{jlreq@nombre@font}%
-          \eappto\jlreq@nombre@contents{%
-            \noexpand\hbox to 0pt{\noexpand\hss
-              \expandonce{\jlreq@tempa}%
-              \ifx\jlreq@position\@empty\else\unexpanded{\hskip \glueexpr}\expandonce{\jlreq@position}\noexpand\relax\fi
+          \tl_put_right:Nx \jlreq@nombre@contents {%
+            \exp_not:N \hbox to 0pt{\exp_not:N \hss
+              \exp_not:o {\jlreq@tempa}%
+              \ifx\jlreq@position\@empty\else\exp_not:n {\hskip \glueexpr}\exp_not:o {\jlreq@position}\exp_not:N \relax\fi
             }%
           }%
         \fi
@@ -4391,12 +4421,12 @@
             \jlreq@ifgluezero{\glueexpr\jlreq@position\relax}{\def\jlreq@position{}}{}%
             \expandafter\let\expandafter\jlreq@tempa\expandafter=\csname jlreq@\jlreq@parity @running@head@\jlreq@i\endcsname
             \jlreq@pagestyle@addfont@tocs{jlreq@tempa}{jlreq@running@head@font}%
-            \expandafter\eappto\csname jlreq@\jlreq@parity @contents\endcsname{%
-              \noexpand\hbox to 0pt{\unexpanded{\hskip\glueexpr\headsep + \headheight}%
-                \if@tate\else\unexpanded{+ \topskip - \Cht}\fi
-                \ifx\jlreq@position\@empty\else + \expandonce{\jlreq@position}\fi\noexpand\relax
-                \expandonce{\jlreq@tempa}%
-                \noexpand\hss
+            \tl_put_right:cx {jlreq@\jlreq@parity @contents} {%
+              \exp_not:N \hbox to 0pt{\exp_not:n {\hskip\glueexpr\headsep + \headheight}%
+                \if@tate\else\exp_not:n {+ \topskip - \Cht}\fi
+                \ifx\jlreq@position\@empty\else + \exp_not:o {\jlreq@position}\fi\exp_not:N \relax
+                \exp_not:o {\jlreq@tempa}%
+                \exp_not:N \hss
               }%
             }%
           \fi
@@ -4406,17 +4436,17 @@
         \@ifundefined{jlreq@\jlreq@parity headformat}
           {\def\jlreq@format{####1}}%
           {\expandafter\let\expandafter\jlreq@format\csname jlreq@\jlreq@parity headformat\endcsname}%
-        \edef\jlreq@do{\unexpanded{\def\jlreq@tempa##1}{\expandonce{\jlreq@format}}}\jlreq@do
+        \edef\jlreq@do{\unexpanded{\def\jlreq@tempa##1}{\exp_not:o {\jlreq@format}}}\jlreq@do
         \edef\jlreq@tempb{%
-          \csexpandonce{jlreq@\jlreq@parity @contents}%
+          \exp_args:Nc \exp_not:o {jlreq@\jlreq@parity @contents}%
           \noexpand\hfil
-          \expandonce{\jlreq@nombre@contents}%
+          \exp_not:o {\jlreq@nombre@contents}%
         }%
         \expandafter\edef\csname jlreq@\jlreq@parity head\endcsname{%
           \unexpanded{\setbox\jlreq@tempboxa=\hbox to \dimexpr\headsep + \headheight + \textheight}\if@tate\else\unexpanded{- \topskip + 1\jlreq@zh}\fi\noexpand\relax
           {%
             \unexpanded{\tate\adjustbaseline}%
-            \expandafter\expandonce\expandafter{\expandafter\jlreq@tempa\expandafter{\jlreq@tempb}}%
+            \expandafter\exp_not:o \expandafter{\expandafter\jlreq@tempa\expandafter{\jlreq@tempb}}%
           }%
           % Underful対策
           \ifx l\jlreq@engine
@@ -4436,11 +4466,11 @@
         \unexpanded{\box\jlreq@tempboxa\hss}%
       }%
       \if@tate
-        \eappto\jlreq@oddhead{\expandonce{\jlreq@lefthead@adjustbox}}%
-        \eappto\jlreq@evenhead{\expandonce{\jlreq@righthead@adjustbox}}%
+        \tl_put_right:Nx \jlreq@oddhead{\exp_not:o {\jlreq@lefthead@adjustbox}}%
+        \tl_put_right:Nx \jlreq@evenhead{\exp_not:o {\jlreq@righthead@adjustbox}}%
       \else
-        \eappto\jlreq@oddhead{\expandonce{\jlreq@righthead@adjustbox}}%
-        \eappto\jlreq@evenhead{\expandonce{\jlreq@lefthead@adjustbox}}%
+        \tl_put_right:Nx \jlreq@oddhead{\exp_not:o {\jlreq@righthead@adjustbox}}%
+        \tl_put_right:Nx \jlreq@evenhead{\exp_not:o {\jlreq@lefthead@adjustbox}}%
       \fi
     }{% yoko
       % 場所を正規化する．
@@ -4458,7 +4488,7 @@
       \clist_map_variable:nNn {
         jlreq@nombre@i@position, jlreq@nombre@ii@position, jlreq@nombre@iii@position, jlreq@running@head@i@position, jlreq@running@head@ii@position, jlreq@running@head@iii@position
       } \jlreq@tempa {
-        \edef\jlreq@next{\noexpand\jlreq@pagestyle@parse@position{\csexpandonce{\jlreq@tempa}}{\expandonce{\csname\jlreq@tempa\endcsname}}{\csexpandonce{\jlreq@tempa @default}}}%
+        \edef\jlreq@next{\noexpand\jlreq@pagestyle@parse@position{\exp_args:Nc \exp_not:o {\jlreq@tempa}}{\exp_not:c {\jlreq@tempa}}{\exp_args:Nc \exp_not:o {\jlreq@tempa @default}}}%
         \jlreq@next
       }%
       \bool_if:nT { (
@@ -4506,10 +4536,10 @@
             \edef\jlreq@vert{\expandafter\@firstoftwo\jlreq@position}%
             \edef\jlreq@hor{\expandafter\@secondoftwo\jlreq@position}%
             \str_if_eq:VnT \jlreq@parity { even } {\jlreq@reverse@leftright{\jlreq@hor}}
-            \jlreq@ifleftpage{\jlreq@parity}{\let\jlreq@addtocs=\cseappto}{\let\jlreq@addtocs\csepreto}%
+            \jlreq@ifleftpage{\jlreq@parity}{\let\jlreq@addtocs=\tl_put_right:cx}{\let\jlreq@addtocs\tl_put_left:cx}%
             \edef\jlreq@csname{jlreq@nombre@\jlreq@parity @\jlreq@vert @\jlreq@hor}%
-            \expandafter\ifx\csname\jlreq@csname\endcsname\@empty\else\jlreq@addtocs{\jlreq@csname}{\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@nombre@gap}\noexpand\relax}\fi
-            \jlreq@addtocs{\jlreq@csname}{\csexpandonce{jlreq@nombre@\jlreq@i}}%
+            \expandafter\ifx\csname\jlreq@csname\endcsname\@empty\else\jlreq@addtocs{\jlreq@csname}{\unexpanded{\hskip\glueexpr}\exp_not:o {\jlreq@nombre@gap}\noexpand\relax}\fi
+            \jlreq@addtocs{\jlreq@csname}{\exp_args:Nc \exp_not:o {jlreq@nombre@\jlreq@i}}%
           \fi
           % running@head
           % 一度「紙面の外から」の順番で{A}{B}{C}と入れる
@@ -4518,16 +4548,16 @@
             \edef\jlreq@vert{\expandafter\@firstoftwo\jlreq@position}%
             \edef\jlreq@hor{\expandafter\@secondoftwo\jlreq@position}%
             \str_if_eq:VnT \jlreq@parity { even } {\jlreq@reverse@leftright{\jlreq@hor}}
-            \str_if_eq:VVTF \jlreq@hor \jlreq@pagehor {\let\jlreq@addtocs=\cseappto}{\let\jlreq@addtocs=\csepreto}%
+            \str_if_eq:VVTF \jlreq@hor \jlreq@pagehor {\let\jlreq@addtocs=\tl_put_right:cx}{\let\jlreq@addtocs=\tl_put_left:cx}%
             \edef\jlreq@csname{jlreq@running@head@\jlreq@parity @\jlreq@vert @\jlreq@hor}%
-            \jlreq@addtocs{\jlreq@csname}{{\csexpandonce{jlreq@\jlreq@parity @running@head@\jlreq@i}}}%
+            \jlreq@addtocs{\jlreq@csname}{{\exp_args:Nc \exp_not:o {jlreq@\jlreq@parity @running@head@\jlreq@i}}}%
           \fi
         }%
         % {A}{B}{C}の順だった柱を結合する．本体は\jlreq@pagestyle@make@runninghead．
         \clist_map_variable:nNn { top, bottom } \jlreq@vert {
           \clist_map_variable:nNn { left, center, right } \jlreq@hor {
             \str_if_eq:VnTF \jlreq@hor { right } { \def\jlreq@tempa{*} } { \def\jlreq@tempa{} }
-            \edef\jlreq@do{\noexpand\jlreq@pagestyle@make@runninghead{jlreq@running@head@\jlreq@parity @\jlreq@vert @\jlreq@hor}{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@running@head@gap}}}%
+            \edef\jlreq@do{\noexpand\jlreq@pagestyle@make@runninghead{jlreq@running@head@\jlreq@parity @\jlreq@vert @\jlreq@hor}{\exp_not:o {\jlreq@tempa}}{\exp_not:o {\jlreq@running@head@gap}}}%
             \jlreq@do
           }%
         }%
@@ -4540,7 +4570,7 @@
             % nombreにフォント設定を追加．
             \expandafter\ifx\csname\jlreq@nombrecsname\endcsname\@empty\else
               \ifx\jlreq@nombre@font\@empty\else
-                \expandafter\edef\csname\jlreq@nombrecsname\endcsname{{\expandonce{\jlreq@nombre@font}\csexpandonce{\jlreq@nombrecsname}}}%
+                \expandafter\edef\csname\jlreq@nombrecsname\endcsname{{\exp_not:o {\jlreq@nombre@font}\exp_args:Nc \exp_not:o {\jlreq@nombrecsname}}}%
               \fi
             \fi
             \jlreq@if{\expandafter\ifx\csname\jlreq@runheadcsname\endcsname\@empty\fi}{%
@@ -4557,32 +4587,32 @@
                   \str_if_eq:VnTF \jlreq@hor { right } {
                     % <ノンブル><空き><柱>，右寄せ
                     % 柱が空出ないときに限り<空き>を入れる．
-                    \jlreq@pagestyle@addfont@totokens{\exp_not:N \dim_compare:nF { \exp_not:n { \wd\jlreq@PageStyle@box=0pt } } { \exp_not:N \hskip\expandonce{\jlreq@gap}\exp_no:N \relax } }{jlreq@running@head@font}{jlreq@tempa}%
+                    \jlreq@pagestyle@addfont@totokens{\exp_not:N \dim_compare:nF { \exp_not:n { \wd\jlreq@PageStyle@box=0pt } } { \exp_not:N \hskip\exp_not:o {\jlreq@gap}\exp_not:N \relax } }{jlreq@running@head@font}{jlreq@tempa}%
                     \expandafter\edef\csname\jlreq@csname\endcsname{%
-                      \unexpanded{\setbox\jlreq@PageStyle@box=\hbox}{\expandonce{\jlreq@running@head@font}\csexpandonce{\jlreq@runheadcsname}}%
-                      \csexpandonce{\jlreq@nombrecsname}\expandonce{\jlreq@tempa}\unexpanded{\box\jlreq@PageStyle@box}%
+                      \unexpanded{\setbox\jlreq@PageStyle@box=\hbox}{\exp_not:o {\jlreq@running@head@font}\exp_args:Nc \exp_not:o {\jlreq@runheadcsname}}%
+                      \exp_args:Nc \exp_not:o {\jlreq@nombrecsname}\exp_not:o {\jlreq@tempa}\unexpanded{\box\jlreq@PageStyle@box}%
                     }%
                   }{%
                     % <ノンブル><空き><柱>，左寄せ
                     % ノンブルは常に空ではないと仮定する．
-                    \jlreq@pagestyle@addfont@totokens{\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@gap}\noexpand\relax\csexpandonce{\jlreq@runheadcsname}}{jlreq@running@head@font}{jlreq@tempa}%
-                    \expandafter\edef\csname\jlreq@csname\endcsname{\csexpandonce{\jlreq@nombrecsname}\expandonce{\jlreq@tempa}}%
+                    \jlreq@pagestyle@addfont@totokens{\unexpanded{\hskip\glueexpr}\exp_not:o {\jlreq@gap}\noexpand\relax\exp_args:Nc \exp_not:o {\jlreq@runheadcsname}}{jlreq@running@head@font}{jlreq@tempa}%
+                    \expandafter\edef\csname\jlreq@csname\endcsname{\exp_args:Nc \exp_not:o {\jlreq@nombrecsname}\exp_not:o {\jlreq@tempa}}%
                   }%
                 }{%
                   \str_if_eq:VnTF \jlreq@hor { left } {
                     % <柱><空き><ノンブル>，左寄せ
                     \jlreq@pagestyle@addfont@totokens{%
-                      \unexpanded{\setbox\jlreq@PageStyle@box=\hbox}{\csexpandonce{\jlreq@runheadcsname}}%
+                      \unexpanded{\setbox\jlreq@PageStyle@box=\hbox}{\exp_args:Nc \exp_not:o {\jlreq@runheadcsname}}%
                       \unexpanded{\copy\jlreq@PageStyle@box}
                       \exp_not:N \dim_compare:nF { \exp_not:n { \wd\jlreq@PageStyle@box=0pt } } {
                         \exp_not:n { \hskip\glueexpr } \exp_not:o {\jlreq@gap} \exp_not:N \relax
                       }
                     }{jlreq@running@head@font}{jlreq@tempa}%
-                    \expandafter\edef\csname\jlreq@csname\endcsname{\expandonce{\jlreq@tempa}\csexpandonce{\jlreq@nombrecsname}}%
+                    \expandafter\edef\csname\jlreq@csname\endcsname{\exp_not:o {\jlreq@tempa}\exp_args:Nc \exp_not:o {\jlreq@nombrecsname}}%
                   }{%
                     % <柱><空き><ノンブル>，右寄せ
-                    \jlreq@pagestyle@addfont@totokens{\csexpandonce{\jlreq@runheadcsname}\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@gap}\noexpand\relax}{jlreq@running@head@font}{jlreq@tempa}%
-                    \expandafter\edef\csname\jlreq@csname\endcsname{\expandonce{\jlreq@tempa}\csexpandonce{\jlreq@nombrecsname}}%
+                    \jlreq@pagestyle@addfont@totokens{\exp_args:Nc \exp_not:o {\jlreq@runheadcsname}\unexpanded{\hskip\glueexpr}\exp_not:o {\jlreq@gap}\noexpand\relax}{jlreq@running@head@font}{jlreq@tempa}%
+                    \expandafter\edef\csname\jlreq@csname\endcsname{\exp_not:o {\jlreq@tempa}\exp_args:Nc \exp_not:o {\jlreq@nombrecsname}}%
                   }%
                 }%
               }%
@@ -4622,7 +4652,7 @@
       \fi
     }%
     \edef\jlreq@do{%
-      \noexpand\edef\expandonce{\csname ps@#1\endcsname}{%
+      \noexpand\edef\exp_not:c {ps@#1}{%
         \noexpand\unexpanded{%
           \unexpanded{\def\jlreq@current@pagestyle{#1}}%
           \ifjlreq@clearmarkcommand\unexpanded{\jlreq@heading@execmacro@toallheadings\jlreq@clearheadingmarks}\fi
@@ -4631,12 +4661,12 @@
           \else
             \unexpanded{\let\@mkboth=\markboth}%
           \fi
-          \unexpanded{\def\@oddhead}{\expandonce{\jlreq@oddhead}}%
-          \unexpanded{\def\@oddfoot}{\expandonce{\jlreq@oddfoot}}%
-          \unexpanded{\def\@evenhead}{\expandonce{\jlreq@evenhead}}%
-          \unexpanded{\def\@evenfoot}{\expandonce{\jlreq@evenfoot}}%
-          \expandonce{\jlreq@markdefinecommand}%
-          \expandonce{\jlreq@command}%
+          \unexpanded{\def\@oddhead}{\exp_not:o {\jlreq@oddhead}}%
+          \unexpanded{\def\@oddfoot}{\exp_not:o {\jlreq@oddfoot}}%
+          \unexpanded{\def\@evenhead}{\exp_not:o {\jlreq@evenhead}}%
+          \unexpanded{\def\@evenfoot}{\exp_not:o {\jlreq@evenfoot}}%
+          \exp_not:o {\jlreq@markdefinecommand}%
+          \exp_not:o {\jlreq@command}%
         }%
       }%
     }%
@@ -4672,7 +4702,7 @@
   \begingroup
     \@ifundefined{jlreq@pagestyle@setting@#1}{\ClassError{jlreq}{Unknown~pagestyle:~#1}{\@ehc}}{}%
     \expandafter\let\expandafter\setting\expandafter=\csname jlreq@pagestyle@setting@#1\endcsname
-    \edef\jlreq@do{\noexpand\RenewPageStyle{#1}{\expandonce{\setting},\unexpanded{#2}}}%
+    \edef\jlreq@do{\noexpand\RenewPageStyle{#1}{\exp_not:o {\setting},\unexpanded{#2}}}%
   \expandafter\endgroup
   \jlreq@do
 }
@@ -4697,19 +4727,19 @@
     \def\jlreq@do{}%
     \jlreq@parsekeyval@nokey{%
       \ifjlreq@parsekeyval@nokey@novalue{%
-        \epreto\jlreq@do{%
-          \noexpand\edef\expandonce{\csname #2\endcsname}{\unexpanded{\unexpanded{##1}}}
-          \noexpand\def\expandonce{\csname #1\endcsname}{}%
+        \tl_put_left:Nx \jlreq@do {%
+          \noexpand\edef\exp_not:c {#2}{\unexpanded{\unexpanded{##1}}}
+          \noexpand\def\exp_not:c {#1}{}%
         }%
         \clist_map_variable:cNn {#1} \jlreq@tempa {
-          \epreto\jlreq@do{\noexpand\let\expandonce{\csname #2@\jlreq@tempa\endcsname}\noexpand\@undefined}%
+          \tl_put_left:Nx \jlreq@do {\noexpand\let\exp_not:c {#2@\jlreq@tempa}\noexpand\@undefined}%
         }%
       }{%
-        \eappto\jlreq@do{%
-          \noexpand\edef\expandonce{\csname #2@##1\endcsname}{\unexpanded{\unexpanded{##2}}}%
+        \tl_put_right:Nx \jlreq@do {%
+          \noexpand\edef\exp_not:c {#2@##1}{\unexpanded{\unexpanded{##2}}}%
           \unexpanded{\def\jlreq@tempa{\jlreq@helper@removeelement{##1}}}%
-          \unexpanded{\expandafter\jlreq@tempa\expandafter}{\expandonce{\csname #1\endcsname}}{\expandonce{\csname #1\endcsname}}%
-          \unexpanded{\csappto{#1}{,##1}}%
+          \unexpanded{\expandafter\jlreq@tempa\expandafter}{\exp_not:c {#1}}{\exp_not:c {#1}}%
+          \unexpanded{\tl_put_right:cn {#1}{,##1}}%
         }%
       }%
     }{#3}%
@@ -4720,7 +4750,7 @@
 % #1@#2が定義されていれば\#1@#2の中身に，そうでなければ\#1の中身に展開される．
 % 展開は\unexpandedで抑制される．
 \def\jlreq@jlreqsetup@withenv@nameuse#1#2{%
-  \jlreq@if{\expandafter\ifx\csname #1@#2\endcsname\relax\fi}{\csexpandonce{#1}}{\csexpandonce{#1@#2}}%
+  \jlreq@if{\expandafter\ifx\csname #1@#2\endcsname\relax\fi}{\exp_args:Nc \exp_not:o {#1}}{\exp_args:Nc \exp_not:o {#1@#2}}%
 }
 % 4.3.1 注4
 \newlength\abovecaptionskip
@@ -4743,7 +4773,7 @@
     \edef\jlreq@tempa{{\jlreq@jlreqsetup@withenv@nameuse{jlreq@@makecaption@font@setting}{\jlreq@tempb}\unexpanded{#2}}}%
   \else
     \edef\jlreq@tempa{%
-      {\jlreq@jlreqsetup@withenv@nameuse{jlreq@@makecaption@label@font@setting}{\jlreq@tempb}\expandonce{\jlreq@tempa{#1}}}%
+      {\jlreq@jlreqsetup@withenv@nameuse{jlreq@@makecaption@label@font@setting}{\jlreq@tempb}\exp_not:o {\jlreq@tempa{#1}}}%
       \unexpanded{\hskip\glueexpr}\jlreq@jlreqsetup@withenv@nameuse{jlreq@@makecaption@after@label@space@setting}{\jlreq@tempb}\noexpand\relax
       {\jlreq@jlreqsetup@withenv@nameuse{jlreq@@makecaption@font@setting}{\jlreq@tempb}\unexpanded{#2}}%
     }%
@@ -4796,11 +4826,11 @@
   \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
+        \exp_not:N \let \exp_not:c {jlreq@@makecaption@align@setting@large##1}=\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
+          \exp_not:N \let \exp_not:c {jlreq@@makecaption@align@setting@small##1}=\exp_not:N \@undefined
         }
       }
     }
@@ -4932,7 +4962,7 @@
       % 縦書き時には表組み内でも縦書きにするようにする
       \if@tate
         \let\jlreq@temporary@original@ialign=\ialign
-        \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
+        \tl_put_left:Nn \ialign {\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
       \fi
       \begin{tabular}[t]{c}%
         \@author
@@ -5005,7 +5035,7 @@
     % 縦書き時には表組み内でも縦書きにするようにする
     \if@tate
       \let\jlreq@temporary@original@ialign=\ialign
-      \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
+      \tl_put_left:Nn \ialign {\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
     \fi
     \begin{tabular}[t]{c}%
       \@author
@@ -5140,45 +5170,49 @@
         \clist_map_variable:nNn {i,ii,iii,iv,v,vi} \jlreq@tempa{
           \clist_map_variable:cNn {#1} \jlreq@tempb {
             \ifx\jlreq@tempb\@empty\else
-              \eappto\jlreq@generalset{\noexpand\let\expandonce{\csname #2@\jlreq@tempa @\jlreq@tempb\endcsname}\noexpand\@undefined}%
+              \tl_put_right:Nx \jlreq@generalset {
+                \noexpand\let\exp_not:c{#2@\jlreq@tempa @\jlreq@tempb}\noexpand\@undefined
+              }
             \fi
           }%
-          \eappto\jlreq@generalset{%
-            \noexpand\edef\expandonce{\csname #2@\jlreq@tempa\endcsname}{\unexpanded{\unexpanded{##1}}}%
+          \tl_put_right:Nx \jlreq@generalset {%
+            \exp_not:N \edef\exp_not:c {#2@\jlreq@tempa}{\exp_not:n {\exp_not:n {##1}}}%
           }%
         }%
-        \appto\jlreq@generalset{\expandafter\def\csname #1\endcsname{}}%
+        \tl_put_right:Nn \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} }{
           % i=とかの時，環境に対応するものをクリアし，\#2@##1に値を入れる
           \clist_map_variable:cNn {#1} \jlreq@tempa {
             \ifx\jlreq@tempa\@empty\else
-              \epreto\jlreq@envset{\noexpand\let\expandonce{\csname #2@##1@\jlreq@tempa\endcsname}\noexpand\@undefined}%
+              \tl_put_left:Nx \jlreq@envset{\noexpand\let\exp_not:c {#2@##1@\jlreq@tempa}\noexpand\@undefined}%
             \fi
           }%
-          \eappto\jlreq@envset{\noexpand\edef\expandonce{\csname #2@##1\endcsname}{\unexpanded{\unexpanded{##2}}}}%
+          \tl_put_right:Nx \jlreq@envset{\exp_not:N \edef\exp_not:c{#2@##1}{\exp_not:n {\exp_not:n{##2}}}}%
         }{%
           % そうでないとき，環境．##1 = 環境名
           \jlreq@parsekeyval@nokey{%
             \ifjlreq@parsekeyval@nokey@novalue{%
               % i - viまでに全てセットする．
               \clist_map_variable:nNn {i,ii,iii,iv,v,vi} \jlreq@tempa{
-                \epreto\jlreq@envset{\noexpand\edef\expandonce{\csname #2@\jlreq@tempa @##1\endcsname}{\unexpanded{\unexpanded{####1}}}}%
+                \tl_put_left:Nx \jlreq@envset{\noexpand\edef\exp_not:c {#2@\jlreq@tempa @##1}{\unexpanded{\unexpanded{####1}}}}%
               }%
             }{%
               % ピンポイント代入
-              \eappto\jlreq@envset{\noexpand\edef\expandonce{\csname #2@####1@##1\endcsname}{\unexpanded{\unexpanded{####2}}}}%
+              \tl_put_right:Nx \jlreq@envset {
+                \exp_not:N \edef\exp_not:c {#2@####1@##1}{\exp_not:n {\exp_not:n {####2}}}
+              }%
             }%
           }{##2}%
-          \eappto\jlreq@envset{%
-            \unexpanded{\def\jlreq@tempa{\jlreq@helper@removeelement{##1}}}%
-            \unexpanded{\expandafter\jlreq@tempa\expandafter}{\expandonce{\csname #1\endcsname}}{\expandonce{\csname #1\endcsname}}%
-            \noexpand\appto\expandonce{\csname #1\endcsname}{\unexpanded{,##1}}%
+          \tl_put_right:Nx \jlreq@envset{%
+            \exp_not:n {\def\jlreq@tempa{\jlreq@helper@removeelement{##1}}}%
+            \exp_not:n {\expandafter\jlreq@tempa\expandafter}{\exp_not:c{#1}}{\exp_not:c {#1}}%
+            \exp_not:N \tl_put_right:Nn \exp_not:c {#1}{\exp_not:n {,##1}}%
           }%
         }%
       }%
     }{#3}%
-    \edef\jlreq@do{\expandonce{\jlreq@generalset}\expandonce{\jlreq@levelset}\expandonce{\jlreq@envset}}%
+    \edef\jlreq@do{\exp_not:o {\jlreq@generalset}\exp_not:o {\jlreq@levelset}\exp_not:o {\jlreq@envset}}%
   \expandafter\endgroup
   \jlreq@do
 }
@@ -5215,7 +5249,7 @@
 \keys_define:nn { jlreqsetup } { quote_end_indent .tl_set:N = \jlreq@quote@end@indent }
 \keys_define:nn { jlreqsetup }{
   quote_fontsize .choices:nn = {normalsize,small,footnotesize,scriptsize,tiny,{}}{
-    \jlreq@ifempty{#1}{\def\jlreq@quote@fontsize{}}{\edef\jlreq@quote@fontsize{\expandonce{\csname #1\endcsname}}}
+    \jlreq@ifempty{#1}{\def\jlreq@quote@fontsize{}}{\edef\jlreq@quote@fontsize{\exp_not:c {#1}}}
   }
 }
 \keys_define:nn { jlreqsetup } { quote_beforeafter_space .tl_set:N = \jlreq@quote@beforeafter@space }
@@ -5283,8 +5317,8 @@
 % 表内の行間を0にする（4.4.3.f）
 \jlreq@saveoriginalcs{tabular}
 \jlreq@saveoriginalcs{endtabular}
-\preto\tabular{\begingroup\appto\@arrayparboxrestore{\baselineskip=0pt\lineskip=0pt}}
-\appto\endtabular{\endgroup}
+\tl_put_left:Nn \tabular {\begingroup\tl_put_right:Nn \@arrayparboxrestore{\baselineskip=0pt\lineskip=0pt}}
+\tl_put_right:Nn \endtabular{\endgroup}
 % 4.4.3.e
 \setlength\tabcolsep{.5\zh}
 \setlength\arraycolsep{.5\zw}
@@ -5313,15 +5347,12 @@
 % tarticleから
 \newdimen\@lnumwidth
 \def\numberline#1{\hbox to\@lnumwidth{#1\hfil}}
-\def\addcontentsline#1#2#3{%
-  \protected@write\@auxout{%
-    \let\label\@gobble\let\index\@gobble\let\glossary\@gobble
-    \if@tate
-      \@temptokena{\tatechuyoko{\thepage}}%
-    \else
-      \@temptokena{\thepage}%
-    \fi
-  }{\string\@writefile{#1}{\protect\contentsline{#2}{#3}{\the\@temptokena}}}%
+
+% from latex.ltx
+\legacy_if:nT { @tate } {
+  \def\addcontentsline#1#2#3{%
+    \addtocontents{#1}{\protect\contentsline{#2}{#3}{\tatechuyoko*{\thepage}}{}%
+                       \protected@file@percent}}
 }
 
 \newcount\jlreq@top@contents % トップ見出しを入れる．レベルと同じ値．
@@ -5465,14 +5496,16 @@
     \jlreq@tempafalse % restore
     \jlreq@parsekeyval@nokey{%
       \ifjlreq@parsekeyval@nokey@novalue{\def\jlreq@tempa{##1}}{%
-        \jlreq@switch{##1}{%
+        \str_if_eq:nnT {##1} { restore } {
           {restore}{\csname jlreq@tempa##2\endcsname}%
         }%
       }%
     }{#1}%
-    \eappto\jlreq@theindex@pagestyle{\unexpanded{\let\jlreq@theindex@savedpagestyle}\ifjlreq@tempa\noexpand\jlreq@current@pagestyle\else\noexpand\@undefined\fi}%
+    \tl_put_right:Nx \jlreq@theindex@pagestyle {
+      \exp_not:n {\let\jlreq@theindex@savedpagestyle}\ifjlreq@tempa\exp_not:N \jlreq@current@pagestyle\else\exp_not:N \@undefined\fi
+    }%
     \ifx\jlreq@tempa\@empty\else
-      \eappto\jlreq@theindex@pagestyle{\noexpand\pagestyle{\expandonce{\jlreq@tempa}}}%
+      \tl_put_right:Nx \jlreq@theindex@pagestyle{\exp_not:N \pagestyle{\exp_not:o \jlreq@tempa}}%
     \fi
   }
 }
@@ -5493,19 +5526,18 @@
       \jlreq@parsekeyval@nokey{%
         % 各見出し命令に対する設定を解析
         \ifjlreq@parsekeyval@nokey@novalue{%
-          \eappto\jlreq@headingsettings{\unexpanded{####1}}%
+          \tl_put_right:Nx \jlreq@headingsettings {\exp_not:n {####1}}%
         }{%
           \str_case_e:nnF {####1} {%
             {heading_type}{%
               \lowercase{\def\jlreq@tempa{####2}}%
-              \jlreq@switch{\jlreq@tempa}{
+              \str_case_e:nnF { \jlreq@tempa } {
                 {tobira}{\def\jlreq@declaretype{RenewTobira}}
                 {block}{\def\jlreq@declaretype{RenewBlock}}
                 {runin}{\def\jlreq@declaretype{RenewRunin}}
                 {cutin}{\def\jlreq@declaretype{RenewCutin}}
                 {modify}{\def\jlreq@declaretype{Modify}}
-                {\ClassError{jlreq}{Unknown~heading~type~`####2'}{\@ehc}}
-              }%
+              }{\ClassError{jlreq}{Unknown~heading~type~`####2'}{\@ehc}}
             }
             {heading_level}{\def\jlreq@level{####2}}
           }{%
@@ -5514,35 +5546,35 @@
                 \csname jlreq@tempa####2\endcsname\@gobble
               }{\@firstofone}%
             }%
-            {\eappto\jlreq@headingsettings{\ifx\jlreq@headingsettings\@empty\else ,\fi\unexpanded{####1={####2}}}}%
+            {\tl_put_right:Nx \jlreq@headingsettings{\ifx\jlreq@headingsettings\@empty\else ,\fi\unexpanded{####1={####2}}}}%
           }%
         }%
       }{##2}%
       \jlreq@ifempty{#1}{}{%
         \ifjlreq@tempa
-          \eappto\jlreq@headingscmds{\noexpand\SaveHeading{\unexpanded{##1}}{\expandonce{\csname #2@##1\endcsname}}}%
-          \eappto\jlreq@restoreheadings{\ifx\jlreq@restoreheadings\@empty\else ,\fi\unexpanded{##1}}%
+          \tl_put_right:Nx \jlreq@headingscmds {\exp_not:N \SaveHeading{\exp_not:n {##1}}{\exp_not:c {#2@##1}}}%
+          \tl_put_right:Nx \jlreq@restoreheadings {\ifx\jlreq@restoreheadings\@empty\else ,\fi\exp_not:n {##1}}%
         \fi
       }%
       % \jlreq@declareに\ModifyHeadingか\Renew***Headingを入れる
-      \edef\jlreq@declare{\expandonce{\csname\jlreq@declaretype Heading\endcsname}{##1}}%
+      \edef\jlreq@declare{\exp_not:c {\jlreq@declaretype Heading}{##1}}%
       \str_if_eq:VnF \jlreq@declaretype { Modify } {
         \ifx\jlreq@level\@empty
           % \frontmatter時でのレベルを引用する．
           \edef\jlreq@declare{%
-            \unexpanded{\edef\jlreq@tempa}{\noexpand\unexpanded{\expandonce{\jlreq@declare}}{\noexpand\expandonce{\expandonce{\csname jlreq@heading@level@##1\endcsname}}}}%
+            \unexpanded{\edef\jlreq@tempa}{\noexpand\unexpanded{\exp_not:o {\jlreq@declare}}{\noexpand\exp_not:o {\exp_not:c {jlreq@heading@level@##1}}}}%
             \noexpand\jlreq@tempa
           }%
         \else
-          \eappto\jlreq@declare{{\expandonce{\jlreq@level}}}%
+          \tl_put_right:Nx \jlreq@declare {{\exp_not:o {\jlreq@level}}}%
         \fi
       }{}%
-      \eappto\jlreq@headingscmds{\expandonce{\jlreq@declare}{\expandonce{\jlreq@headingsettings}}}%
+      \tl_put_right:Nx \jlreq@headingscmds {\exp_not:o {\jlreq@declare}{\exp_not:o {\jlreq@headingsettings}}}%
     }{#4}%
     \edef\jlreq@do{%
       \unexpanded{\def#3}{%
-        \expandonce{\jlreq@headingscmds}%
-        \jlreq@ifempty{#1}{}{\unexpanded{\def#1}{\expandonce{\jlreq@restoreheadings}}}%
+        \exp_not:o {\jlreq@headingscmds}%
+        \jlreq@ifempty{#1}{}{\unexpanded{\def#1}{\exp_not:o {\jlreq@restoreheadings}}}%
       }%
     }%
   \expandafter\endgroup
@@ -5552,11 +5584,11 @@
 \def\jlreq@matter@counter@norestore#1#2{%
   \def#1{}%
   \jlreq@parsekeyval@nokey{%
-    \keys_define:nn { __jlreq_keyval } {
-      value .code:n = \appto#1{\setcounter{##1}{####1}},
-      the .code:n = {\eappto#1{\noexpand\def\expandonce{\csname the##1\endcsname}{\unexpanded{####1}}}}
+    \keys_define:nn { __jlreq_keyval_matter_counter_norestore } {
+      value .code:n = { \tl_put_right:Nn #1 { \setcounter{##1}{####1} } },
+      the .code:n = { \tl_put_right:Nx #1 { \exp_not:N \def\exp_not:c {the##1}{\exp_not:n {####1}} } }
     }
-    \keys_set:nn { __jlreq_keyval } {##2}
+    \keys_set:nn { __jlreq_keyval_matter_counter_norestore } {##2}
   }{#2}%
 }
 
@@ -5564,30 +5596,29 @@
   \newif\if@mainmatter
   \@mainmattertrue
   \keys_define:nn { jlreqsetup } {frontmatter_pagebreak .code:n = {%
-    \edef\jlreq@frontmatter@pagebreak{\jlreq@ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
+    \edef\jlreq@frontmatter@pagebreak{\jlreq@ifempty{#1}{}{\exp_not:c {#1}}}%
   }}
   \keys_define:nn { jlreqsetup } {frontmatter_counter .code:n = {%
       \def\jlreq@frontmatter@counter{}%
-      \def\jlreq@tempa{}% 復帰させるカウンタ名リスト
+      \tl_set:Nn \jlreq@frontmatter@counter { \seq_gclear:N \g__jlreq_frontmatter_resetcounter_seq }
       \jlreq@parsekeyval@nokey{%
         \def\jlreq@tempb{}% 中身
         \jlreq@tempatrue % restore
         \keys_define:nn { frontmatter_counter } {
-          value .code:n = {\appto\jlreq@tempb{\setcounter{##1}{####1}}},
-          restore .code:n = {\csname jlreq@tempa####1\endcsname},
-          the .code:n = {\eappto\jlreq@tempb{\noexpand\def\expandonce{\csname the##1\endcsname}{\unexpanded{####1}}}}
+          value .code:n = { \tl_put_right:Nn \jlreq@tempb{\setcounter{##1}{####1}} },
+          restore .code:n = { \csname jlreq@tempa####1\endcsname },
+          the .code:n = { \tl_put_right:Nx \jlreq@tempb { \exp_not:N \def\exp_not:c {the##1}{\exp_not:n {####1}} } }
         }
         \keys_set:nn { frontmatter_counter } {##2}
         \ifjlreq@tempa
-          \epreto\jlreq@tempb{%
-            \noexpand\let\expandonce{\csname jlreq@frontmatter@savedcounter@the@##1\endcsname}\expandonce{\csname the##1\endcsname}%
-            \noexpand\edef\expandonce{\csname jlreq@frontmatter@savedcounter@value@##1\endcsname}{\unexpanded{\the\value{##1}}}%
+          \tl_put_left:Nx \jlreq@tempb {%
+            \noexpand\let\exp_not:c {jlreq@frontmatter@savedcounter@the@##1}\exp_not:c {the##1}%
+            \noexpand\edef\exp_not:c {jlreq@frontmatter@savedcounter@value@##1}{\unexpanded{\the\value{##1}}}%
           }%
-          \eappto\jlreq@tempa{\ifx\jlreq@tempa\@empty\else ,\fi\unexpanded{##1}}%
+          \tl_put_right:Nn \jlreq@frontmatter@counter { \seq_gput_right:Nn \g__jlreq_frontmatter_resetcounter_seq { ##1 } }
         \fi
-        \eappto\jlreq@frontmatter@counter{\expandonce{\jlreq@tempb}}%
+        \tl_put_right:NV \jlreq@frontmatter@counter \jlreq@tempb
       }{#1}%
-      \eappto\jlreq@frontmatter@counter{\unexpanded{\def\jlreq@frontmatter@restorecounters}{\expandonce{\jlreq@tempa}}}%
     }
   }
   \keys_define:nn { jlreqsetup } {frontmatter_heading .code:n = {\jlreq@matter@heading[\jlreq@frontmatter@restoreheadings]{jlreq@frontmatter@savedheading}{\jlreq@frontmatter@heading}{#1}}}
@@ -5597,16 +5628,14 @@
       \jlreq@tempatrue % restore
       \jlreq@parsekeyval@nokey{%
         \ifjlreq@parsekeyval@nokey@novalue{\def\jlreq@tempa{##1}}{%
-          \jlreq@switch{##1}{%
-            {restore}{\csname jlreq@tempa##2\endcsname}%
-          }%
+          \str_if_eq:nnT { ##1 } { restore } { \csname jlreq@tempa##2\endcsname }
         }%
       }{#1}%
       \ifjlreq@tempa
-        \appto\jlreq@frontmatter@pagestyle{\let\jlreq@frontmatter@savedpagestyle\jlreq@current@pagestyle}%
+        \tl_put_right:Nn \jlreq@frontmatter@pagestyle{\let\jlreq@frontmatter@savedpagestyle\jlreq@current@pagestyle}%
       \fi
       \ifx\jlreq@tempa\@empty\else
-        \eappto\jlreq@frontmatter@pagestyle{\noexpand\pagestyle{\expandonce{\jlreq@tempa}}}%
+        \tl_put_right:Nx \jlreq@frontmatter@pagestyle { \exp_not:N \pagestyle{\exp_not:o {\jlreq@tempa}} }%
       \fi
     }
   }
@@ -5616,14 +5645,13 @@
       \def\jlreq@pagination@frontmatterstyle{arabic}%
       \let\jlreq@pagination@mainmatterpagecommand=\pagenumbering
       \clist_map_variable:nNn {#1} \jlreq@tempa {
-        \expandafter\jlreq@helper@trim\expandafter{\jlreq@tempa}{\jlreq@tempa}%
-        \jlreq@switch{\jlreq@tempa}{
+        \tl_set:Nx \jlreq@tempa { \tl_trim_spaces:o \jlreq@tempa }
+        \str_case_e:nnF {\jlreq@tempa}{
           {continuous}{%
             \def\jlreq@pagination@mainmatterpagecommand##1{\gdef\thepage{\csname @##1\endcsname\c@page}}%
           }
           {independent}{\let\jlreq@pagination@mainmatterpagecommand=\pagenumbering}
-          {\edef\jlreq@pagination@frontmatterstyle{\jlreq@tempa}}
-        }%
+        }{\edef\jlreq@pagination@frontmatterstyle{\jlreq@tempa}}
       }%
     }
   }
@@ -5638,11 +5666,11 @@
     \expandafter\gdef\expandafter\thepage\expandafter{\csname @\jlreq@pagination@frontmatterstyle\endcsname\c@page}%
     \jlreq@frontmatter@postcode
   }
-  \def\jlreq@frontmatter@restorecounters{}
+  \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}{}{\expandonce{\csname #1\endcsname}}}%
+    \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}}}}%
@@ -5661,7 +5689,7 @@
     }{%
       \expandafter\pagestyle\expandafter{\jlreq@frontmatter@savedpagestyle}%
     }%
-    \clist_map_variable:NNn \jlreq@frontmatter@restorecounters \jlreq@tempa {
+    \seq_map_variable:NNn \g__jlreq_frontmatter_resetcounter_seq \jlreq@tempa {
       \setcounter{\jlreq@tempa}{\csname jlreq@frontmatter@savedcounter@value@\jlreq@tempa\endcsname}%
       \expandafter\let\csname the\jlreq@tempa\expandafter\endcsname\csname jlreq@frontmatter@savedcounter@the@\jlreq@tempa\endcsname
     }%
@@ -5675,7 +5703,7 @@
     \jlreq@mainmatter@postcode
   }
   \keys_define:nn { jlreqsetup } {backmatter_pagebreak .code:n = {%
-    \edef\jlreq@backmatter@pagebreak{\jlreq@ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
+    \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}}}}%
@@ -5688,14 +5716,13 @@
       \let\jlreq@pagination@backmatterpagecommand=\pagenumbering
       \def\jlreq@pagination@backmatterstyle{arabic}%
       \clist_map_variable:nNn {#1} \jlreq@tempa {
-        \expandafter\jlreq@helper@trim\expandafter{\jlreq@tempa}{\jlreq@tempa}%
-        \jlreq@switch{\jlreq@tempa}{
+        \tl_set:Nx \jlreq@tempa { \tl_trim_spaces:o \jlreq@tempa }
+        \str_case_e:nnF {\jlreq@tempa} {
           {continuous}{%
             \def\jlreq@pagination@backmatterpagecommand##1{\gdef\thepage{\csname @##1\endcsname\c@page}}%
           }
           {independent}{\let\jlreq@pagination@backmatterpagecommand=\pagenumbering}
-          {\edef\jlreq@pagination@backmatterstyle{\jlreq@tempa}}
-        }%
+        } {\edef\jlreq@pagination@backmatterstyle{\jlreq@tempa}}
       }%
     }
   }
@@ -5725,14 +5752,14 @@
 
 %. その他諸々
 %.. 縦中横
-\protected\def\tatechuyoko{\@ifstar
-  {\jlreq@tatechuyoko@i}%
-  {%
+\NewDocumentCommand { \tatechuyoko } { s m } {
+  \IfBooleanTF{#1}{
+    \jlreq@iftdir{\jlreq@tatechuyoko@i{#2}}{#2}
+  }{
     \jlreq@iftdir{}{\ClassError{jlreq}{\string\tatechuyoko\space is~not~allowed~in~yoko~mode}{\@ehc}}%
-    \jlreq@tatechuyoko@ii
-  }%
+    \jlreq@tatechuyoko@i{#2}
+  }
 }
-\def\jlreq@tatechuyoko@i#1{\jlreq@iftdir{\jlreq@tatechuyoko@ii{#1}}{#1}}
 
 \edef\@tempa{%
   \unexpanded{\ifvmode\leavevmode\fi}%
@@ -5745,7 +5772,7 @@
   }\fi
 }
 
-\expandafter\def\expandafter\jlreq@tatechuyoko@ii\expandafter#\expandafter1\expandafter{%
+\expandafter\def\expandafter\jlreq@tatechuyoko@i\expandafter#\expandafter1\expandafter{%
   \@tempa
   % 前のJFM glue
   \ifnum\jlreq@lastnodechar>-1
@@ -5758,9 +5785,9 @@
       \vrule width~0pt~height~\ht\jlreq@tempboxa depth~\dp\jlreq@tempboxa
     \endgroup
     #1}%
-  \futurelet\jlreq@nextchar\jlreq@tatechuyoko@iii
+  \futurelet\jlreq@nextchar\jlreq@tatechuyoko@ii
 }
-\def\jlreq@tatechuyoko@iii{%
+\def\jlreq@tatechuyoko@ii{%
   \begingroup
     \def\jlreq@do{}%
     \jlreq@getfirsttoken@expandmacros{\jlreq@nextchar}{\jlreq@tempa}%
@@ -5884,7 +5911,7 @@
   }
 }
 \cs_set:Nn \__jlreq_warekiyear_aux:nnn {
-  \int_compare:nTF { #1 = #2 } {元年} { \int_eval:n { #1 - #2 + 1 } 年 }
+  \int_compare:nTF { #1 = #2 } {元年} { #3\int_eval:n { #1 - #2 + 1 } 年 }
 }
 \def\today{%
   \if西暦
@@ -5935,7 +5962,7 @@
   \edef\jlreq@do{
     \unexpanded{\def\jlreq@proof[#1]}{%
       \unexpanded{\labelsep=1\jlreq@zw}%
-      \expandonce{\proof[{\reset@font\jlreq@proof@label@font #1\inhibitglue}\nopunct]}%
+      \exp_not:o {\proof[{\reset@font\jlreq@proof@label@font #1\inhibitglue}\nopunct]}%
     }
   }
   \jlreq@do
@@ -6007,6 +6034,7 @@
   \renewcommand{\theparagraph}{\thesubsubsection .\arabic{paragraph}}
   \renewcommand{\thesubparagraph}{\theparagraph .\arabic{subparagraph}}
   \str_if_eq:VnTF \jlreq@article@type { article } {
+\def\X{}
     \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\sffamily\gtfamily\bfseries}},label_format={第\thepart 部},lines=4,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
     \renewcommand{\thesection}{\arabic{section}}
   }{% book, report
@@ -6125,12 +6153,13 @@
 \renewcommand{\p@enumiii}{\theenumi(\theenumii)}
 \renewcommand{\p@enumiv}{\p@enumiii\theenumiii}
 
-\newcommand{\labelitemi}{\hbox to 1\jlreq@zw{\hss\textbullet\hss}}
 %\newcommand{\labelitemi}{•}
 \legacy_if:nTF { @tate } {
+  \newcommand{\labelitemi}{\hbox to 1\jlreq@zw{\hss\tatechuyoko{\textbullet}\hss}}
   \newcommand{\labelitemii}{○}
   \newcommand{\labelitemiii}{＊}
 }{
+  \newcommand{\labelitemi}{\hbox to 1\jlreq@zw{\hss\textbullet\hss}}
   \newcommand{\labelitemii}{\hbox to 1\jlreq@zw{\hss\textendash\hss}}
   \newcommand{\labelitemiii}{\hbox to 1\jlreq@zw{\hss\textasteriskcentered\hss}}
 }
-- 
cgit v1.2.3

