texlive[45967] Master/texmf-dist: jlreq (2dec17)

commits+karl at tug.org commits+karl at tug.org
Sat Dec 2 23:23:26 CET 2017


Revision: 45967
          http://tug.org/svn/texlive?view=revision&revision=45967
Author:   karl
Date:     2017-12-02 23:23:26 +0100 (Sat, 02 Dec 2017)
Log Message:
-----------
jlreq (2dec17)

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

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md	2017-12-02 01:52:48 UTC (rev 45966)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md	2017-12-02 22:23:26 UTC (rev 45967)
@@ -308,8 +308,11 @@
     - バグ修正
     - `\SetBlockHeadingSpaces`を追加.
     - `\contentsname` と `\indexname`に入っていたスペースを削除.
+* 2017-12-02
+    - バグ修正
 
 
+
 --------------
 Noriyuki Abe
 https://github.com/abenori/jlreq

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README.md	2017-12-02 01:52:48 UTC (rev 45966)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README.md	2017-12-02 22:23:26 UTC (rev 45967)
@@ -62,6 +62,8 @@
     - Fixed bugs.
     - Added `\SetBlockHeadingSpaces`.
     - Removed a space from `\contentsname` and `\indexname`.
+* 2017-12-02
+    - Fixed bugs.
 
 
 

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html	2017-12-02 01:52:48 UTC (rev 45966)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html	2017-12-02 22:23:26 UTC (rev 45967)
@@ -383,6 +383,10 @@
 <li><code>\SetBlockHeadingSpaces</code>を追加.</li>
 <li><code>\contentsname</code> と <code>\indexname</code>に入っていたスペースを削除.</li>
 </ul></li>
+<li>2017-12-02
+<ul>
+<li>バグ修正</li>
+</ul></li>
 </ul>
 <hr />
 <p>Noriyuki Abe<br />

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html	2017-12-02 01:52:48 UTC (rev 45966)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html	2017-12-02 22:23:26 UTC (rev 45967)
@@ -136,6 +136,10 @@
 <li>Added <code>\SetBlockHeadingSpaces</code>.</li>
 <li>Removed a space from <code>\contentsname</code> and <code>\indexname</code>.</li>
 </ul></li>
+<li>2017-12-02
+<ul>
+<li>Fixed bugs.</li>
+</ul></li>
 </ul>
 <hr />
 <p>Noriyuki Abe<br />

Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls	2017-12-02 01:52:48 UTC (rev 45966)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls	2017-12-02 22:23:26 UTC (rev 45967)
@@ -5,7 +5,7 @@
 %%
 % (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/)
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2017/11/23 jlreq]
+\ProvidesClass{jlreq}[2017/12/02 jlreq]
 \RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
 
 %. helper1
@@ -220,18 +220,6 @@
   \jlreq at helper@parsekeyval@@@{#1}%
 }
 
-% #1のboxを今の真ん中に配置する.
-\def\jlreq at box@putcenter#1{%
-  \begingroup
-    \jlreq at tempdima=\dimexpr(\ht#1 - \dp#1)/2\relax
-    \setbox\jlreq at tempboxa=\hbox{あ}%
-    \edef\jlreq at do{%
-      \noexpand\lower\the\dimexpr(\jlreq at tempdima - (\ht\jlreq at tempboxa - \dp\jlreq at tempboxa)/2)\relax\unexpanded{\box#1}%
-    }%
-  \expandafter\endgroup
-  \jlreq at do
-}
-
 % \jlreq at switch{str}{
 %   {str}{abcd}
 %   {str1}{xyz}
@@ -312,31 +300,6 @@
   \expandafter\expandafter\expandafter\let\expandafter\expandafter\csname jlreq at original@#1\endcsname\csname #1\endcsname
 }
 
-% #1の先頭が文字か
-\long\def\jlreq at ifletter#1{%
-  \jlreq at ifempty{#1}{\@secondoftwo}{%
-    \jlreq at iffirsttoken{#1}{ }{\@secondoftwo}{%
-      \expandafter\expandafter\expandafter\jlreq at helper@ifletter\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@
-  }}%
-}
-
-\long\def\jlreq at helper@ifletter#1{%
-  \ifnum
-    0\ifcat 阿\noexpand #11\fi
-    \ifcat あ\noexpand #11\fi
-    \ifcat (\noexpand #11\fi
-    \ifcat A\noexpand #11\fi
-    \ifcat 1\noexpand #11\fi
-  >0
-    \expandafter\@firstoftwo\else\expandafter\@secondoftwo
-  \fi
-}
-
-% こっちは先頭にあるマクロを展開してチェックする
-\long\def\jlreq at ifletter@expandmacros#1{%
-  \jlreq at ifmacro{#1}{\expandafter\jlreq at ifletter@expandmacros\expandafter{#1}}{\jlreq at ifletter{#1}}%
-}
-
 % 先頭にあるマクロを展開しまくった結果を#2に入れる.
 \long\def\jlreq at expandmacros#1#2{%
   \jlreq at ifmacro{#1}{\expandafter\jlreq at expandmacros\expandafter{#1}{#2}}{\def#2{#1}}%
@@ -655,6 +618,44 @@
 \let\jlreq at mol=\zw
 
 %. helper2(エンジン依存系)
+% #1のboxを今の真ん中に配置する.
+\def\jlreq at box@putcenter#1{%
+  \begingroup
+    \jlreq at tempdima=\dimexpr(\ht#1 - \dp#1)/2\relax
+    \setbox\jlreq at tempboxa=\hbox{あ}%
+    \edef\jlreq at do{%
+      \noexpand\lower\the\dimexpr(\jlreq at tempdima - (\ht\jlreq at tempboxa - \dp\jlreq at tempboxa)/2)\relax\unexpanded{\box#1}%
+    }%
+  \expandafter\endgroup
+  \jlreq at do
+}
+
+% #1の先頭が文字か
+\long\def\jlreq at ifletter#1{%
+  \jlreq at ifempty{#1}{\@secondoftwo}{%
+    \jlreq at iffirsttoken{#1}{ }{\@secondoftwo}{%
+      \expandafter\expandafter\expandafter\jlreq at helper@ifletter\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@
+  }}%
+}
+
+\long\def\jlreq at helper@ifletter#1{%
+  \ifnum
+    0%
+    \ifcat 阿\noexpand #11\fi
+    \ifcat あ\noexpand #11\fi
+    \ifcat (\noexpand #11\fi
+    \ifcat A\noexpand #11\fi
+    \ifcat 1\noexpand #11\fi
+  >0
+    \expandafter\@firstoftwo\else\expandafter\@secondoftwo
+  \fi
+}
+
+% こっちは先頭にあるマクロを展開してチェックする
+\long\def\jlreq at ifletter@expandmacros#1{%
+  \jlreq at ifmacro{#1}{\expandafter\jlreq at ifletter@expandmacros\expandafter{#1}}{\jlreq at ifletter{#1}}%
+}
+
 % 組方向を判定
 % \jlreq at if(y|t)(dir|box)を定義する.
 \ifx l\jlreq at engine\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{
@@ -1369,32 +1370,31 @@
 }
 
 % 和文間隔
-\def\jlreq at zenkakuspace@fixjfm{%
-  \ifnum\jlreq at lastnodechar>-1
-    \def\@tempa{\futurelet\jlreq at nextchar\jlreq at zenkakuspace@fixjfm@}%
-  \else\def\@tempa{\ignorespaces}\fi
-  \@tempa
+\DeclareRobustCommand*\ {\futurelet\jlreq at nextchar\jlreq at zenkakuspace@ignorespaces}
+% 後続の空白を無視する処理
+\edef\jlreq at zenkakuspace@ignorespaces{%
+  \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq at nextchar\expandafter\jlreq at zenkakuspace@ignorespaces@\else\expandafter\jlreq at zenkakuspace@main\fi}%
 }
-\def\jlreq at zenkakuspace@fixjfm@{\jlreq at insertjfm\ignorespaces}
-
+\expandafter\def\expandafter\jlreq at zenkakuspace@ignorespaces@\space{\ }
 \def\jlreq at tempa{}
 \def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifnum\lastnodechar=`#1 1\fi}\jlreq at do}}
 \expandafter\jlreq at do\jlreq at charlist@dividingpunctuationmarks\jlreq at endmark
 \edef\@tempa{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 }
-\expandafter\DeclareRobustCommand\expandafter*\expandafter\ \expandafter{\@tempa
+\expandafter\DeclareRobustCommand\expandafter*\expandafter\jlreq at zenkakuspace@main\expandafter{\@tempa
     \hskip 1\zw\hbox{}%
     \jlreq at lastnodechar=` 
-    \expandafter\jlreq at zenkakuspace@fixjfm
-  \else \expandafter\ignorespaces\fi
+    \expandafter\jlreq at fixjfm
+  \else\expandafter \fi
 }
 \ifx l\jlreq at engine
   {
     \catcode` =\active
-    \global\let =\ 
+    \global\let =\jlreq at zenkakuspace@main
   }
   \AtBeginDocument{\catcode` =\active}
 \fi
 
+
 % \jaspace
 \DeclareRobustCommand*{\jaspace}[1]{%
   \ifcsname jlreq at jaspace@#1\endcsname\csname jlreq at jaspace@#1\endcsname
@@ -1410,7 +1410,7 @@
 \def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifx\jlreq at nextchar #11\fi}\jlreq at do}}
 \expandafter\jlreq at do\jlreq at charlist@closingbrackets\jlreq at endmark
 \edef\jlreq at dividingpunctuationmarkscommand{%
-  \noexpand\ifnum 0\expandonce{\jlreq at tempa}>0\unexpanded{\else\ \fi\ignorespaces}%
+  \noexpand\ifnum 0\expandonce{\jlreq at tempa}>0 \unexpanded{\expandafter\ignorespaces\else\expandafter\ \fi}%
 }
 \def\jlreq at do#1{%
   \jlreq at ifendmark{#1}{}{
@@ -1802,6 +1802,39 @@
 % 見出し名一覧を格納する
 \def\jlreq at heading@allheadings{}
 
+% 目次を出力する命令\l@<命令名>を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット}
+\def\jlreq at heading@make at l@#1#2#3{%
+  \@ifundefined{l@#1}{%
+   % 長さは適当に計測する
+    \begingroup
+      % ちょっと大きめで計測しておく
+      \csname c@#1\endcsname=9
+      \setbox\jlreq at tempboxa=\hbox{#3}%
+      \jlreq at tempdima=\wd\jlreq at tempboxa\relax%
+      \jlreq at tempdimb=1\zw
+      \divide\jlreq at tempdima by \jlreq at tempdimb
+      \edef\jlreq at do{%
+        \unexpanded{\def\jlreq at result}{%
+          \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\numexpr\jlreq at tempdima + 1\relax\noexpand\zw}}%
+        }%
+      }%
+    \expandafter\endgroup
+    \jlreq at do
+  }{\def\jlreq at result{}}%
+}
+
+\def\jlreq at heading@make at maketoc#1#2{%
+  % 目次への出力をするマクロ.外部に切り出しておく.
+  \@ifundefined{jlreq at heading@maketoc@#1}{%
+    % {1 = *}{2 = ラベル}{3 = running head}
+    \expandafter\def\csname jlreq at heading@maketoc@#1\endcsname##1##2##3{%
+      \ifnum0\jlreq at ifempty{##1}{}{1}\ifnum #2>\c at secnumdepth 1\fi>0\else
+        \csname #1mark\endcsname{##3}%
+        \addcontentsline{toc}{#1}{\protect\numberline{##2}##3}%
+      \fi
+    }%
+  }{}%
+}
 %.. 中/半扉見出し
 % addcontentslineに渡すやつ:番号出すのと出さないの
 \newcommand{\DeclareTobiraHeading}[3]{%
@@ -1813,15 +1846,7 @@
   \expandafter\def\csname jlreq at heading@type@#1\endcsname{\RenewTobiraHeading}%
   \@ifundefined{c@#1}{\newcounter{#1}}{}%
   \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
-  \@ifundefined{jlreq at heading@maketoc@#1}{%
-    % {1 = *}{2 = ラベル}{3 = running head}
-    \expandafter\def\csname jlreq at heading@maketoc@#1\endcsname##1##2##3{%
-      \ifnum0\jlreq at ifempty{##1}{}{1}\ifnum #2>\c at secnumdepth 1\fi>0\else
-        \csname #1mark\endcsname{##3}%
-        \addcontentsline{toc}{#1}{\protect\numberline{##2}##3}%
-      \fi
-    }%
-  }{}%
+  \jlreq at heading@make at maketoc{#1}{#2}%
   \begingroup
     \let\jlreq at contents@label at format=\@undefined
     \let\jlreq at format=\@undefined
@@ -1844,16 +1869,8 @@
       \def\jlreq at format##1##2{##1##2}%
     \fi
     \edef\jlreq at formatwlabel{\noexpand\jlreq at format{\expandonce{\jlreq at label@format}}}%
-    \@ifundefined{l@#1}{%
-      \edef\jlreq at do{\unexpanded{\setbox\jlreq at tempboxa=\hbox}{\expandonce{\jlreq at label@format}}}%
-      \jlreq at do
-      \jlreq at tempdima=\wd\jlreq at tempboxa
-      \jlreq at tempdimb=1\zw
-      \divide\jlreq at tempdima by \jlreq at tempdimb
-      \eappto\jlreq at do{%
-        \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\numexpr\jlreq at tempdima + 1\relax\noexpand\zw}}%
-      }%
-    }{}%
+    \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
+    \eappto\jlreq at do{\expandonce{\jlreq at result}}%
     \edef\jlreq at do{%
       \expandonce{\jlreq at do}%
       \noexpand\def\expandonce{\csname jlreq at TobiraHeading@start@#1\endcsname}[####1]####2{%
@@ -2095,7 +2112,7 @@
       \jlreq at tempskipb=\glueexpr\jlreq at ushiroaki\relax
     \fi
   \else
-    % 行取り時の前後の空きを足した値
+    % 行取り時の前後の空きを足した値を\jlreq at tempdimaに入れる
     \jlreq at tempdima=\glueexpr(#3\baselineskip - \baselineskip - \ht\jlreq at tempboxa - \dp\jlreq at tempboxa)\relax
     \ifx\jlreq at maeakitype\@empty
       \jlreq at tempskipa=\glueexpr(\jlreq at tempdima + \dp\jlreq at tempboxb - \ht\jlreq at tempboxb)/2\relax
@@ -2194,16 +2211,7 @@
   \expandafter\def\csname jlreq at heading@type@#1\endcsname{\RenewBlockHeading}%
   \@ifundefined{c@#1}{\newcounter{#1}}{}%
   \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
-  % 目次への出力をするマクロ.外部に切り出しておく.
-  \@ifundefined{jlreq at heading@maketoc@#1}{%
-    % {1 = *}{2 = ラベル}{3 = running head}
-    \expandafter\def\csname jlreq at heading@maketoc@#1\endcsname##1##2##3{%
-      \ifnum0\jlreq at ifempty{##1}{}{1}\ifnum #2>\c at secnumdepth 1\fi>0\else
-        \csname #1mark\endcsname{##3}%
-        \addcontentsline{toc}{#1}{\protect\numberline{##2}##3}%
-      \fi
-    }%
-  }{}%
+  \jlreq at heading@make at maketoc{#1}{#2}%
   \begingroup
     \def\jlreq at font{}%
     \def\jlreq at subtitle@font{}%
@@ -2321,22 +2329,21 @@
       \fi\fi
     }{}%
     \edef\jlreq at format{\expandonce{\jlreq at font}\expandonce{\jlreq at format}}%
+    % 空き量などの調整を含んだラベル
     \edef\jlreq at label@format at modified{%
       \noexpand\noindent
       \unexpanded{\setbox\jlreq at tempboxa=\hbox}{\expandonce{\jlreq at label@format}}%
-      \unexpanded{\hangindent=}%
+      \unexpanded{\hangindent=\glueexpr}(\expandonce{\jlreq at after@label at space}) + (\expandonce{\jlreq at second@heading at text@indent at wlabel})%
       \ifjlreq at hang
-        \wd\jlreq at tempboxa
+        +\wd\jlreq at tempboxa\relax
       \else
-        0pt
+        \relax
         \unexpanded{\edef\jlreq at BlockHeading@start at labellength{\the\wd\jlreq at tempboxa}}%
       \fi
-      \unexpanded{\hangindent=\dimexpr\hangindent + }(\expandonce{\jlreq at after@label at space}) + (\expandonce{\jlreq at second@heading at text@indent at wlabel})\noexpand\relax
       \box\jlreq at tempboxa
-      \hskip0pt\relax
     }%
     \edef\jlreq at heading@text at format@wlabel{%
-      \ifdim\jlreq at after@label at space=0pt\else
+      \ifdim\dimexpr\jlreq at after@label at space\relax=0pt\else
         \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq at after@label at space}\noexpand\relax}%
       \fi
       \expandonce{\jlreq at heading@text at format}%
@@ -2349,11 +2356,12 @@
     }%
     \def\jlreq at make@subtitle at format##1##2{%
       \edef##1{%
-        \ifjlreq at subtitle@break\unexpanded{{\par}\nobreak\noindent\global\hangafter=0}\fi
-        \unexpanded{\global\hangindent=\dimexpr\hangindent + }(\expandonce{\jlreq at subtitle@indent}) ##2\noexpand\relax
+        \ifjlreq at subtitle@break\unexpanded{{\par}\hangafter=0}\fi
+        \unexpanded{\hangindent=\dimexpr\hangindent + }(\expandonce{\jlreq at subtitle@indent}) ##2\noexpand\relax
         \ifdim\jlreq at subtitle@indent=0pt\else
           \ifjlreq at subtitle@break\else\unexpanded{\hspace*}{\expandonce{\jlreq at subtitle@indent}}\fi
         \fi
+        \unexpanded{\nobreak\noindent}%
         {\ifx\jlreq at subtitle@font\@empty\else\expandonce{\jlreq at subtitle@font}\fi\expandonce{\jlreq at subtitle@format}}%
       }%
     }%
@@ -2362,26 +2370,27 @@
       \ifjlreq at hang\else + (\noexpand\jlreq at BlockHeading@start at labellength)\fi
     }%
     \jlreq at make@subtitle at format\jlreq at subtitle@format at wolabel{- (\expandonce{\jlreq at second@heading at text@indent at wolabel})}%
-    \@ifundefined{l@#1}{%
-      % 長さは適当に計測する
-      \begingroup
-        % ちょっと大きめで計測しておく
-        \csname c@#1\endcsname=9
-        \setbox\jlreq at tempboxa=\hbox{\jlreq at label@format}%
-        \edef\jlreq at do{\noexpand\jlreq at tempdima=\the\dimexpr\wd\jlreq at tempboxa\relax}%
-      \expandafter\endgroup
-      \jlreq at do
-      \jlreq at tempdimb=1\zw
-      \divide\jlreq at tempdima by \jlreq at tempdimb
-      \eappto\jlreq at do{%
-        \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\numexpr\jlreq at tempdima + 1\relax\noexpand\zw}}%
-      }%
-    }{}%
+    \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
+    \eappto\jlreq at do{\expandonce{\jlreq at result}}%
     \jlreq at BlockHeading@gyodori at parsekeyval*[BlockHeading:#1]{#3}{}{}{1}%
     \let\jlreq at spaceset=\jlreq at result
     \edef\jlreq at totalformat{\unexpanded{##1}\expandonce{\jlreq at afterindent}\noexpand\@afterheading}%
     \if at twocolumn
-      \ifthenelse{\equal{\jlreq at column@spanning}{true}}{\edef\jlreq at totalformat{\unexpanded{\twocolumn[{##1}]}}}{}%
+      \ifthenelse{\equal{\jlreq at column@spanning}{true}}{%
+        \def\@tempa##1##2##3{%
+          % 前開きが常に入ってしまうので,a:の時は除去する
+          \jlreq at iffirsttoken{##1}{a}{\def\jlreq at spaceset{{}{##2}{##3}}}{}
+          \edef\jlreq at totalformat{%
+            \noexpand\twocolumn[%
+              % 普段自動で入る\topskipと\baselineskipを手動で入れる
+              \jlreq at iffirsttoken{##1}{r}{}{\unexpanded{\vskip\topskip\relax}}%
+              \unexpanded{####1}%
+              \jlreq at iffirsttoken{##2}{r}{}{\unexpanded{\vskip\glueexpr\baselineskip - \topskip\relax}}%
+            ]%
+          }%
+        }%
+        \expandafter\@tempa\jlreq at spaceset
+      }{}%
     \fi
     \edef\jlreq at do{%
       \expandonce{\jlreq at do}%
@@ -2552,13 +2561,13 @@
 
 
 % 現在の情報に基づき出力
-\def\jlreq at BlockHeading@spaces at output{{%
+\def\jlreq at BlockHeading@spaces at output{%
   \@ifundefined{jlreq at BlockHeading@spaces at setlist@\jlreq at BlockHeading@spaces at current@sequence}{%
     \jlreq at BlockHeading@spaces at outputwospace
   }{%
     \expandafter\expandafter\expandafter\jlreq at BlockHeading@spaces at output@\csname jlreq at BlockHeading@spaces at setlist@\jlreq at BlockHeading@spaces at current@sequence\endcsname\jlreq at endmark
   }%
-}}
+}
 
 % 連続スペース情報とか無視して各々の見出しを出力する
 \def\jlreq at BlockHeading@spaces at outputwospace{%
@@ -2565,6 +2574,7 @@
   \jlreq at tempcnta=0
   \@whilenum\jlreq at tempcnta<\jlreq at BlockHeading@spaces at current@count\do{%
     \advance\jlreq at tempcnta by 1
+    \csname jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta\endcsname
     \edef\jlreq at tempa{%
       \unexpanded{\long\def\jlreq at tempa##1}{\csexpandonce{jlreq at BlockHeading@spaces at current@format@\the\jlreq at tempcnta}}%
     }%
@@ -2577,7 +2587,6 @@
       }}%
     }%
     \edef\jlreq at do{\jlreq at tempb}%
-    \csname jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta\endcsname
     \jlreq at do
     \csname jlreq at BlockHeading@spaces at current@after@\the\jlreq at tempcnta\endcsname
   }%
@@ -2650,10 +2659,11 @@
 \def\jlreq at BlockHeading@spaces at clear{%
   \jlreq at tempcnta=0
   \@whilenum\jlreq at tempcnta<\jlreq at BlockHeading@spaces at current@count\do{%
+    \advance\jlreq at tempcnta by 1
     \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@space@\the\jlreq at tempcnta\endcsname=\@undefined
     \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@output@\the\jlreq at tempcnta\endcsname=\@undefined
-    \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@between@\the\jlreq at tempcnta\endcsname=\@undefined
-    \advance\jlreq at tempcnta by 1
+    \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta\endcsname=\@undefined
+    \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@after@\the\jlreq at tempcnta\endcsname=\@undefined
   }%
   \gdef\jlreq at BlockHeading@spaces at current@sequence{}%
   \global\jlreq at BlockHeading@spaces at current@count=0
@@ -2670,7 +2680,7 @@
   \expandafter\def\csname jlreq at 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\jlreq at gol}}}{}%
+  \@ifundefined{l@#1}{\expandafter\def\csname l@#1\endcsname{\@dottedtocline{#2}{0\zw}{2\zw}}}{}%
   \begingroup
     \def\jlreq at font{\normalfont\normalsize}%
     \def\jlreq at indent{0\zw}%
@@ -2711,19 +2721,16 @@
 }
 
 %.. 窓見出し
-\newcount\jlreq at wraplinecount
-\newdimen\jlreq at hangindent
 \def\jlreq at CutinHeading@start#1#2#3#4#5#6#7{%
-  \ifnum0\ifnum\jlreq at wraplinecount<-1 1\fi\ifnum\jlreq at wraplinecount>1 1\fi>0
+  \par
+  \ifnum\hangafter=1
+    \jlreq at CutinHeading@start@{#2}{#3}{#4}{#5}{#6}{#7}%
+  \else
     \ClassError{jlreq}{Can not use \expandafter\string\csname#1\endcsname\space here}{\@ehc}%
-  \else
-    \jlreq at CutinHeading@@start{#2}{#3}{#4}{#5}{#6}{#7}%
   \fi
 }
 % 1 = 書式指定,2 = インデント, 3 = 見出しと本文の間, 4 = これを越えたら二行以上,5 = これを越えたら三行以上,6 = テキスト
-\def\jlreq at CutinHeading@@start#1#2#3#4#5#6{%
-  \par
-  \leavevmode
+\def\jlreq at CutinHeading@start@#1#2#3#4#5#6{%
   % 一行で処理したときの見出し長さを計測
   \setbox\@tempboxa=\hbox{#1#6}%
   \@tempdima=\wd\@tempboxa
@@ -2741,36 +2748,41 @@
     \jlreq at inlinenote@determinelength{#6}{#1}{}{\jlreq at CutinHeading@linecount}{\jlreq at CutinHeading@linecount}{\@tempdima}{\linewidth}%
     \def\jlreq at CutinHeading@linecount{3}%
   \fi
-  % 普通の一行の高さ/深さに合わせて見出しのボックスを出力
-  \setbox\@tempboxa=\vtop to \dimexpr\numexpr\jlreq at CutinHeading@linecount - 1\relax\baselineskip + 1\jlreq at gol\relax{\vskip 0pt plus 1fill minus 1fill \box\jlreq at resultbox\vskip 0pt plus 1fill minus 1fill}%
-  \setbox\jlreq at tempboxa=\hbox{あ}%
+  % 普通の一行の高さ/深さに合わせて見出しのボックスを作る
+  \setbox\@tempboxa=\vtop to \dimexpr\numexpr\jlreq at CutinHeading@linecount - 1\relax\baselineskip + 1\zh\relax{\vskip 0pt plus 1fill minus 1fill \box\jlreq at resultbox\vskip 0pt plus 1fill minus 1fill}%
+  % 高さを通常の一行のそれにする
+  \setbox\jlreq at tempboxa=\hbox{阿}%
+  \dp\@tempboxa=\dimexpr\ht\@tempboxa + \dp\@tempboxa - \ht\jlreq at tempboxa\relax
   \ht\@tempboxa=\ht\jlreq at tempboxa
-  \dp\@tempboxa=\dp\jlreq at tempboxa
-  \@tempdima=\wd\@tempboxa
-  % \hang****を設定
-  \hangindent=\dimexpr#2 + \@tempdima + #3\relax\hangafter=-\jlreq at CutinHeading@linecount
-  \jlreq at hangindent=\hangindent\jlreq at wraplinecount=\hangafter
+  \noindent
   \hspace*{#2}%
-  \kern-\dimexpr\hangindent + \parindent\relax
-  \box\@tempboxa
+  \copy\@tempboxa
+  % でかい見出しボックスの分をキャンセルする空きを入れる
+  % \baselineskip - \ht\jlreq at tempboxaはTeXが挿入するスキップの分
   \hspace*{#3}%
+  \vspace{-\dimexpr\ht\@tempboxa + \dp\@tempboxa + \baselineskip - \ht\jlreq at tempboxa\relax}%
+  \par
+  \hangindent=\dimexpr#2 + \wd\@tempboxa + #3\relax
+  \hangafter=-\jlreq at CutinHeading@linecount\relax
+  \prevdepth=0pt
   % 改段落が起こっても\hang****をキープするように\parを書き換えておく(終わったら元に戻す).
-  % \jlreq at hangindent/\jlreq at wraplinecountにそれぞれ\hangindent/\hangafterに対応する値を入れて
-  % \parのたびにそこから代入する.
   \def\par{%
+    \ifvmode\jlreq at tempatrue\else\jlreq at tempafalse\fi
+    \jlreq at tempcnta=\hangafter\relax
+    \jlreq at tempdima=\hangindent\relax
     \@@par
-    \ifnum\jlreq at wraplinecount<-1\relax
-      \ifnum\jlreq at wraplinecount<-\prevgraf
-        \advance\jlreq at wraplinecount by \prevgraf\hangindent=\jlreq at hangindent\hangafter=\jlreq at wraplinecount
-      \else
-        \jlreq at wraplinecount=1\jlreq at hangindent=0pt\relax
-        \@restorepar
+    \ifnum\jlreq at tempcnta<-\prevgraf\relax
+      \ifjlreq at tempa\else
+        \advance\jlreq at tempcnta by \prevgraf\relax
       \fi
+      \hangafter=\jlreq at tempcnta\relax
+      \hangindent=\jlreq at tempdima\relax
     \else
-      \jlreq at wraplinecount=1\jlreq at hangindent=0pt\relax
       \@restorepar
     \fi
   }%
+  \@afterindentfalse
+  \@afterheading
   \ignorespaces
 }
 
@@ -3500,12 +3512,11 @@
 
 \def\jlreq at inlinenote@noauto@#1\\#2#3\jlreq at endmark{%
   \jlreq at inlinenote@noauto@@#1&\jlreq at endmark\jlreq at endmark
-  \ifx#2\jlreq at endmark\def\jlreq at next{}\else\linebreak\def\jlreq at next{\jlreq at inlinenote@noauto@#2#3\jlreq at endmark}\fi
-  \jlreq at next
+  \jlreq at ifendmark{#2}{}{\linebreak\jlreq at inlinenote@noauto@#2#3\jlreq at endmark}%
 }
 
 \def\jlreq at inlinenote@noauto@@#1&#2#3\jlreq at endmark{%
-  \ifx#2\jlreq at endmark
+  \jlreq at ifendmark{#2}{%
     \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize #1}%
     \jlreq at tempdimc=\wd\@tempboxa
     \divide\jlreq at tempdimc by 2\relax
@@ -3517,17 +3528,15 @@
       }%
     \fi
     \def\jlreq at next{}%
-  \else
+  }{%
     \def\jlreq at next{\jlreq at inlinenote@noauto@@@{#1}#2#3}%
-  \fi
+  }%
   \jlreq at next
 }
 
 \def\jlreq at inlinenote@noauto@@@#1#2&\jlreq at endmark{%
-  {%
-    \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize\vbox{\hbox{#1}\hbox{#2}}}%
-    \jlreq at box@putcenter\@tempboxa
-  }%
+  \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize\vbox{\hbox{#1}\hbox{#2}}}%
+  \jlreq at box@putcenter\@tempboxa
 }
 
 \newcommand{\jlreq at inlinenote@endnote}{%
@@ -3545,7 +3554,7 @@
 % * #5 - #4行目までは#3の指定に従う
 % * それ以降はX
 % として整形した際に,#5行以内に収まる.
-% \jlreq at resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid
+% \jlreq at resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid.\globalに設定する.
 \newcommand{\jlreq at inlinenote@determinelength}[7]{%
 %  \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}%
   \@tempcnta=1\relax
@@ -4502,15 +4511,15 @@
 }
 
 \newcount\jlreq at top@contents % トップ見出しを入れる.レベルと同じ値.
-\jlreq at top@contents=-1
+\jlreq at top@contents=-100
 \newcommand*{\jlreq at set@top at contents}[1]{%
-  \ifnum\jlreq at top@contents=-1
+  \ifnum\jlreq at top@contents=-100
     \jlreq at top@contents=#1\relax
   \fi
 }
 \ifthenelse{\equal{\jlreq at article@type}{article}}{
   \newcommand{\tableofcontents}{%
-    \jlreq at top@contents=-1\relax
+    \jlreq at top@contents=-100\relax
     \if at twocolumn
       \@restonecoltrue\onecolumn
     \else
@@ -4521,9 +4530,9 @@
     \@starttoc{toc}%
     \if at restonecol\twocolumn\fi
   }
-}{% book, article
+}{% book, report
   \newcommand{\tableofcontents}{%
-    \jlreq at top@contents=-1\relax
+    \jlreq at top@contents=-100\relax
     \if at twocolumn
       \@restonecoltrue\onecolumn
     \else
@@ -4646,7 +4655,7 @@
     \@mainmatterfalse
     \let\jlreq at pagestyle@atmain\jlreq at current@pagestyle
     \SaveHeading{chapter}{\jlreq at heading@chapter at atmain}%
-    \ModifyHeading{chapter}{label_format={}}%
+    \ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
     \pagestyle{plain}%
     \pagenumbering{roman}}
   \newcommand*{\mainmatter}{%
@@ -4666,7 +4675,7 @@
     \fi
     \ifthenelse{\equal{\jlreq at article@type}{article}}{}{%book, report
       \SaveHeading{chapter}{\jlreq at heading@chapter at atmain}%
-      \ModifyHeading{chapter}{label_format={}}%
+      \ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
     }%
     \pagestyle{plain}%
     \@mainmatterfalse



More information about the tex-live-commits mailing list