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