From ce124d96f4bfa21c13a9803a0c4c9eecdf11c130 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sun, 9 Feb 2020 03:01:29 +0000
Subject: CTAN sync 202002090301

---
 language/japanese/jlreq/jlreq.cls | 405 ++++++++++++++++++++++----------------
 1 file changed, 236 insertions(+), 169 deletions(-)

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

diff --git a/language/japanese/jlreq/jlreq.cls b/language/japanese/jlreq/jlreq.cls
index 5935dd28c1..8f1ed6dfb1 100644
--- a/language/japanese/jlreq/jlreq.cls
+++ b/language/japanese/jlreq/jlreq.cls
@@ -5,7 +5,7 @@
 %%
 % (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/)
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2019/09/24 jlreq]
+\ProvidesClass{jlreq}[2020/02/07 jlreq]
 \RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
 \RequirePackage{jlreq-helpers}
 
@@ -63,7 +63,7 @@
 \jlreq@DeclareOption{lualatex}{\let\jlreq@engine=l}
 
 % 文書のタイプ
-\newcommand*\jlreq@article@type{article}
+\newcommand*{\jlreq@article@type}{article}
 \define@choicekey{jlreq.cls}{article_type}{article,report,book}{\renewcommand*{\jlreq@article@type}{#1}}
 \jlreq@DeclareOption{article}{\renewcommand*{\jlreq@article@type}{article}}
 \jlreq@DeclareOption{report}{\renewcommand*{\jlreq@article@type}{report}}
@@ -219,6 +219,10 @@
 % ぶら下げ組みをするか：3.8.2 注1
 \newif\ifjlreq@burasage\jlreq@burasagefalse
 \jlreq@DeclareOption{hanging_punctuation}{\jlreq@burasagetrue}
+% jsarticleと同じkanjiskipを使う
+\newif\ifjlreq@narrow@kanjiskip\jlreq@narrow@kanjiskipfalse
+\jlreq@DeclareOption{narrow_kanjiskip}{\jlreq@narrow@kanjiskiptrue}
+\jlreq@aftercls@addtodeleteif{\ifjlreq@narrow@kanjiskip}
 
 %.. 注
 % 傍注のタイプ
@@ -326,11 +330,22 @@
 \ifx\jlreq@engine\@undefined
   \jlreq@helper@guessengine
   \let\jlreq@engine=\jlreq@result
+  \message{jlreq guessed engine: 
+    \ifx l\jlreq@engine lualatex\fi
+    \ifx p\jlreq@engine platex\fi
+    \ifx u\jlreq@engine uplatex\fi
+  }%
 \fi
 
-
-% 必要パッケージのロード
+%.. JFMとluatexjaのロード
 \ifx l\jlreq@engine
+  \def\ltj@stdyokojfm{jlreq}
+  \def\ltj@stdtatejfm{jlreqv}
+  \directlua{jlreq = {}}
+  % この値は後でjfm-jlreq内で読む
+  \directlua{jlreq.open_bracket_pos = [[\jlreq@open@bracket@pos]]}
+  \ifjlreq@burasage\directlua{jlreq.burasage = true}\else\directlua{jlreq.burasage = false}\fi
+  % luatexjaのロード
   \ifjlreq@option@enablejfam
     \RequirePackage{luatexja}
   \else
@@ -340,7 +355,17 @@
   \ltjenableadjust[lineend=extended,priority=true]
   \ltjsetparameter{stretch_priority={kanjiskip=0,xkanjiskip=10}}
   \ltjsetparameter{shrink_priority={kanjiskip=0,xkanjiskip=-30}}
-  \directlua{jlreq = {}}
+\else
+  \def\jlreq@jfmname@prefix{}
+  \jlreq@aftercls@addtodeletecs{\jlreq@jfmname@prefix}
+  \ifjlreq@burasage\edef\jlreq@jfmname@prefix{b\jlreq@jfmname@prefix}\fi
+  \ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{\edef\jlreq@jfmname@prefix{\jlreq@jfmname@prefix z}}{}
+  \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}
+  \AtBeginDocument{\PushPostHook{par}{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}}
 \fi
 
 % (u)pLaTeXの場合ここで初めて\epTeXinputencodingが発行されるので，
@@ -351,6 +376,8 @@
   % http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1508&parent=8435
   \if@tate\AtEndPreamble{\par}\fi
 \fi
+\let\jlreq@zw=\zw
+\let\jlreq@zh=\zh
 \if@tate
   \AtBeginDocument{\tate\message{《縦組モード》}\adjustbaseline}
 \fi
@@ -596,15 +623,21 @@
 % ダミー
 \def\@ptsize{0}
 %.. (x)kanjiskip
-\providecommand*{\jlreqkanjiskip}{0pt plus 0.25\zw minus 0pt}
-\providecommand*{\jlreqxkanjiskip}{0.25\zw plus 0.25\zw minus 0.125\zw}
-\ifx l\jlreq@engine
-  \ltjsetparameter{kanjiskip=\jlreqkanjiskip}
-  \ltjsetparameter{xkanjiskip=\jlreqxkanjiskip}
+\ifjlreq@narrow@kanjiskip
+  \providecommand*{\jlreqkanjiskip}{0pt plus .1\jlreq@zw minus .01\jlreq@zw}
 \else
-  \kanjiskip=\jlreqkanjiskip
-  \xkanjiskip=\jlreqxkanjiskip
+  \providecommand*{\jlreqkanjiskip}{0pt plus 0.25\jlreq@zw minus 0pt}
 \fi
+\providecommand*{\jlreqxkanjiskip}{0.25\jlreq@zw plus 0.25\jlreq@zw minus 0.125\jlreq@zw}
+\AtBeginDocument{
+  \jlreq@if{\ifx l\jlreq@engine\fi}{
+    \ltjsetparameter{kanjiskip=\jlreqkanjiskip}
+    \ltjsetparameter{xkanjiskip=\jlreqxkanjiskip}
+  }{
+    \kanjiskip=\jlreqkanjiskip
+    \xkanjiskip=\jlreqxkanjiskip
+  }
+}
 
 % フォントサイズを設定
 \newdimen\jlreq@fontsize
@@ -641,29 +674,10 @@
   \fi
 \fi
 
-%.. JFM
-\ifx l\jlreq@engine
-  \def\ltj@stdyokojfm{jlreq}
-  \def\ltj@stdtatejfm{jlreqv}
-  % この値は後でjfm-jlreq内で読む
-  \directlua{jlreq.open_bracket_pos = [[\jlreq@open@bracket@pos]]}
-  \ifjlreq@burasage\directlua{jlreq.burasage = true}\else\directlua{jlreq.burasage = false}\fi
-\else
-  \def\jlreq@jfmname@prefix{}
-  \jlreq@aftercls@addtodeletecs{\jlreq@jfmname@prefix}
-  \ifjlreq@burasage\edef\jlreq@jfmname@prefix{b\jlreq@jfmname@prefix}\fi
-  \ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{\edef\jlreq@jfmname@prefix{\jlreq@jfmname@prefix z}}{}
-  \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}
-  \AtBeginDocument{\PushPostHook{par}{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}}
-\fi
 
 % 行頭の括弧は \jlreq@open@bracket@before@space \inhibitglue 「みたいにする．
 \ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{
-  \def\jlreq@open@bracket@before@space{\hskip\glueexpr-.5\zw\relax}
+  \def\jlreq@open@bracket@before@space{\hskip\glueexpr-.5\jlreq@zw\relax}
 }{
   \def\jlreq@open@bracket@before@space{}
 }
@@ -760,7 +774,7 @@
   \expandafter\jlreq@do\jlreq@charlist@openingbrackets\jlreq@endmark
   % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる．
   \ifthenelse{\equal{\jlreq@open@bracket@pos}{nibu_tentsuki}}{
-    \edef\jlreq@openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\hskip -.5\zw\inhibitglue}\noexpand\fi}
+    \edef\jlreq@openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\hskip -.5\jlreq@zw\inhibitglue}\noexpand\fi}
   }{% zenkakunibu_nibu,zenkaku_tentsuki
     \edef\jlreq@openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\inhibitglue}\noexpand\fi}
   }
@@ -974,15 +988,10 @@
 \DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal}
 
 % 和文ファミリと欧文ファミリの連動
-\DeclareRobustCommand\rmfamily{%
-  \not@math@alphabet\rmfamily\mathrm
-  \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
-\DeclareRobustCommand\sffamily{%
-  \not@math@alphabet\sffamily\mathsf
-  \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
-\DeclareRobustCommand\ttfamily{%
-  \not@math@alphabet\ttfamily\mathtt
-  \romanfamily\ttdefault\kanjifamily\gtdefault\selectfont}
+\@ifundefined{@rmfamilyhook}{}{\g@addto@macro\@rmfamilyhook{\prepare@family@series@update@kanji{mc}\mcdefault}}
+\@ifundefined{@sffamilyhook}{}{\g@addto@macro\@sffamilyhook{\prepare@family@series@update@kanji{gt}\gtdefault}}
+\@ifundefined{@ttfamilyhook}{}{\g@addto@macro\@ttfamilyhook{\prepare@family@series@update@kanji{gt}\gtdefault}}
+
 
 % 数式フォント設定
 \ifjlreq@option@enablejfam
@@ -1011,7 +1020,7 @@
 \expandafter\jlreq@do\jlreq@charlist@dividingpunctuationmarks\jlreq@endmark
 \edef\@tempa{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 }
 \expandafter\DeclareRobustCommand\expandafter*\expandafter\jlreq@zenkakuspace@main\expandafter{\@tempa
-    \hskip 1\zw\hbox{}%
+    \hskip 1\jlreq@zw\hbox{}%
     \jlreq@lastnodechar=`　
     \expandafter\jlreq@fixjfm
   \else\expandafter　\fi
@@ -1029,9 +1038,9 @@
   \ifcsname jlreq@jaspace@#1\endcsname\csname jlreq@jaspace@#1\endcsname
   \else\ClassError{jlreq}{unknown jaspace: #1}{\@ehc}\fi
 }
-\def\jlreq@jaspace@zenkaku{\hskip\glueexpr 1\zw\relax}
-\def\jlreq@jaspace@nibu{\hskip\glueexpr .5\zw\relax}
-\def\jlreq@jaspace@shibu{\hskip\glueexpr .25\zw\relax}
+\def\jlreq@jaspace@zenkaku{\hskip\glueexpr 1\jlreq@zw\relax}
+\def\jlreq@jaspace@nibu{\hskip\glueexpr .5\jlreq@zw\relax}
+\def\jlreq@jaspace@shibu{\hskip\glueexpr .25\jlreq@zw\relax}
 
 % 区切り約物．\？ みたいな命令を作る．直後の空きが自動で入る．
 % \？*とすると文中の？として扱われる．
@@ -1045,7 +1054,7 @@
   \jlreq@ifendmark{#1}{}{
     \expandafter\DeclareRobustCommand\expandafter*\csname #1\endcsname{%
       \jlreq@ifstar
-        {\hskip .25\zw #1\hskip .25\zw\ignorespaces}%
+        {\hskip .25\jlreq@zw #1\hskip .25\jlreq@zw\ignorespaces}%
         {#1\futurelet\jlreq@nextchar\jlreq@dividingpunctuationmarkscommand}%
     }
     \jlreq@do
@@ -1079,10 +1088,11 @@
 }{}
 
 \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{\ifdim\parindent>0pt \setlength{\parindent}{1\zw}\fi}
+\appto\jlreq@setfontsizehook{\ifdim\parindent>0pt \setlength{\parindent}{1\jlreq@zw}\fi}
 \ifx l\jlreq@engine
   \@tempskipa=\ltjgetparameter{kanjiskip}
   \ifdim\@tempskipa=\maxdimen\else
@@ -1172,12 +1182,12 @@
 \DeclareRobustCommand{\jlreq@rensuji}[1]{%
   \ifvmode\leavevmode\fi
   \jlreq@ifydir{\hbox{#1}}{%
-    \hskip 0pt plus 0.25\zw minus 0pt % \rensujiskipは固定値
+    \hskip 0pt plus 0.25\jlreq@zw minus 0pt % \rensujiskipは固定値
     \setbox\jlreq@tempboxa=\hbox{\yoko#1}%
     \@tempdima=\dimexpr\ht\jlreq@tempboxa+\dp\jlreq@tempboxa\relax
     \vrule\@width\z@ \@height.5\@tempdima \@depth.5\@tempdima
-    \hbox to 1\zw{\yoko\hss#1\hss}%
-    \hskip 0pt plus 0.25\zw minus 0pt
+    \hbox to 1\jlreq@zw{\yoko\hss#1\hss}%
+    \hskip 0pt plus 0.25\jlreq@zw minus 0pt
 }}
 \def\jlreq@Kanji#1{\expandafter\kansuji\csname c@#1\endcsname}
 
@@ -1185,8 +1195,13 @@
 \setlength\lineskip{.1\zh}
 \setlength\normallineskip{.1\zh}
 \renewcommand{\baselinestretch}{}
-\setlength\parskip{0\p@ \@plus \p@}
-\setlength\parindent{1\zw}
+% 行間の伸びは許容しない．
+\setlength{\parskip}{0pt}
+% https://github.com/texjporg/jsclasses/issues/14
+\renewcommand*{\flushbottom}{%
+  \def\@textbottom{\vskip 0pt plus 0.1pt}%
+  \let\@texttop\relax
+}
 \@lowpenalty   51
 \@medpenalty  151
 \@highpenalty 301
@@ -1239,6 +1254,8 @@
 \setlength{\columnseprule}{0pt}
 
 %.. 傍注（4.2.7）
+\newdimen\jlreq@sidenote@length
+\newdimen\jlreq@sidenote@sep
 \begingroup
   \footnotesize
   \setlength{\jlreq@tempdima}{\jlreq@speciallength{\jlreq@option@sidenote@length}}
@@ -1251,15 +1268,19 @@
     \fi
   \fi
   \edef\jlreq@do{
-    \noexpand\setlength{\noexpand\marginparwidth}{\the\jlreq@tempdima}
+    \noexpand\setlength{\noexpand\jlreq@sidenote@length}{\the\jlreq@tempdima}
     \noexpand\setlength{\noexpand\marginparpush}{\the\dimexpr 0.5\zw\relax} % 同上：4.2.7.g
   }
   \expandafter\endgroup
 \jlreq@do
-\ifdim\marginparwidth>0pt
+\ifdim\jlreq@sidenote@length>0pt
+  \setlength{\marginparwidth}{\jlreq@sidenote@length}
   \setlength{\marginparsep}{2\zw} % フォントサイズ×2（4.2.7：特に問題に～e）
+  \setlength{\jlreq@sidenote@sep}{2\zw}
 \else
+  \setlength{\marginparwidth}{0pt}
   \setlength{\marginparsep}{0pt}
+  \setlength{\jlreq@sidenote@sep}{0pt}
 \fi
 
 % 縦書きの時は脚注に固定
@@ -1559,11 +1580,11 @@
         \jlreq@tempdima=\wd\jlreq@tempboxa
       \fi
       % \numexprは四捨五入
-      \jlreq@tempdimb=\dimexpr\the\numexpr\jlreq@tempdima/\dimexpr 1\zw\relax + 2\relax\zw\relax
+      \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}{%
-            \unexpanded{\@dottedtocline{#2}{0\zw}}{\the\jlreq@tempdimb}%
+            \unexpanded{\@dottedtocline{#2}{0pt}}{\the\jlreq@tempdimb}%
           }%
         }%
       }%
@@ -1782,19 +1803,24 @@
   \fi
 }
 
-\def\jlreq@BlockHeading@start@afterheading{\futurelet\jlreq@nextchar\jlreq@BlockHeading@start@afterheading@}
-\edef\jlreq@BlockHeading@start@afterheading@{%
-  \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@BlockHeading@start@afterheading@@}%
-  \unexpanded{\else\expandafter\jlreq@BlockHeading@start@afterheading@@@\fi}%
+\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}%
+  \unexpanded{\else\expandafter\jlreq@BlockHeading@start@afterheading@ii\fi}%
 }
 % スペースを読み飛ばす
-\expandafter\def\expandafter\jlreq@BlockHeading@start@afterheading@@\space{\jlreq@BlockHeading@start@afterheading}
-\def\jlreq@BlockHeading@start@afterheading@@@{%
+\expandafter\def\expandafter\jlreq@BlockHeading@start@afterheading@skipspaces\space{\jlreq@BlockHeading@start@afterheading}
+\def\jlreq@BlockHeading@start@afterheading@ii{%
   \def\jlreq@do{\jlreq@BlockHeading@spaces@output}%
   \@for\@tempa:=\jlreq@BlockHeading@allheadings\do{%
     \expandafter\ifx\csname\@tempa\endcsname\jlreq@nextchar\def\jlreq@do{}\fi
   }%
-  % \jlreq@BlockHeading@HeadingSpaces@ignoretokens内のものは特別扱いする
+  % \jlreq@BlockHeading@HeadingSpaces@ignoretokens(@noargument)内のものは特別扱いする
+  \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq@BlockHeading@HeadingSpaces@ignoretokens@noargument\do{%
+    \expandafter\ifx\@tempa\jlreq@nextchar
+      \def\jlreq@do{\jlreq@BlockHeading@start@afterheading@saveafter@cs@noargument}%
+    \fi
+  }%
   \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq@BlockHeading@HeadingSpaces@ignoretokens\do{%
     \expandafter\ifx\@tempa\jlreq@nextchar
       \def\jlreq@do{\jlreq@BlockHeading@start@afterheading@saveafter@cs}%
@@ -1804,6 +1830,10 @@
 }
 
 % コントロールシークエンスを保存
+\long\def\jlreq@BlockHeading@start@afterheading@saveafter@cs@noargument#1{%
+  \csgappto{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}%
   \jlreq@BlockHeading@start@afterheading@saveafter@option
@@ -1837,6 +1867,7 @@
 
 % 特別扱いしたいマクロを並べる
 \def\jlreq@BlockHeading@HeadingSpaces@ignoretokens{\label}
+\def\jlreq@BlockHeading@HeadingSpaces@ignoretokens@noargument{\par}
 
 % \jlreq@resulta -> before, \jlreq@resultb -> 本体，\jlreq@resultc -> after
 % {1 = 命令}{2 = レベル}{3 = スペース関連（横方向のみ）}{4 = フォーマット群}{5 = まとめたフォーマット群}{6 = *}{7 = running head}{8 = 見出し}{9 = 副題}
@@ -2038,7 +2069,7 @@
         \noexpand\parskip=\the\parskip
         \unexpanded{\def\jlreq@parhook@gyodori{}}%
       }%
-      \unexpanded{\parskip=0pt plus 1pt}%
+      \unexpanded{\parskip=0pt}%
     \fi
   }%
   \expandafter}\jlreq@do
@@ -2108,24 +2139,24 @@
   \begingroup
     \def\jlreq@font{}%
     \def\jlreq@subtitle@font{}%
-    \def\jlreq@indent{0\zw}%
-    \def\jlreq@end@indent{0\zw}%
+    \def\jlreq@indent{0\jlreq@zw}%
+    \def\jlreq@end@indent{0\jlreq@zw}%
     \def\jlreq@align{l}%
     \edef\jlreq@format{\unexpanded{##1##2##3}}%
     \edef\jlreq@heading@text@format{\unexpanded{##1}}%
     \def\jlreq@pagebreak{}%
     \def\jlreq@label@format{\@seccntformat{#1}}%
     \newif\ifjlreq@second@text@indent@withlabel\jlreq@second@text@indent@withlabeltrue
-    \def\jlreq@after@label@space{1\zw}%
+    \def\jlreq@after@label@space{1\jlreq@zw}%
     \def\jlreq@second@heading@text@indent@wlabel{0pt}%
     \def\jlreq@second@heading@text@indent@wolabel{0pt}%
     \edef\jlreq@subtitle@format{\unexpanded{---##1---}}%
     \newif\ifjlreq@subtitleindent@withlabel\jlreq@subtitleindent@withlabeltrue
-    \def\jlreq@subtitle@indent{1\zw}%
+    \def\jlreq@subtitle@indent{1\jlreq@zw}%
     \def\jlreq@afterindent{\@afterindenttrue}%
     \def\jlreq@allowbreak@evenpage{*}% 偶数ページでも改ページを許可するならば空，そうでないなら*
     \newif\ifjlreq@subtitle@break\jlreq@subtitle@breaktrue
-    \def\jlreq@subtitle@indent{1\zw}%
+    \def\jlreq@subtitle@indent{1\jlreq@zw}%
     \def\jlreq@column@spanning{false}%
     \newif\ifjlreq@column@spanning@possible\jlreq@column@spanning@possiblefalse
     \newif\ifjlreq@number \jlreq@numbertrue
@@ -2225,10 +2256,10 @@
     \def\jlreq@do{}% 初期化．これに最終処理を入れていく．
     % 入力チェック
     \ifthenelse{\equal{\jlreq@column@spanning}{true}}{%
-      \ifjlreq@column@spanning@possible\else
+      \jlreq@if{\ifjlreq@column@spanning@possible\else\fi}{
         \ClassWarningNoLine{jlreq}{column_spanning can be used only with `pagebreak=nariyuki' or `pagebreak=clearcolumn' (in BlockHeading #1)}%
         \def\jlreq@column@spanning{false}%
-      \fi
+      }{}%
     }{}%
     % ラベルありフォーマット：前
     \edef\jlreq@pre@format@wlabel{%
@@ -2460,14 +2491,33 @@
     \jlreq@SetBlockHeadingSpaces
   }%
 }
+
+% {}があるのに最初が_で始まっていない場合は蹴る．
+\def\jlreq@SetBlockHeadingSpaces@checkdimension#1{%
+  \jlreq@SetBlockHeadingSpaces@checkdimension@i#1{\jlreq@uniqtoken}\jlreq@endmark
+}
+\def\jlreq@SetBlockHeadingSpaces@checkdimension@i#1#{\jlreq@SetBlockHeadingSpaces@checkdimension@ii{#1}}
+\def\jlreq@SetBlockHeadingSpaces@checkdimension@ii#1#2#3\jlreq@endmark{%
+  \begingroup
+    \def\jlreq@tempa{#2}%
+    \def\jlreq@tempb{\jlreq@uniqtoken}%
+    \ifx\jlreq@tempa\jlreq@tempb\def\jlreq@do{}%
+    \else\def\jlreq@do{%
+      \ClassError{jlreq}{Invalid setting ``\unexpanded{#1{#2}}'' is found, You forgot `_'? (in SetBlockHeadingSpaces)}{\@ehc}%
+    }\fi
+  \expandafter\endgroup
+  \jlreq@do
+}
+
 \def\jlreq@SetBlockHeadingSpaces@iii#1{%
   \@for\@tempa:=#1\do{%
     \expandafter\jlreq@helper@trim\expandafter{\@tempa}{\@tempa}%
     \expandafter\jlreq@iffirsttoken@ignorespaces\expandafter{\@tempa}{_}{%
       \ifx\jlreq@lastdimen\@empty\else\eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}\fi%
       \def\jlreq@lastdimen{}%
-      \expandafter\jlreq@SetBlockHeadingSpaces@iv\@tempa{\jlreq@endmark}%
+      \expandafter\jlreq@SetBlockHeadingSpaces@iv\@tempa{\jlreq@endmark}\jlreq@endmark
     }{%
+      \expandafter\jlreq@SetBlockHeadingSpaces@checkdimension\expandafter{\@tempa}%
       \ifjlreq@tempa
         % 最初が寸法なので，全体の設定（\jlreq@totalset）に組み込む．
         \def\jlreq@do##1##2##3{%
@@ -2496,7 +2546,10 @@
 }
 \def\jlreq@SetBlockHeadingSpaces@v#1{%
   % 空っぽの場合は{_{r:0pt}{r:0pt}{}}
-  \jlreq@ifendmark{#1}{\appto\jlreq@set{{_{r:0pt}{r:0pt}{}}}}{%
+  \jlreq@ifendmark{#1}{%
+    \appto\jlreq@set{{_{r:0pt}{r:0pt}{}}}
+    \@gobble
+  }{%
     \jlreq@iffirsttoken{#1}{*}{% *始まりの場合は{_*{}{}{}}
       \expandafter\jlreq@BlockHeading@gyodori@parsekeyval\expandafter{\@gobble #1}{}{}{}%
       \eappto\jlreq@set{{_*\expandonce{\jlreq@result}}}%
@@ -2504,9 +2557,19 @@
       \jlreq@BlockHeading@gyodori@parsekeyval{#1}{}{}{}%
       \eappto\jlreq@set{{_\expandonce{\jlreq@result}}}%
     }%
-    \@gobble % \jlreq@endmarkを食う
+    \jlreq@SetBlockHeadingSpaces@vi
   }%
 }
+% _節名{設定}の後に何かないかチェック……
+\def\jlreq@SetBlockHeadingSpaces@vi#1\jlreq@endmark{%
+  \jlreq@ifendmark{#1}{}{{%
+    \@temptokena{}%
+    \def\@tempb##1##{\@temptokena\expandafter{\the\@temptokena##1}\@tempc}%
+    \def\@tempc##1{\jlreq@ifendmark{##1}{}{\@temptokena\expandafter{\the\@temptokena{##1}}\@tempb}}%
+    \@tempb#1%
+    \ClassWarningNoLine{jlreq}{Extra setting `\the\@temptokena' is found in SetBlockHeadingSpaces, omitted}
+  }}%
+}
 
 % 現在の情報に基づき出力
 \def\jlreq@BlockHeading@spaces@output{%
@@ -2681,15 +2744,15 @@
   \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewRuninHeading}%
   \@ifundefined{c@#1}{\newcounter{#1}}{}%
   \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
-  \@ifundefined{l@#1}{\expandafter\def\csname l@#1\endcsname{\@dottedtocline{#2}{0\zw}{2\zw}}}{}%
+  \@ifundefined{l@#1}{\expandafter\def\csname l@#1\endcsname{\@dottedtocline{#2}{0\jlreq@zw}{2\jlreq@zw}}}{}%
   \jlreq@heading@make@maketoc{#1}{#2}%
   \begingroup
     \def\jlreq@font{\normalfont\normalsize}%
-    \def\jlreq@indent{0\zw}%
-    \def\jlreq@after@label@space{1\zw}%
+    \def\jlreq@indent{0pt}%
+    \def\jlreq@after@label@space{1\jlreq@zw}%
     \def\jlreq@label@font{}%
     \def\jlreq@label@format{\@seccntformat{#1}}%
-    \def\jlreq@after@space{1\zw}%
+    \def\jlreq@after@space{1\jlreq@zw}%
     \newif\ifjlreq@number \jlreq@numbertrue
     \jlreq@parsekeyval[RuninHeading:#1]{%
       {font}{\def\jlreq@font{##1}}
@@ -2780,7 +2843,7 @@
       \def\jlreq@CutinHeading@linecount{3}%
     \fi
     % 普通の一行の高さ/深さに合わせて見出しのボックスを作る
-    \setbox\@tempboxa=\vtop to \dimexpr\numexpr\jlreq@CutinHeading@linecount - 1\relax\baselineskip + 1\zh\relax{\vskip 0pt plus 1fill minus 1fill \box\jlreq@resultbox\vskip 0pt plus 1fill minus 1fill}%
+    \setbox\@tempboxa=\vtop to \dimexpr\numexpr\jlreq@CutinHeading@linecount - 1\relax\baselineskip + 1\jlreq@zh\relax{\vskip 0pt plus 1fill minus 1fill \box\jlreq@resultbox\vskip 0pt plus 1fill minus 1fill}%
     % 高さを通常の一行のそれにする
     \setbox\jlreq@tempboxa=\hbox{阿}%
     \dp\@tempboxa=\dimexpr\ht\@tempboxa + \dp\@tempboxa - \ht\jlreq@tempboxa\relax
@@ -2824,11 +2887,11 @@
   \expandafter\def\csname jlreq@heading@setting@#1\endcsname{#3}%
   \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewCutinHeading}%
   \begingroup
-    \def\jlreq@fontcommand{\sffamily\bfseries}%
-    \def\jlreq@onelinemax{6\zw}%
-    \def\jlreq@twolinemax{20\zw}%
-    \def\jlreq@indent{0\zw}%
-    \def\jlreq@after@space{1\zw}%
+    \def\jlreq@fontcommand{\sffamily\gtfamily\bfseries}%
+    \def\jlreq@onelinemax{6\jlreq@zw}%
+    \def\jlreq@twolinemax{20\jlreq@zw}%
+    \def\jlreq@indent{0pt}%
+    \def\jlreq@after@space{1\jlreq@zw}%
     \jlreq@parsekeyval[CutinHeading:#1]{
       {font}{\def\jlreq@fontcommand{##1}}
       {onelinemax}{\def\jlreq@onelinemax{##1}}
@@ -2836,7 +2899,7 @@
       {indent}{\def\jlreq@indent{##1}}
       {after_space}{\def\jlreq@after@space{##1}}
     }{#3}%
-    \ifthenelse{\lengthtest{\jlreq@after@space < 0.99\zw} \OR \lengthtest{\jlreq@after@space > 2.01\zw}}{%
+    \ifthenelse{\lengthtest{\jlreq@after@space < 0.99\jlreq@zw} \OR \lengthtest{\jlreq@after@space > 2.01\jlreq@zw}}{%
       \jlreq@note{窓見出しと本文との空き量は，基本版面の文字サイズの全角以上，2倍未満とする (4.1.10.c)．}%
     }{}%
     \edef\jlreq@do{%
@@ -3018,7 +3081,7 @@
       % この罫線は，表罫（おもてけい）とする．
       \unexpanded{\hrule width \jlreq@footnote@rulewidth height \jlreq@omotekeiwidth}%
       % 脚注の行間よりやや広くする（4.2.5.f）
-      \noexpand\kern\the\dimexpr 1.5\dimexpr\baselineskip - 1\zh\relax\relax
+      \noexpand\kern\the\dimexpr 1.5\dimexpr\baselineskip - 1\jlreq@zh\relax\relax
     }
   }
 \expandafter\endgroup
@@ -3033,7 +3096,7 @@
     \footnotesize
     \jlreq@footnoteindent=\dimexpr#1\relax
     \@tempdima=\dimexpr\textwidth - \jlreq@footnoteindent\relax
-    \@tempdimb=1\zw
+    \@tempdimb=1\jlreq@zw
     \divide\@tempdima\@tempdimb \multiply\@tempdima\@tempdimb
     \edef\jlreq@do{\noexpand\jlreq@footnoteindent=\the\dimexpr\textwidth - \@tempdima\relax}%
   \expandafter\endgroup
@@ -3044,8 +3107,8 @@
 \jlreq@jlreqsetup@add{footnote_second_indent}{%
   \if@tate\else
     \ifthenelse{
-      \( \lengthtest{0.99\zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < 1.01\zw} \) \OR 
-      \( \lengthtest{-1.01\zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < -0.99\zw} \)
+      \( \lengthtest{0.99\jlreq@zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < 1.01\jlreq@zw} \) \OR 
+      \( \lengthtest{-1.01\jlreq@zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < -0.99\jlreq@zw} \)
     }{}{\jlreq@note{脚注が2行以上となった場合，脚注の2行目以下の字下げを1行目より，脚注の文字サイズの全角アキとするか，逆に，1行目の字下げを2行目より，脚注の文字サイズの全角アキとする (4.2.5.d)．}}
   \fi
   \ifdim\dimexpr #1\relax<0pt
@@ -3056,11 +3119,11 @@
   \long\edef\jlreq@makefntext##1{\expandonce{\jlreq@makefntext}%
     \unexpanded{%
       \addtolength{\leftskip}{\jlreq@footnoteindent}%
-      \parindent=1\zw
+      \parindent=1\jlreq@zw
       \noindent
       \hskip-\glueexpr #1\relax
       \jlreq@referencemark@format{\@thefnmark}%
-      \hskip\glueexpr 1\zw\relax
+      \hskip\glueexpr 1\jlreq@zw\relax
     }##1%
   }
 }
@@ -3283,7 +3346,7 @@
         \leftmargin=\dimexpr\linewidth - \jlreq@tempdima + \jlreq@endnote@second@indent\relax
         \itemindent=-\glueexpr\jlreq@endnote@second@indent\relax
         \topsep=\jlreq@endnote@beforeafterspace\relax
-        \listparindent=1\zw
+        \listparindent=1\jlreq@zw
       }%
       \expandafter\jlreq@theendnotes\jlreq@tempa\jlreq@endmark
       \end{list}%
@@ -3296,13 +3359,13 @@
 \jlreq@jlreqsetup@add{endnote_second_indent}{
   \def\jlreq@endnote@second@indent{#1}
   \ifthenelse{
-    \( \lengthtest{0.99\zw < #1} \AND \lengthtest{#1 < 1.01\zw} \) \OR 
-    \( \lengthtest{1.99\zw < #1} \AND \lengthtest{#1 < 2.01\zw} \)
+    \( \lengthtest{0.99\jlreq@zw < #1} \AND \lengthtest{#1 < 1.01\jlreq@zw} \) \OR 
+    \( \lengthtest{1.99\jlreq@zw < #1} \AND \lengthtest{#1 < 2.01\jlreq@zw} \)
   }{}{\jlreq@note{後注が2行以上となった場合，後注の2行目以下の字下げは，1行目より，後注の文字サイズの2倍又は全角とする (4.2.4.d)．}}
 }
 \newcommand{\@makeendtext}[1]{%
   \csname\jlreq@endnotemarkname\endcsname
-  \hskip\glueexpr1\zw\relax% 見出し出力と一文字分の空き（4.2.4.c）
+  \hskip\glueexpr1\jlreq@zw\relax% 見出し出力と一文字分の空き（4.2.4.c）
   #1%
 }
 \let\@makeendmark=\@makefnmark
@@ -3366,8 +3429,8 @@
 
 % (1) では\sidenote[]{}を定義
 % (2) では\sidenote{見出し}{注中身}を定義
-% \marginparwidth>0ptの時のみ定義する
-\ifdim\marginparwidth>0pt \expandafter\@firstofone\else\expandafter\@gobble\fi
+% sidenote_length>0ptの時のみ定義する
+\jlreq@if{\ifdim\jlreq@sidenote@length>0pt \fi}
 {
   \def\jlreq@sidenotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
   \long\def\@sidenotetext#1{%
@@ -3416,7 +3479,7 @@
         \long\def\@makesidetext#1{\csname\jlreq@sidenotemarkname\endcsname\hspace{0.5\jlreq@mol}#1}
       \else
         % thefootnote = \inhibitglue （...だと\inhibitglueが効かないので空白を挟む
-        \long\def\@makesidetext#1{　\kern-1\zw\csname\jlreq@sidenotemarkname\endcsname\hspace{0.5\jlreq@mol}#1}
+        \long\def\@makesidetext#1{　\kern-1\jlreq@zw\csname\jlreq@sidenotemarkname\endcsname\hspace{0.5\jlreq@mol}#1}
       \fi
       \let\@makesidemark=\@makefnmark
     }{% sidenote_type = symbol
@@ -3434,10 +3497,10 @@
       }
       % カスタマイズできるべき？
       \long\def\jlreq@sidenotetext#1#2{%
-        \expandafter\def\csname\jlreq@sidenotemarkname\endcsname{\inhibitglue\null{\reset@font\sffamily\bfseries\inhibitglue #1}}%
+        \expandafter\def\csname\jlreq@sidenotemarkname\endcsname{\inhibitglue\null{\reset@font\sffamily\gtfamily\bfseries\inhibitglue #1}}%
         \@sidenotetext{#2}%
       }
-      \long\def\@makesidetext#1{{\sffamily\bfseries\csname\jlreq@sidenotemarkname\endcsname}\hspace*{1\jlreq@mol}#1}
+      \long\def\@makesidetext#1{{\sffamily\gtfamily\bfseries\csname\jlreq@sidenotemarkname\endcsname}\hspace*{1\jlreq@mol}#1}
       \let\@makesidemark=\@makefnmark
 
       \apptocmd{\sidenote}{\jlreq@hook@postnote}{}{}
@@ -3446,7 +3509,7 @@
   }
   \jlreq@jlreqsetup@add{sidenote_symbol}{\def\jlreq@sidenote@defaultmark{#1}}
   \jlreq@jlreqsetup@add{sidenote_keyword_font}{\def\jlreq@sidenote@keywordfont{#1}}
-}
+}{}
 
 %.. 割注（3.4）
 \def\inlinenotesize{.6\jlreq@jafontsize} % 割注の文字サイズ
@@ -3929,13 +3992,13 @@
 
 % #1の左右に傍注調整用の空白を入れて#1に代入する
 \def\jlreq@pagestyle@addsidenotemargin@left#1{%
-  \jlreq@pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{}%
+  \jlreq@pagestyle@addsidenotemargin@{#1}{\jlreq@sidenote@length + \jlreq@sidenote@sep}{}%
 }
 \def\jlreq@pagestyle@addsidenotemargin@right#1{%
-  \jlreq@pagestyle@addsidenotemargin@{#1}{}{\marginparwidth+\marginparsep}%
+  \jlreq@pagestyle@addsidenotemargin@{#1}{}{\jlreq@sidenote@length + \jlreq@sidenote@sep}%
 }
 \def\jlreq@pagestyle@addsidenotemargin@bothside#1{%
-  \jlreq@pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{\marginparwidth+\marginparsep}%
+  \jlreq@pagestyle@addsidenotemargin@{#1}{\jlreq@sidenote@length + \jlreq@sidenote@sep}{\jlreq@sidenote@length + \jlreq@sidenote@sep}%
 }
 % #2: 左，#3：右，#4：#2 + #3
 \def\jlreq@pagestyle@addsidenotemargin@#1#2#3{%
@@ -4046,7 +4109,7 @@
     \let\jlreq@oddfootformat\relax
     \let\jlreq@evenfootformat\relax
     % 柱とノンブルの間
-    \def\jlreq@gap{1.5\zw}%
+    \def\jlreq@gap{1.5\jlreq@zw}%
     \def\jlreq@nombre@gap{}%
     \def\jlreq@running@head@gap{}%
     \newif\ifjlreq@clearmarkcommand\jlreq@clearmarkcommandtrue
@@ -4222,7 +4285,7 @@
           \expandonce{\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\zh}\fi\noexpand\relax
+          \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}}%
@@ -4237,7 +4300,7 @@
       }%
       % \jlreq@tempboxaを正しく配置する
       \edef\jlreq@lefthead@adjustbox{%
-        \noexpand\hskip\noexpand\dimexpr\if@tate\unexpanded{- \Cdp}\fi \unexpanded{- \headsep - 1\zw\relax}%
+        \noexpand\hskip\noexpand\dimexpr\if@tate\unexpanded{- \Cdp}\fi \unexpanded{- \headsep - 1\jlreq@zw\relax}%
         \unexpanded{\box\jlreq@tempboxa\hfil}%
       }%
       \edef\jlreq@righthead@adjustbox{%
@@ -4284,7 +4347,7 @@
       }{}%
       % フォント変更命令に文字出力命令が入っているとエラーになるのを回避するために\setboxでごまかす．
       \setbox\jlreq@tempboxa=\hbox{\jlreq@running@head@font
-        \ifthenelse{\lengthtest{\jlreq@gap < 1.49\zw} \OR \( \lengthtest{\jlreq@gap > 1.51\zw} \AND \lengthtest{\jlreq@gap < 1.99\zw} \) \OR \lengthtest{\jlreq@gap > 2.01\zw}}{\jlreq@note{ノンブルと柱との空き量は柱に使用する文字サイズの2倍又は1.5倍とする (ページスタイル #1 内，2.6.1.c)．}}{}%
+        \ifthenelse{\lengthtest{\jlreq@gap < 1.49\jlreq@zw} \OR \( \lengthtest{\jlreq@gap > 1.51\jlreq@zw} \AND \lengthtest{\jlreq@gap < 1.99\jlreq@zw} \) \OR \lengthtest{\jlreq@gap > 2.01\jlreq@zw}}{\jlreq@note{ノンブルと柱との空き量は柱に使用する文字サイズの2倍又は1.5倍とする (ページスタイル #1 内，2.6.1.c)．}}{}%
       }%
       % 初期化
       \@for\jlreq@parity:=odd,even\do{%
@@ -4446,15 +4509,15 @@
 \else
   \ifdim\marginparwidth>0pt
     \if@twocolumn
-      \def\jlreqyokoheadlength{\dimexpr\textwidth + 2\marginparwidth + 2\marginparsep\relax}
+      \def\jlreqyokoheadlength{\dimexpr\textwidth + 2\jlreq@sidenote@length + 2\jlreq@sidenote@sep\relax}
     \else
-      \def\jlreqyokoheadlength{\dimexpr\textwidth + \marginparwidth + \marginparsep\relax}
+      \def\jlreqyokoheadlength{\dimexpr\textwidth + \jlreq@sidenote@length + \jlreq@sidenote@sep\relax}
     \fi
   \else
     \def\jlreqyokoheadlength{\textwidth}
   \fi
 \fi
-\edef\jlreqtateheadlength{\unexpanded{\dimexpr\headsep + \headheight + \textheight}\if@tate\else\unexpanded{- \topskip + 1\zh}\fi\noexpand\relax}
+\edef\jlreqtateheadlength{\unexpanded{\dimexpr\headsep + \headheight + \textheight}\if@tate\else\unexpanded{- \topskip + 1\jlreq@zh}\fi\noexpand\relax}
 
 \newcommand*{\NewPageStyle}[2]{%
   \expandafter\@ifdefinable\csname ps@#1\endcsname{\DeclarePageStyle{#1}{#2}}%
@@ -4688,7 +4751,8 @@
       \vskip\baselineskip
       {\large\@date\par}%
     \end{center}\par
-    \vfil{\centering\@thanks}\vfil\null
+    \@thanks
+    \vfil\null
     \end{titlepage}%
   \jlreq@endofmaketitle
   }
@@ -4745,7 +4809,7 @@
   {\jlreq@keepbaselineskip{\LARGE}\@title\par}%
   \vskip\baselineskip
   {\jlreq@keepbaselineskip{\large}%
-    \lineskip .5\zh
+    \lineskip .5\jlreq@zh
     % 縦書き時には表組み内でも縦書きにするようにする
     \if@tate
       \let\jlreq@temporary@original@ialign=\ialign
@@ -4778,7 +4842,7 @@
       \null\vfil
       \@beginparpenalty\@lowpenalty
       \begin{center}%
-        {\sffamily\bfseries\abstractname}%
+        {\sffamily\gtfamily\bfseries\abstractname}%
         \@endparpenalty\@M
       \end{center}%
       \par
@@ -4810,25 +4874,25 @@
         \fi
         \bgroup
         \small
-        \parindent=1\zw
+        \parindent=1\jlreq@zw
         \begin{center}%
-          {\sffamily\bfseries\abstractname}%
+          {\sffamily\gtfamily\bfseries\abstractname}%
         \end{center}%
         \list{}{%
           \listparindent\parindent
           \itemindent\listparindent
           \labelwidth\z@
           \labelsep\z@
-          \leftmargin=2\zw
+          \leftmargin=2\jlreq@zw
           \rightmargin\leftmargin
-          \@tempdima=1\zw
+          \@tempdima=1\jlreq@zw
           \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
           \@tempdimc=\@tempdimb
           \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
-          \ifdim\@tempdimb=\@tempdimc\else\@tempdimb=\dimexpr\@tempdimb - 1\zw\relax\fi
+          \ifdim\@tempdimb=\@tempdimc\else\@tempdimb=\dimexpr\@tempdimb - 1\jlreq@zw\relax\fi
           \leftmargin=\dimexpr\leftmargin + (\@tempdimc - \@tempdimb)/2\relax
           \rightmargin=\dimexpr\rightmargin + (\@tempdimc - \@tempdimb)/2\relax
-          \parsep\z@ \@plus.1\zh
+          \parsep\z@ \@plus.1\jlreq@zh
         }%
         \item\relax
       \else
@@ -4857,9 +4921,9 @@
 %. 箇条書き． cf. JISX4051 8.4
 % 用語定義型
 \newenvironment{description}{\list{}{%
-  \setlength{\leftmargin}{0\zw}% 下げない
-  \setlength{\labelwidth}{0\zw}%
-  \setlength{\labelsep}{1\zw}
+  \setlength{\leftmargin}{0pt}% 下げない
+  \setlength{\labelwidth}{0pt}%
+  \setlength{\labelsep}{1\jlreq@zw}
 %  \addtolength{\leftmargin}{\leftskip}% たぶんこの二行いらない……
 %  \addtolength{\leftmargin}{\labelsep}%
   \let\makelabel=\descriptionlabel
@@ -4867,7 +4931,7 @@
 %  \let\jlreq@original@@item=\@item
 %  \def\@item[##1]{\jlreq@original@@item[##1]\mbox{}\par
   }}{\endlist}
-\newcommand{\descriptionlabel}[1]{\normalfont\sffamily\bfseries #1}
+\newcommand{\descriptionlabel}[1]{\normalfont\sffamily\gtfamily\bfseries #1}
 
 %.. 箇条書き
 % #3={<設定1>,i=<設定2>,<環境名>={<設定3>,ii=<設定4>}}のような設定を解釈する．
@@ -4938,7 +5002,7 @@
 % enumerate, itemize用初期化，#1 = i,ii,...
 \def\jlreq@init@list#1{%
   \setlength{\partopsep}{0pt}%
-  \setlength{\itemsep}{\dimexpr\jlreq@jlreqsetup@withenv@nameuse{jlreq@itemization@itemsep@setting}{\@currenvir}}%
+  \setlength{\itemsep}{\dimexpr\jlreq@jlreqsetup@withenv@nameuse{jlreq@itemization@itemsep@setting}{\@currenvir}\relax}%
   \setlength{\parsep}{0pt}%
   \setlength{\listparindent}{\parindent}%
   \setlength{\labelsep}{\dimexpr\jlreq@jlreqsetup@withenv@nameuse{jlreq@itemization@labelsep@setting}{\@currenvir}\relax}%
@@ -4972,7 +5036,7 @@
     \addtolength{\leftmargin}{2\jlreq@mol}%
     \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
     \jlreq@quote@fontsize
-    \@tempdima=1\zw
+    \@tempdima=1\jlreq@zw
     \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
     \@tempdimc=\@tempdimb
     \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
@@ -4984,7 +5048,7 @@
     \leftmargin=\dimexpr\jlreq@quote@indent\relax
     \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
     \jlreq@quote@fontsize
-    \@tempdima=1\zw
+    \@tempdima=1\jlreq@zw
     \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
     \@tempdimc=\@tempdimb
     \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
@@ -5001,7 +5065,7 @@
     \leftmargin=\dimexpr\jlreq@quote@indent\relax
     \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
     \jlreq@quote@fontsize
-    \@tempdima=1\zw
+    \@tempdima=1\jlreq@zw
     \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
     \@tempdimc=\@tempdimb
     \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
@@ -5146,7 +5210,7 @@
   \@mkboth{\refname}{\refname}%
   \list{\@biblabel{\@arabic\c@enumiv}}%
       {\settowidth\labelwidth{\@biblabel{#1}}%
-      \labelsep=1\zw
+      \labelsep=1\jlreq@zw
       \leftmargin\labelwidth
       \advance\leftmargin\labelsep
       \itemindent=0pt
@@ -5549,20 +5613,20 @@
 \jlreq@saveoriginalcs{\@begintheorem}
 \jlreq@saveoriginalcs{\@opargbegintheorem}
 \def\@begintheorem#1#2{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax
-  \trivlist\labelsep=1\zw
+  \trivlist\labelsep=1\jlreq@zw
   \itemindent=\dimexpr\jlreq@theorem@indent\relax
-   \item[\hskip \labelsep{\sffamily\bfseries #1\ #2}]}
+   \item[\hskip \labelsep{\sffamily\gtfamily\bfseries #1\ #2}]}
 \def\@opargbegintheorem#1#2#3{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax
-  \trivlist\labelsep=1\zw
+  \trivlist\labelsep=1\jlreq@zw
   \itemindent=\dimexpr\jlreq@theorem@indent\relax
-  \item[\hskip \labelsep{\sffamily\bfseries #1\ #2（#3）}]}
+  \item[\hskip \labelsep{\sffamily\gtfamily\bfseries #1\ #2（#3）}]}
 \AtEndOfPackageFile*{amsthm}{%
   \jlreq@saveoriginalcs{\proof}%
   \jlreq@saveoriginalcs{\endproof}%
   \edef\jlreq@do{
     \unexpanded{\def\jlreq@proof[#1]}{%
-      \unexpanded{\labelsep=1\zw}%
-      \expandonce{\proof[{\reset@font\sffamily\bfseries #1\inhibitglue}\nopunct]}%
+      \unexpanded{\labelsep=1\jlreq@zw}%
+      \expandonce{\proof[{\reset@font\sffamily\gtfamily\bfseries #1\inhibitglue}\nopunct]}%
     }
   }
   \jlreq@do
@@ -5572,7 +5636,7 @@
   \theoremstyle{jlreq}
 }
 \def\jlreq@setupamsthm{
-  \newtheoremstyle{jlreq}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\normalfont}{\dimexpr\jlreq@theorem@indent\relax}{\sffamily\bfseries}{}{1\zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{（##3）}}
+  \newtheoremstyle{jlreq}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\normalfont}{\dimexpr\jlreq@theorem@indent\relax}{\sffamily\gtfamily\bfseries}{}{1\jlreq@zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{（##3）}}
 }
 \jlreq@jlreqsetup@add{theorem_beforeafter_space}{
   \def\jlreq@theorem@beforeafter@space{#1}
@@ -5596,23 +5660,23 @@
   \renewcommand{\thesubparagraph}{(\jlreq@rensuji{\@arabic\c@subparagraph})}
 
   \ifthenelse{\equal{\jlreq@article@type}{article}}{
-    \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE}},indent=4\zw,lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
+    \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE}},indent=4\jlreq@zw,lines=4,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
     \if@twoside\ModifyHeading{part}{allowbreak_if_evenpage=true}\fi
   }
   {% book, report
-    \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\zw}},format={\null\vfill {\Huge\hspace*{2\zw}#1#2}\vspace*{2\jlreq@gol}}}
-    \NewBlockHeading{chapter}{0}{indent=2\zw,lines=6,label_format={第\thechapter 章},font={\huge},after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\Large}}}
+    \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@zw}},format={\null\vfill {\Huge\hspace*{2\jlreq@zw}#1#2}\vspace*{2\jlreq@gol}}}
+    \NewBlockHeading{chapter}{0}{indent=2\jlreq@zw,lines=6,label_format={第\thechapter 章},font={\huge},after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\Large}}}
     \if@twoside\ModifyHeading{chapter}{allowbreak_if_evenpage=true}\fi
     \renewcommand{\thechapter}{\jlreq@Kanji{chapter}}
   }
-  \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large}},indent=6\zw,lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}}
+  \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large}},indent=6\jlreq@zw,lines=3,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}}
   \if@twoside\ModifyHeading{section}{allowbreak_if_evenpage=true}\fi
-  \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large}},indent=8\zw,lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\small}}}
+  \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large}},indent=8\jlreq@zw,lines=2,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\small}}}
   \if@twoside\ModifyHeading{subsection}{allowbreak_if_evenpage=true}\fi
-  \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize}},indent=10\zw,lines=1,before_lines=1,subtitle_break=false,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},,subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}}
+  \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize}},indent=10\jlreq@zw,lines=1,before_lines=1,subtitle_break=false,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},,subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}}
   \if@twoside\ModifyHeading{subsubsection}{allowbreak_if_evenpage=true}\fi
   \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize}}}
-  \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize}},indent=1\zw}
+  \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize}},indent=1\jlreq@zw}
 \else% yoko
   \renewcommand{\thepart}{\Roman{part}}
   \renewcommand{\thesubsection}{\thesection .\arabic{subsection}}
@@ -5620,24 +5684,24 @@
   \renewcommand{\theparagraph}{\thesubsubsection .\arabic{paragraph}}
   \renewcommand{\thesubparagraph}{\theparagraph .\arabic{subparagraph}}
   \ifthenelse{\equal{\jlreq@article@type}{article}}{
-    \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\sffamily\bfseries}},label_format={第\thepart 部},lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
+    \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
-    \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@gol}},format={\null\vfil {\Huge\sffamily\bfseries #1#2}\vfil}}
+    \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@gol}},format={\null\vfil {\Huge\sffamily\gtfamily\bfseries #1#2}\vfil}}
     \NewBlockHeading{chapter}{0}{%
-      font={\jlreq@keepbaselineskip{\huge\sffamily\bfseries}},
+      font={\jlreq@keepbaselineskip{\huge\sffamily\gtfamily\bfseries}},
       label_format={第\thechapter 章},
-      lines=5,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},
+      lines=5,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},
       subtitle_font={\jlreq@keepbaselineskip{\Large}}}
     \renewcommand{\thechapter}{\arabic{chapter}}
     \renewcommand{\thesection}{\thechapter.\arabic{section}}
   }
-  \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\sffamily\bfseries}},lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}}
-  \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\sffamily\bfseries}},lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\small}}}
-  \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},lines=1,before_lines=1,subtitle_break=false,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}}
-  \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},indent=1\zw}
-  \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},indent=2\zw}
+  \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\sffamily\gtfamily\bfseries}},lines=3,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}}
+  \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\sffamily\gtfamily\bfseries}},lines=2,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\small}}}
+  \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\gtfamily\bfseries}},lines=1,before_lines=1,subtitle_break=false,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}}
+  \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\gtfamily\bfseries}},indent=1\jlreq@zw}
+  \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\gtfamily\bfseries}},indent=2\jlreq@zw}
 \fi
 
 \ifthenelse{\equal{\jlreq@article@type}{article}}{}{% book, report
@@ -5694,12 +5758,12 @@
 %.. 注
 \jlreqsetup{reference_mark=inline}
 \if@tate
-  \jlreqsetup{footnote_indent=1\zw}% 根拠なし
+  \jlreqsetup{footnote_indent=1\jlreq@zw}% 根拠なし
 \else
   \jlreqsetup{footnote_indent=0pt}% （4.2.5.b）
 \fi
-\jlreqsetup{footnote_second_indent=1\zw}
-\jlreqsetup{endnote_second_indent=2\zw}
+\jlreqsetup{footnote_second_indent=1\jlreq@zw}
+\jlreqsetup{endnote_second_indent=2\jlreq@zw}
 \jlreqsetup{endnote_position=headings}
 \ifdim\marginparwidth>0pt
   \jlreqsetup{sidenote_type=number}
@@ -5708,9 +5772,9 @@
 
 %.. キャプション
 \jlreqsetup{
-  caption_font={\sffamily\bfseries},
-  caption_label_font={\sffamily\bfseries},
-  caption_after_label_space=1\zw,
+  caption_font={\sffamily\gtfamily\bfseries},
+  caption_label_font={\sffamily\gtfamily\bfseries},
+  caption_after_label_space=1\jlreq@zw,
   caption_label_format={#1},
   caption_align=center
 }
@@ -5730,25 +5794,25 @@
   \renewcommand{\theenumii}{\@alph\c@enumii}
   \renewcommand{\theenumiii}{\@roman\c@enumiii}
   \renewcommand{\theenumiv}{\@Alph\c@enumiv}
-  \newcommand{\labelenumi}{\theenumi.\hspace{.5\zw}}
-  \newcommand{\labelenumii}{(\theenumii)\hspace{.5\zw}}
-  \newcommand{\labelenumiii}{\theenumiii.\hspace{.5\zw}}
-  \newcommand{\labelenumiv}{\theenumiv.\hspace{.5\zw}}
+  \newcommand{\labelenumi}{\theenumi.\hspace{.5\jlreq@zw}}
+  \newcommand{\labelenumii}{(\theenumii)\hspace{.5\jlreq@zw}}
+  \newcommand{\labelenumiii}{\theenumiii.\hspace{.5\jlreq@zw}}
+  \newcommand{\labelenumiv}{\theenumiv.\hspace{.5\jlreq@zw}}
 \fi
 \renewcommand{\p@enumii}{\theenumi}
 \renewcommand{\p@enumiii}{\theenumi(\theenumii)}
 \renewcommand{\p@enumiv}{\p@enumiii\theenumiii}
 
-\newcommand{\labelitemi}{\hbox to 1\zw{\hss\textbullet\hss}}
+\newcommand{\labelitemi}{\hbox to 1\jlreq@zw{\hss\textbullet\hss}}
 %\newcommand{\labelitemi}{•}
 \if@tate
   \newcommand{\labelitemii}{○}
   \newcommand{\labelitemiii}{＊}
 \else
-  \newcommand{\labelitemii}{\hbox to 1\zw{\hss\textendash\hss}}
-  \newcommand{\labelitemiii}{\hbox to 1\zw{\hss\textasteriskcentered\hss}}
+  \newcommand{\labelitemii}{\hbox to 1\jlreq@zw{\hss\textendash\hss}}
+  \newcommand{\labelitemiii}{\hbox to 1\jlreq@zw{\hss\textasteriskcentered\hss}}
 \fi
-\newcommand{\labelitemiv}{\hbox to 1\zw{\hss ・\hss}}
+\newcommand{\labelitemiv}{\hbox to 1\jlreq@zw{\hss ・\hss}}
 
 % 見出しが一つ上のレベルからどのくらいずれているかを入れる．
 \setlength\leftmargini{2\zw}
@@ -5761,12 +5825,15 @@
   itemization_beforeafter_space={0pt,i=.5\baselineskip},
   itemization_itemsep=0pt,
   itemization_labelsep={0pt},
-  itemization_label_length={1\zw,i=2\zw,ii=2\zw}
+  itemization_label_length={%
+    i=\leftmargini,ii=\leftmarginii,iii=\leftmarginiii,
+    iv=\leftmarginiv,v=\leftmarginv,vi=\leftmarginvi
+  }
 }
 
 %.. 引用
 \jlreqsetup{
-  quote_indent=2\zw,
+  quote_indent=2\jlreq@zw,
   quote_end_indent=0pt,
   quote_fontsize=,
   quote_beforeafter_space=0pt
-- 
cgit v1.2.3

