diff options
author | Karl Berry <karl@freefriends.org> | 2017-03-14 21:52:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-03-14 21:52:14 +0000 |
commit | 6c6557191951b5d4062c3abe8d20e2b8aa41f638 (patch) | |
tree | 97d0ef1240fa96d6fc603485099bade693c81a2d /Master/texmf-dist/tex | |
parent | 59413b7e6b14f78e42de6b95bea2014d50200d74 (diff) |
jlreq (14mar17)
git-svn-id: svn://tug.org/texlive/trunk@43499 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq.cls | 742 |
1 files changed, 477 insertions, 265 deletions
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls index f0dd59e52db..a47d9d89f88 100644 --- a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls +++ b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls @@ -3,9 +3,9 @@ %% The package is distributed under the BSD 2-Clause License %% %% -% (based on JLREQ 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/) +% (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/) \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{jlreq}[2017/02/17 jlreq] +\ProvidesClass{jlreq}[2017/03/14 jlreq] \RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen} %. helper1 @@ -24,6 +24,7 @@ % 計算結果を返すための変数 \newdimen\jlreq@resultdimen \newbox\jlreq@resultbox +\newif\ifjlreq@result \def\jlreq@uniqtoken{\jlreq@uniqtoken} \def\jlreq@endmark{\jlreq@endmark} @@ -35,8 +36,12 @@ \long\def\jlreq@getfirsttoken@#1#2\jlreq@endmark#3\jlreq@endmark{#1} % 与えられたトークン列が空か(展開はしないでチェック) \long\def\jlreq@ifempty#1{\expandafter\ifx\expandafter\relax\detokenize{#1}\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} +% #1の先頭トークンが#2か +\long\def\jlreq@iffirsttoken#1#2{% + \expandafter\expandafter\expandafter\ifx\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark #2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi +} % #1が\jlreq@endmarkか -\long\def\jlreq@ifendmark#1{\expandafter\expandafter\expandafter\ifx\jlreq@getfirsttoken#1{}\jlreq@uniqtoken\jlreq@endmark\jlreq@endmark\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} +\long\def\jlreq@ifendmark#1{\jlreq@iffirsttoken{#1}{\jlreq@endmark}} % @removeelementの括弧があっても動くかもしれない版 % 次の変数を使う:\jlreq@tempa:消したいやつ,\jlreq@tempb:今処理している部分. @@ -186,15 +191,15 @@ \@tempa } \long\def\jlreq@helper@parsekeyval@@@choicekey#1#2[#3]#4{% - \define@choicekey{#1}{#2}{#3}{\appto\jlreq@do{#4}}% + \define@choicekey{#1}{#2}{#3}{\eappto\jlreq@do{\unexpanded{#4}}}% \jlreq@helper@parsekeyval@@@{#1}% } \long\def\jlreq@helper@parsekeyval@@@definekeywithdefault#1#2#3{% - \define@key{#1}{#2}[]{\appto\jlreq@do{#3}}% + \define@key{#1}{#2}[]{\eappto\jlreq@do{\unexpanded{#3}}}% \jlreq@helper@parsekeyval@@@{#1}% } \long\def\jlreq@helper@parsekeyval@@@definekey#1#2#3{% - \define@key{#1}{#2}{\appto\jlreq@do{#3}}% + \define@key{#1}{#2}{\eappto\jlreq@do{\unexpanded{#3}}}% \jlreq@helper@parsekeyval@@@{#1}% } @@ -272,6 +277,19 @@ \jlreq@preambletrue \AtBeginDocument{\jlreq@preamblefalse} +\RequirePackage[savepos]{zref} +\zref@newprop*{jlreq@page}[0]{\number\c@page} +\zref@addprop{main}{jlreq@page} +% 現在のページを得る +\newcount\jlreq@zref@reference@count +\jlreq@zref@reference@count=0 +\newcount\jlreq@currentpage +\newcommand*{\jlreq@setcurrentpage}{% + \global\advance\jlreq@zref@reference@count by 1 + \zref@labelbyprops{jlreq@rest@width.page.\the\jlreq@zref@reference@count}{jlreq@page}% + \global\jlreq@currentpage=\zref@extractdefault{jlreq@rest@width.page.\the\jlreq@zref@reference@count}{jlreq@page}{\c@page}% +} + %. オプションの定義 % オプション処理の際にしか使わない変数(後でそれを元に別の変数を調整する) % ものは\jlreq@option@<key>に格納する. @@ -342,28 +360,28 @@ % 追加 \jlreq@addpapersize[a0]{}{1189mm}{841mm} \jlreq@addpapersize[a1]{}{841mm}{594mm} -\jlreq@addpapersize[a2]{}{420mm}{594mm} -\jlreq@addpapersize[a7]{}{74mm}{105mm} -\jlreq@addpapersize[a8]{}{52mm}{74mm} -\jlreq@addpapersize[a9]{}{37mm}{52mm} -\jlreq@addpapersize[a10]{}{26mm}{37mm} - -\jlreq@addpapersize[b0]{}{1030mm}{1456mm} -\jlreq@addpapersize[b1]{}{728mm}{1030mm} -\jlreq@addpapersize[b2]{}{515mm}{728mm} -\jlreq@addpapersize[b3]{}{364mm}{515mm} -\jlreq@addpapersize[b7]{}{91mm}{128mm} -\jlreq@addpapersize[b8]{}{64mm}{91mm} -\jlreq@addpapersize[b9]{}{45mm}{64mm} -\jlreq@addpapersize[b10]{}{32mm}{45mm} - -\jlreq@addpapersize[c2]{}{458mm}{648mm} -\jlreq@addpapersize[c3]{}{324mm}{458mm} -\jlreq@addpapersize[c4]{}{229mm}{354mm} -\jlreq@addpapersize[c5]{}{162mm}{229mm} -\jlreq@addpapersize[c6]{}{114mm}{162mm} -\jlreq@addpapersize[c7]{}{81mm}{114mm} -\jlreq@addpapersize[c8]{}{57mm}{81mm} +\jlreq@addpapersize[a2]{}{594mm}{420mm} +\jlreq@addpapersize[a7]{}{105mm}{74mm} +\jlreq@addpapersize[a8]{}{74mm}{52mm} +\jlreq@addpapersize[a9]{}{52mm}{37mm} +\jlreq@addpapersize[a10]{}{37mm}{26mm} + +\jlreq@addpapersize[b0]{}{1456mm}{1030mm} +\jlreq@addpapersize[b1]{}{1030mm}{728mm} +\jlreq@addpapersize[b2]{}{728mm}{515mm} +\jlreq@addpapersize[b3]{}{515mm}{364mm} +\jlreq@addpapersize[b7]{}{128mm}{91mm} +\jlreq@addpapersize[b8]{}{91mm}{64mm} +\jlreq@addpapersize[b9]{}{64mm}{45mm} +\jlreq@addpapersize[b10]{}{45mm}{32mm} + +\jlreq@addpapersize[c2]{}{648mm}{458mm} +\jlreq@addpapersize[c3]{}{458mm}{324mm} +\jlreq@addpapersize[c4]{}{354mm}{229mm} +\jlreq@addpapersize[c5]{}{229mm}{162mm} +\jlreq@addpapersize[c6]{}{162mm}{114mm} +\jlreq@addpapersize[c7]{}{114mm}{81mm} +\jlreq@addpapersize[c8]{}{81mm}{57mm} %.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a) \newcommand*{\jlreq@option@fontsize}{} @@ -422,8 +440,8 @@ % 脚注の字下げ,一行目を下げるならばone,二行目以降ならばtwo.ちょっと酷いので後で考える. \newcommand*{\jlreq@footnotetext@indent}{one} \define@choicekey{jlreq.cls}{footnotetext_indent}{one,two}{\renewcommand*{\jlreq@footnotetext@indent}{#1}} -% 後注をどこに配置するか._headings(全ての見出し),_paragraph(段落後),_で始まらないやつ(その名前の見出し).カンマ区切り -\newcommand*{\jlreq@endnote@position}{_headings} +% 後注をどこに配置するか.headings(全ての見出し),paragraph(段落後),_で始まるやつ(その名前の見出し).カンマ区切り +\newcommand*{\jlreq@endnote@position}{headings} \DeclareOptionX{endnote_position}{\renewcommand*{\jlreq@endnote@position}{#1}} % 傍注のタイプ \newcommand*{\jlreq@sidenote@type}{number} @@ -431,6 +449,18 @@ \newcommand*{\jlreq@option@sidenote@width}{} \DeclareOptionX{sidenote_width}{\renewcommand*{\jlreq@option@sidenote@width}{#1}} +%.. 引用 +\def\jlreq@quote@indent{2zw} +\DeclareOptionX{quote_indent}{\def\jlreq@quote@indent{#1}} +\def\jlreq@quote@end@indent{0zw} +\DeclareOptionX{quote_end_indent}{\def\jlreq@quote@end@indent{#1}} +\def\jlreq@quote@fontsize{normalsize} +\define@choicekey{jlreq.cls}{quote_fontsize}{normalsize,small,footnotesize,scriptsize,tiny}{\def\jlreq@quote@fontsize{#1}} +\def\jlreq@quote@beforeafter@space{0pt} +\DeclareOptionX{quote_beforeafter_space}{\def\jlreq@quote@beforeafter@space{#1}} + + +%.. もろもろ \newif\if@restonecol \@restonecolfalse \newif\if@titlepage \@titlepagefalse \newif\ifjlreq@option@titlepage \jlreq@option@titlepagefalse % titlepageかnotitlepageかが指定された @@ -445,9 +475,8 @@ \tombowtrue \tombowdatefalse \setlength{\@tombowwidth}{\z@}% \maketombowbox} -\jlreq@DeclareOption{tate}{\@tatetrue - \AtBeginDocument{\tate\message{\jlreq@tategumi@message}\adjustbaseline}% -} +\jlreq@DeclareOption{tate}{\@tatetrue} + \newif\ifjlreq@option@twoside\jlreq@option@twosidefalse % onesideかtwosideが指定された \jlreq@DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse\jlreq@option@twosidetrue} \jlreq@DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue\jlreq@option@twosidetrue} @@ -465,7 +494,7 @@ \jlreq@DeclareOption{fleqn}{\input{fleqn.clo}} \newcommand*{\jlreq@warning}[1]{} -\jlreq@DeclareOption{jlreq_warnings}{\renewcommand*{\jlreq@warning}[1]{\ClassWarningNoLine{jlreq}{(JLREQ warning) ##1}}} +\jlreq@DeclareOption{jlreq_warnings}{\renewcommand*{\jlreq@warning}[1]{\ClassWarningNoLine{jlreq}{(JLReq warning) ##1}}} \ExecuteOptionsX{article_type=article,paper=a4,fontsize=10pt,open_bracket_pos=zenkaku_tentsuki,reference_mark=inline,footnotetext_indent=one,endnote_position=headings,onecolumn,final} % \@removeelementを一旦置き換えてから\ProcessOptionsXを実行する @@ -524,7 +553,9 @@ % http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1508&parent=8435 \if@tate\AtEndPreamble{\par}\fi \fi -\def\jlreq@tategumi@message{《縦組モード》} +\if@tate + \AtBeginDocument{\tate\message{《縦組モード》}\adjustbaseline} +\fi % \jlreq@gol(Gyo Okuri Length), \jlreq@mol (Moji Okuri Length)を定義 \if@tate @@ -560,15 +591,11 @@ \fi % 現在行の残りを得る. -\RequirePackage[savepos]{zref} -\newcount\jlreq@rest@linewidth@count -\jlreq@rest@linewidth@count=0 - \ifx l\jlreq@engine % 以下のコードはおかしい. \newcommand*{\jlreq@calc@current@linewidth}{% - \dimexpr\zposx{jlreq@rest@width.pos.\the\jlreq@rest@linewidth@count} sp - \@totalleftmargin - - \ifodd\zref@extractdefault{jlreq@rest@width.page.\the\jlreq@rest@linewidth@count}{page}{\c@page}% + \dimexpr\zposx{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp - \@totalleftmargin - + \ifodd\jlreq@currentpage \oddsidemargin \else \evensidemargin @@ -579,8 +606,8 @@ \newcommand*{\jlreq@calc@current@linewidth}{% \dimexpr \jlreq@ifydir{% - \zposx{jlreq@rest@width.pos.\the\jlreq@rest@linewidth@count} sp - \hoffset - \ifodd\zref@extractdefault{jlreq@rest@width.page.\the\jlreq@rest@linewidth@count}{page}{\c@page}% + \zposx{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp - \hoffset + \ifodd\jlreq@currentpage - \oddsidemargin \else - \evensidemargin @@ -592,7 +619,7 @@ \pdfpageheight \fi - \topmargin - \headheight - \headsep - \voffset - - \zposy{jlreq@rest@width.pos.\the\jlreq@rest@linewidth@count} sp + - \zposy{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp }% - \@totalleftmargin - 1in \relax @@ -604,13 +631,13 @@ % この命令以降,次にこの命令を実行する前まで\jlreq@rest@linewidth/\jlreq@rest@linewidthで % この場所における残り長さが取得できる. \newcommand*{\jlreq@savepos@for@rest@linewidth}{% - \global\advance\jlreq@rest@linewidth@count by 1\relax - \zsavepos{jlreq@rest@width.pos.\the\jlreq@rest@linewidth@count}% - \zref@labelbyprops{jlreq@rest@width.page.\the\jlreq@rest@linewidth@count}{page}% - \jlreq@current@linewidth=\jlreq@calc@current@linewidth - \jlreq@rest@linewidth=\dimexpr\linewidth - \jlreq@current@linewidth\relax + \jlreq@setcurrentpage + \global\advance\jlreq@zref@reference@count by 1\relax + \zsavepos{jlreq@rest@width.pos.\the\jlreq@zref@reference@count}% + \global\jlreq@current@linewidth=\jlreq@calc@current@linewidth + \global\jlreq@rest@linewidth=\dimexpr\linewidth - \jlreq@current@linewidth\relax + \edef\jlreq@savepos@iflabelundefined{\noexpand\zref@ifrefundefined{jlreq@rest@width.pos.\the\jlreq@zref@reference@count}}% } -\def\jlreq@savepos@iflabelundefined{\@ifundefined{\ZREF@RefPrefix @jlreq@rest@width.pos.\the\jlreq@rest@linewidth@count}} %. 基本設定 % 和文文字,欧文文字の設定(とりあえずLuaTeX-jaのデフォルトのまま) @@ -904,12 +931,11 @@ %.. フォント関連 \newdimen\jlreq@fontsize \ifx l\jlreq@engine - \jlreq@tempdima=0.25mm \setlength{\jlreq@fontsize}{% \dimexpr\directlua{ local act = string.char(92) local s = [[\jlreq@option@fontsize]] - s = s:gsub("Q",act .. "jlreq@tempdima") + s = s:gsub("Q",act .. "dimexpr 0.25mm" .. act .. "relax") tex.print(s) }\relax }% @@ -917,38 +943,6 @@ \setlength{\jlreq@fontsize}{\dimexpr\jlreq@option@fontsize\relax} \fi -% JFMに関連する設定 -\ifx l\jlreq@engine - % この値は後でjfm-jlreq内で読む - \directlua{jlreq.open_bracket_pos = [[\jlreq@open@bracket@pos]]} - \ifjlreq@burasage\directlua{jlreq.burasage = true} - \else\directlua{jlreq.burasage = false}\fi -\else - % 非LuaTeXの場合はJFMの入れ替えと\everyparでの処理で対処. - \def\jlreq@jfmname@prefix{} - \def\jlreq@openbreackets@list{(〔[{〈《「『【} - \ifx u\jlreq@engine\edef\jlreq@openbreackets@list{\jlreq@openbreackets@list {⦅〘〖«〝‘“}}\fi - % \jlreq@jfmnameにJFMの名前を入れる - \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} - \edef\jlreq@jfmnameg{\jlreq@jfmname@prefix jlreqg} - % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる. - \ifthenelse{\equal{\jlreq@open@bracket@pos}{nibu_tentsuki}}{ - \def\jlreq@openbracket@hook{\jlreq@ifintokenlist{\jlreq@nextchar}{\jlreq@openbreackets@list}{\hskip -.5\jlreq@mol\inhibitglue}{}} - }{% zenkakunibu_nibu,zenkaku_tentsuki - \def\jlreq@openbracket@hook{\jlreq@ifintokenlist{\jlreq@nextchar}{\jlreq@openbreackets@list}{\inhibitglue}{}} - } - \AtBeginDocument{\PushPostHook{par}{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}} -\fi -% 開き括弧の幅が全角の場合は,ベタ組にするために補正が必要 -\ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{ - \def\jlreq@open@bracket@before@space{\hskip -.5\jlreq@mol} -}{ - \def\jlreq@open@bracket@before@space{} -} - %. フォント \RequirePackage{lmodern} @@ -989,6 +983,38 @@ \DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal} %.. 和文 +% JFMに関連する設定 +\ifx l\jlreq@engine + % この値は後でjfm-jlreq内で読む + \directlua{jlreq.open_bracket_pos = [[\jlreq@open@bracket@pos]]} + \ifjlreq@burasage\directlua{jlreq.burasage = true} + \else\directlua{jlreq.burasage = false}\fi +\else + % 非LuaTeXの場合はJFMの入れ替えと\everyparでの処理で対処. + \def\jlreq@jfmname@prefix{} + \def\jlreq@openbreackets@list{(〔[{〈《「『【} + \ifx u\jlreq@engine\edef\jlreq@openbreackets@list{\jlreq@openbreackets@list {⦅〘〖«〝‘“}}\fi + % \jlreq@jfmnameにJFMの名前を入れる + \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} + \edef\jlreq@jfmnameg{\jlreq@jfmname@prefix jlreqg} + % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる. + \ifthenelse{\equal{\jlreq@open@bracket@pos}{nibu_tentsuki}}{ + \def\jlreq@openbracket@hook{\jlreq@ifintokenlist{\jlreq@nextchar}{\jlreq@openbreackets@list}{\hskip -.5\jlreq@mol\inhibitglue}{}} + }{% zenkakunibu_nibu,zenkaku_tentsuki + \def\jlreq@openbracket@hook{\jlreq@ifintokenlist{\jlreq@nextchar}{\jlreq@openbreackets@list}{\inhibitglue}{}} + } + \AtBeginDocument{\PushPostHook{par}{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}} +\fi +% 開き括弧の幅が全角の場合は,ベタ組にするために補正が必要 +\ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{ + \def\jlreq@open@bracket@before@space{\hskip -.5\jlreq@mol} +}{ + \def\jlreq@open@bracket@before@space{} +} + \ifx l\jlreq@engine \RequirePackage{luatexja-adjust} \ltjenableadjust[lineend=extended,priority=true] @@ -996,14 +1022,14 @@ \ltjsetparameter{shrink_priority={kanjiskip=0,xkanjiskip=0}} \fi -\ifx u\jlreq@engine - \def\jlreq@yokokanjiencoding{JY2} - \def\jlreq@tatekanjiencoding{JT2} -\fi \ifx p\jlreq@engine \def\jlreq@yokokanjiencoding{JY1} \def\jlreq@tatekanjiencoding{JT1} \fi +\ifx u\jlreq@engine + \def\jlreq@yokokanjiencoding{JY2} + \def\jlreq@tatekanjiencoding{JT2} +\fi \ifx l\jlreq@engine \def\jlreq@yokokanjiencoding{JY3} \def\jlreq@tatekanjiencoding{JT3} @@ -1040,6 +1066,17 @@ \DeclareFontShape{\jlreq@tatekanjiencoding}{mc}{bx}{it}{<->ssub*gt/m/n}{} \DeclareFontShape{\jlreq@tatekanjiencoding}{mc}{bx}{sl}{<->ssub*gt/m/n}{} +% 和文ファミリと欧文ファミリの連動 +\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} + % 数式フォント設定 \ifx l\jlreq@engine\else \DeclareSymbolFont{mincho}{\jlreq@yokokanjiencoding}{mc}{m}{n} @@ -1061,12 +1098,11 @@ \setlength{\jlreq@baselineskip}{\dimexpr 17\jlreq@fontsize/10\relax}% \else \ifx l\jlreq@engine - \jlreq@tempdima=0.25mm \setlength{\jlreq@baselineskip}{% \dimexpr\directlua{ local act = string.char(92) local s = [[\jlreq@option@baselineskip]] - s = s:gsub("Q",act .. "jlreq@tempdima"):gsub("zh",act .. "zh"):gsub("zw",act .. "zw") + s = s:gsub("Q",act .. "dimexpr 0.25mm" .. act .. "relax"):gsub("zh",act .. "zh"):gsub("zw",act .. "zw") tex.print(s) }\relax }% @@ -1367,11 +1403,11 @@ {label_format}{\def\jlreq@label@format{##1}} {format}{\def\jlreq@format####1####2{##1}} {pagestyle}{\def\jlreq@pagestyle{##1}} - {type}[han,naka]{ + {type}[han,naka]{% \jlreq@switch{##1}{ {han}{\def\jlreq@heading@clearpage{\clearpage}} {naka}{\def\jlreq@heading@clearpage{\cleardoublepage}} - } + }% } }{#3}% \ifx\jlreq@format\@undefined @@ -1390,7 +1426,7 @@ }% }{}% \edef\jlreq@do{% - \expandonce{\jlreq@addtodo}% + \expandonce{\jlreq@addtodo}% \noexpand\def\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}[####1]####2{% \unexpanded{\ifnum#2>\c@secnumdepth\else}% \unexpanded{\refstepcounter{#1}}% @@ -1432,12 +1468,12 @@ } %.. 別行見出し -% \jlreq@startBlockHeading{1 = 命令名}{2 = レベル}{3 = 字下げ}{4 = 前空き}{5 = 後ろ空き}{6 = トータル行数}{7 = フォーマット関連}*{見出し}[副題] +% \jlreq@startBlockHeading{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 = フォーマット関連}*{見出し}[副題] % 字下げはa:**だと追加する値(ページ行頭には入らない),s:**も追加だがページ行頭でも入る, % r:**だとその値に強制する. -\newcommand{\jlreq@startBlockHeading}[7]{% - \edef\jlreq@startBlockHeading@format{\unexpanded{#7}}% - \jlreq@startBlockHeading@{#1}{#2}{{#3}{#4}{#5}{#6}}% +\newcommand{\jlreq@startBlockHeading}[4]{% + \edef\jlreq@startBlockHeading@format{\unexpanded{#4}}% + \jlreq@startBlockHeading@{#1}{#2}{#3}% } % {1 = 命令}{2 = レベル}{3 = スペース関連} \newcommand{\jlreq@startBlockHeading@}[3]{% @@ -1448,37 +1484,42 @@ \@ifnextchar[{\jlreq@startBlockHeading@@@{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq@startBlockHeading@@@{#1}{#2}{#3}{#4}{#5}{#6}[]}% } -% {1 = レベル}{2 = ラベルフォーマット}{3 = 本体フォーマット}{4 = 副題フォーマット}{5 = *}{6 = 見出し}{7 = 副題} -\long\def\jlreq@startBlockHeading@setformat#1#2#3#4#5#6#7{% +% {1 = ラベルフォーマット}{2 = 見出し文字列フォーマット}{3 = 見出し文字列フォーマット(ラベル無し)}{4 = 副題フォーマット}{5 = 副題フォーマット(ラベル無し)}{6 = 全体フォーマット}{7 = *}{8 = 見出し}{9 = 副題} +\long\def\jlreq@startBlockHeading@setformat#1#2#3#4#5#6#7#8#9{% % \jlreq@tempaに{ラベル}{見出し}{副題}という形のものを入れる - \ifnum0\jlreq@ifempty{#5}{}{1}\ifnum #1>\c@secnumdepth 1\fi>0 - \def\jlreq@tempa{{}{#6}}% - \else - \def\jlreq@tempa{{#2}{#6}}% - \fi \jlreq@ifempty{#7}{% - \appto\jlreq@tempa{{}}% + % ラベルあり + \def\jlreq@tempa{#1}% + \long\def\jlreq@tempb##1{#2}% + \jlreq@ifempty{#9}{\def\jlreq@tempc##1{}}{\long\def\jlreq@tempc##1{#4}}% }{% - \long\def\jlreq@tempb##1{#4}% - \expandafter\appto\expandafter\jlreq@tempa\expandafter{\expandafter{\jlreq@tempb{#7}}}% + \def\jlreq@tempa{}% + \long\def\jlreq@tempb##1{#3}% + \jlreq@ifempty{#9}{\def\jlreq@tempc##1{}}{\long\def\jlreq@tempc##1{#5}}% }% - \long\def\jlreq@tempb##1##2##3{#3}% + \edef\jlreq@tempa{{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb{#8}}}{\expandonce{\jlreq@tempc{#9}}}}% + \long\def\jlreq@tempb##1##2##3{#6}% \edef\jlreq@tempa{\unexpanded{\expandafter\def\expandafter\jlreq@result\expandafter}{\noexpand\jlreq@tempb\expandonce{\jlreq@tempa}}}% \jlreq@tempa } % {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}{5 = running head}{6 = 見出し}[7 = 副題] \def\jlreq@startBlockHeading@@@#1#2#3#4#5#6[#7]{% - \ifnum0\jlreq@ifempty{#4}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0\else + \ifnum0\jlreq@ifempty{#4}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0 + \def\jlreq@tempb{*}% + \else \refstepcounter{#1}% + \def\jlreq@tempb{}% \fi % 後で呼び出す\jlreq@startBlockHeading@addtocontentslineを定義する - \long\def\jlreq@tempa##1##2##3{\def\jlreq@tempa{##1}}% + \long\def\jlreq@tempa##1##2##3##4##5##6##7{% + \def\jlreq@tempa{##1}% 素のラベルのフォーマットを取り出す + \edef\jlreq@tempb{\unexpanded{{##2}{##3}{##4}{##5}{##6}{##7}}{\expandonce{\jlreq@tempb}}}% 残り + }% \expandafter\jlreq@tempa\jlreq@startBlockHeading@format \edef\jlreq@startBlockHeading@addtocontentsline{% \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{\unexpanded{#4}}{\expandonce{\jlreq@tempa}}{\unexpanded{#5}}% }% - \def\jlreq@do{\jlreq@startBlockHeading@setformat{#2}}% - \expandafter\jlreq@do\jlreq@startBlockHeading@format{#4}{#6}{#7}% + \expandafter\jlreq@startBlockHeading@setformat\jlreq@tempb{#6}{#7}% \def\jlreq@do{\jlreq@startBlockHeading@@@@#3}% \expandafter\jlreq@do\expandafter{\jlreq@result}% } @@ -1494,26 +1535,33 @@ }% } -% {1 = 字下げ}{2 = 前空き}{3 = 後ろ空き}{4 = トータル行数}{5 = 出力} -\long\def\jlreq@startBlockHeading@@@@#1#2#3#4#5{% +% {1 = 字下げ}{2 = 字上げ}{3 = 前空き}{4 = 後ろ空き}{5 = トータル行数}{6 = afterindent}{7 = 偶数ページ改ページ}{8 = 出力} +\long\def\jlreq@startBlockHeading@@@@#1#2#3#4#5#6#7#8{% \if@noskipsec\leavevmode\fi - \setbox\jlreq@tempboxa=\vbox{% - \jlreq@ifempty{#1}{}{\hsize=\dimexpr\hsize - #1\relax}% - \noindent #5}% \par - \@afterindenttrue + \jlreq@ifempty{#7}{}{\jlreq@setcurrentpage}% + \setbox\jlreq@tempboxa=\vbox{\noindent + \jlreq@tempafalse % 中央寄せするか + \ifthenelse{\equal{#1}{center}}{\jlreq@tempatrue}{% + \jlreq@ifempty{#1}{}{\hsize=\dimexpr\hsize - #1\relax}% + }% + \ifthenelse{\equal{#2}{center}}{\jlreq@tempatrue}{% + \jlreq@ifempty{#2}{}{\hsize=\dimexpr\hsize - #2\relax}% + }% + \ifjlreq@tempa\hfil\fi + #8}% % \jlreq@tempskip(a/b)に前/後ろに入れるべき値を入れる - % #2がa:ならばその値は\jlreq@tempskipaには入れず\jlreq@tempskipcに入れておく + % #3がa:ならばその値は\jlreq@tempskipaには足さず\jlreq@tempskipcに入れておく \jlreq@tempskipc=0pt - \jlreq@startBlockHeading@analyzespace#2:\jlreq@endmark + \jlreq@startBlockHeading@analyzespace#3:\jlreq@endmark \setbox\jlreq@tempboxb=\vbox{ }% - \jlreq@ifempty{#4}{% + \jlreq@ifempty{#5}{% \ifx\jlreq@startBlockHeading@space\@empty\else \jlreq@tempskipa=\glueexpr\jlreq@startBlockHeading@space\relax \fi \jlreq@tempskipb=0pt\relax }{% - \jlreq@tempskipb=\glueexpr(\baselineskip*(#4 + 1) - \ht\jlreq@tempboxb - \dp\jlreq@tempboxb - \ht\jlreq@tempboxa - \dp\jlreq@tempboxa)/2\relax + \jlreq@tempskipb=\glueexpr(\baselineskip*(#5 + 1) - \ht\jlreq@tempboxb - \dp\jlreq@tempboxb - \ht\jlreq@tempboxa - \dp\jlreq@tempboxa)/2\relax \ifx\jlreq@startBlockHeading@space\@empty \jlreq@tempskipa=\jlreq@tempskipb \else @@ -1526,7 +1574,7 @@ \fi \ifx r\jlreq@startBlockHeading@spacetype \jlreq@tempskipa=\glueexpr\jlreq@startBlockHeading@space\relax% - \jlreq@tempskipb=\glueexpr(\baselineskip*(#4 + 1) - \ht\jlreq@tempboxb - \dp\jlreq@tempboxb - \ht\jlreq@tempboxa - \dp\jlreq@tempboxa) - \jlreq@startBlockHeading@space\relax + \jlreq@tempskipb=\glueexpr(\baselineskip*(#5 + 1) - \ht\jlreq@tempboxb - \dp\jlreq@tempboxb - \ht\jlreq@tempboxa - \dp\jlreq@tempboxa) - \jlreq@startBlockHeading@space\relax \fi \fi }% @@ -1537,14 +1585,16 @@ \setbox\jlreq@tempboxa=\vbox{% \ifdim\jlreq@tempskipa=0pt\else\vskip\jlreq@tempskipa\fi \noindent - \jlreq@ifempty{#1}{}{\hskip #1}% - \box\jlreq@tempboxa\nopagebreak}% + \ifthenelse{\equal{#1}{center}}{}{\jlreq@ifempty{#1}{}{\hskip #1}}% + \box\jlreq@tempboxa}% \dp\jlreq@tempboxa=\dimexpr\dp\jlreq@tempboxa + \ht\jlreq@tempboxa\relax \ht\jlreq@tempboxa=0pt +% \showbox\jlreq@tempboxa \box\jlreq@tempboxa - \par\nobreak + \par + \jlreq@ifempty{#7}{\ifodd\jlreq@currentpage\nobreak\fi}{\nobreak}% \prevdepth=0pt - \jlreq@startBlockHeading@analyzespace#3:\jlreq@endmark + \jlreq@startBlockHeading@analyzespace#4:\jlreq@endmark \jlreq@tempskipb=\glueexpr\jlreq@tempskipb + \ht\jlreq@tempboxb - \baselineskip\relax \ifx\jlreq@startBlockHeading@space\@empty\else \ifx a\jlreq@startBlockHeading@spacetype @@ -1554,20 +1604,11 @@ \fi \fi \ifdim\jlreq@tempskipb=0pt\else\vspace{\jlreq@tempskipb}\fi + #6% \@afterheading } % \DeclareBlockHeading{命令名}{レベル}{設定} -% 行取り(4.1.6) -% a: lines=<何行取りか> -% b,d: before_lines, after_lines -% c: before_space, after_space -% f: beforeやafterを省略する -% font=<見出しフォント>, labelfont=<ラベルフォント>, subtitle_font=<副題フォント> -% indent=<全体のインデント> -% pagebreak=clearpage/cleardoublepage/newcolumn/nariyuki -% なお,これ以外に見出しの前後に記号を付ける,あるいは罫線を見出しの前後に配置する,罫線で見出しを囲むなどといったことも行われている. -% 縦組の偶数ページの場合は,ページ末に見出しを配置する. \newcommand{\DeclareBlockHeading}[3]{% \appto{\jlreq@heading@allheadings}{,#1}% \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}% @@ -1591,50 +1632,148 @@ \def\jlreq@after@space{}% \def\jlreq@before@lines{}% \def\jlreq@after@lines{}% - \def\jlreq@font{\normalsize}% - \def\jlreq@subtitle@font{\normalsize}% - \def\jlreq@indent{0}% - \let\jlreq@format=\@undefined + \def\jlreq@font{}% + \def\jlreq@subtitle@font{}% + \def\jlreq@indent{0\jlreq@mol}% + \def\jlreq@end@indent{0\jlreq@mol}% + \edef\jlreq@format{\unexpanded{##1##2##3}}% + \edef\jlreq@heading@text@format{\unexpanded{##1}}% \def\jlreq@pagebreak{}% - \let\jlreq@label@format=\@undefined - \let\jlreq@subtitle@format=\@undefined - \def\jlreq@pagetop@space{a}% + \def\jlreq@label@format{\@seccntformat{#1}}% + \newif\ifjlreq@hang\jlreq@hangtrue + \def\jlreq@after@label@space{1\jlreq@mol}% + \def\jlreq@second@heading@text@indent@wlabel{0pt}% + \def\jlreq@second@heading@text@indent@wolabel{0pt}% + \edef\jlreq@subtitle@format{\unexpanded{---##1---}}% + \def\jlreq@subtitle@indent{1\jlreq@mol}% + \def\jlreq@afterindent{\@afterindenttrue}% + \def\jlreq@allowbreak@evenpage{*}% 偶数ページでも改ページを許可するならば空,そうでないなら* + \newif\ifjlreq@subtitle@break\jlreq@subtitle@breaktrue + \def\jlreq@subtitle@indent{1\jlreq@mol}% + % 先頭が*なら\jlreq@resultをtrueにする.*を除いた部分を\jlreq@resultに入れる. + \def\jlreq@ifstar##1{% + \jlreq@iffirsttoken{##1}{*}{% + \jlreq@resulttrue + \expandafter\def\expandafter\jlreq@result\expandafter{\@gobble##1}% + }{% + \jlreq@resultfalse + \def\jlreq@result{##1}% + }% + }% + % a,bみたいなのをaとbにわける.カンマがなければbは空.引数を{a}{b}として##2を呼び出す. + \def\jlreq@parsecomma##1##2{% + \def\jlreq@tempa####1####2{##2}% + \def\@tempa####1,####2\jlreq@endmark{% + \jlreq@ifempty{####2}{% + \def\@tempa{}% + }{% + \def\@tempa########1,\jlreq@endmark{\def\@tempa{########1}}% + \@tempa####2\jlreq@endmark + }% + \edef\@tempa{\unexpanded{\jlreq@tempa{####1}}{\expandonce{\@tempa}}}% + \edef\jlreq@do{\expandafter\expandafter\expandafter\unexpanded\expandafter\expandafter\expandafter{\@tempa}}% + }% + \@tempa##1,\jlreq@endmark + \jlreq@do + }% \jlreq@parsekeyval[BlockHeading]{ {lines}{\def\jlreq@lines{##1}} {before_space}{\def\jlreq@before@space{##1}} {after_space}{\def\jlreq@after@space{##1}} - {before_lines}{\def\jlreq@before@lines{##1}} + {before_lines}{% + \jlreq@ifstar{##1}% + \edef\jlreq@before@lines{% + \ifjlreq@result s:\else a:\fi + \expandonce{\jlreq@result}% + }% + } {after_lines}{\def\jlreq@after@lines{##1}} {font}{\def\jlreq@font{##1}} {subtitle_font}{\def\jlreq@subtitle@font{##1}} {indent}{\def\jlreq@indent{##1}} + {end_indent}{\def\jlreq@end@indent{##1}} {format}{\edef\jlreq@format{\unexpanded{##1}}} + {after_label_space}{\def\jlreq@after@label@space{##1}} + {second_heading_text_indent}{% + \jlreq@parsecomma{##1}{% + \jlreq@ifstar{####1}% + \ifjlreq@result\jlreq@hangfalse\else\jlreq@hangtrue\fi + \let\jlreq@second@heading@text@indent@wlabel=\jlreq@result + \jlreq@ifempty{####2}{% + \let\jlreq@second@heading@text@indent@wolabel=\jlreq@second@heading@text@indent@wlabel + }{% + \def\jlreq@second@heading@text@indent@wolabel{####2}% + }% + }% + } {label_format}{\edef\jlreq@label@format{\unexpanded{##1}}} {subtitle_format}{\edef\jlreq@subtitle@format{\unexpanded{##1}}} - *{pagetop_space}{\def\jlreq@pagetop@space{s}}% ページ頭でもスペースを入れる - {pagebreak}[clearpage,cleardoublepage,clearcolumn,nariyuki]{ + {subtitle_indent}{\def\jlreq@subtitle@indent{##1}} + {subtitle_break}[true,false]{\csname jlreq@subtitle@break##1\endcsname} + {afterindent}[true,false]{\edef\jlreq@afterindent{\expandonce{\csname @afterindent##1\endcsname}}} + {allowbreak_if_evenpage}[true,false]{% + \jlreq@switch{##1}{ + {true}{\def\jlreq@allowbreak@evenpage{}} + {false}{\def\jlreq@allowbreak@evenpage{*}} + }% + } + {pagebreak}[clearpage,cleardoublepage,clearcolumn,nariyuki]{% \jlreq@switch{##1}{ {clearpage}{\def\jlreq@pagebreak{\clearpage}} {cleardoublepage}{\def\jlreq@pagebreak{\cleardoublepage}} {clearcolumn}{\if@twocolumn\def\jlreq@pagebreak{\newpage}\else\def\jlreq@pagebreak{}\fi} {nariyuki}{\def\jlreq@pagebreak{}} - } + }% } }{#3}% - \ifx\jlreq@format\@undefined + \ifx\jlreq@font\@empty\else \edef\jlreq@format{% - \expandonce{\jlreq@font}\unexpanded{##1}\unexpanded{##2}% - \unexpanded{##3}% + \expandonce{\jlreq@font}\expandonce{\jlreq@format}% }% \fi - \ifx\jlreq@label@format\@undefined - \def\jlreq@label@format{\@seccntformat{#1}}% - \fi - \ifx\jlreq@subtitle@format\@undefined - \edef\jlreq@subtitle@format{{\unexpanded{\nobreak\par\hspace*{4\jlreq@mol}}\expandonce{\jlreq@subtitle@font}---\unexpanded{##1}---}}% - \fi + \edef\jlreq@label@format@modified{% + \noexpand\noindent + \unexpanded{\setbox\jlreq@tempboxa=\hbox}{\expandonce{\jlreq@label@format}}% + \unexpanded{\hangindent=}% + \ifjlreq@hang + \wd\jlreq@tempboxa + \else + 0pt + \unexpanded{\edef\jlreq@startBlockHeading@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 + \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq@after@label@space}\noexpand\relax}% + \fi + \expandonce{\jlreq@heading@text@format}% + }% + \edef\jlreq@heading@text@format@wolabel{% + \ifdim\dimexpr\jlreq@second@heading@text@indent@wolabel\relax=0pt\else + \noexpand\hangindent=\noexpand\dimexpr\expandonce{\jlreq@second@heading@text@indent@wolabel}\noexpand\relax + \fi + \expandonce{\jlreq@heading@text@format}% + }% + \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 + \ifdim\jlreq@subtitle@indent=0pt\else + \ifjlreq@subtitle@break\else\unexpanded{\hspace*}{\expandonce{\jlreq@subtitle@indent}}\fi + \fi + {\ifx\jlreq@subtitle@font\@empty\else\expandonce{\jlreq@subtitle@font}\fi\expandonce{\jlreq@subtitle@format}}% + }% + }% + \jlreq@make@subtitle@format\jlreq@subtitle@format@wlabel{% + - (\expandonce{\jlreq@second@heading@text@indent@wlabel})% + \ifjlreq@hang\else + (\noexpand\jlreq@startBlockHeading@labellength)\fi + }% + \jlreq@make@subtitle@format\jlreq@subtitle@format@wolabel{- (\expandonce{\jlreq@second@heading@text@indent@wolabel})}% \def\jlreq@addtodo{}% - \@ifundefined{l@#1}{ + \@ifundefined{l@#1}{% % 長さは適当に計測する \begingroup % ちょっと大きめで計測しておく @@ -1651,17 +1790,23 @@ }{}% % before/after_lines優先 \ifx\jlreq@before@space\@empty\else\edef\jlreq@before@space{r:\expandonce{\jlreq@before@space}}\fi - \ifx\jlreq@before@lines\@empty\else\edef\jlreq@before@space{\expandonce{\jlreq@pagetop@space}:\expandonce{\jlreq@before@lines}\baselineskip}\fi + \ifx\jlreq@before@lines\@empty\else\edef\jlreq@before@space{\expandonce{\jlreq@before@lines}\baselineskip}\fi \ifx\jlreq@after@space\@empty\else\edef\jlreq@after@space{r:\expandonce{\jlreq@after@space}}\fi \ifx\jlreq@after@lines\@empty\else\edef\jlreq@after@space{a:\expandonce{\jlreq@after@lines}\baselineskip}\fi - \ifx\jlreq@indent\@empty\else\edef\jlreq@indent{\expandonce{\jlreq@indent}\jlreq@mol}\fi \edef\jlreq@do{% \expandonce{\jlreq@addtodo}% \noexpand\edef\expandonce{\csname #1\endcsname}{\noexpand\unexpanded{% \noexpand\jlreq@hook@beforeheadings{#1}% \expandonce{\jlreq@pagebreak}% - \unexpanded{\jlreq@startBlockHeading{#1}{#2}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@before@space}}{\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@lines}}{{\expandonce{\jlreq@label@format}}{\expandonce{\jlreq@format}}{\expandonce{\jlreq@subtitle@format}}% - }}}% + \unexpanded{\jlreq@startBlockHeading{#1}{#2}}% + {{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@end@indent}}{\expandonce{\jlreq@before@space}}{\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@lines}}{\expandonce{\jlreq@afterindent}}{\expandonce{\jlreq@allowbreak@evenpage}}}% + {% + {\expandonce{\jlreq@label@format}}{\expandonce{\jlreq@label@format@modified}}% + {\expandonce{\jlreq@heading@text@format@wlabel}}{\expandonce{\jlreq@heading@text@format@wolabel}}% + {\expandonce{\jlreq@subtitle@format@wlabel}}{\expandonce{\jlreq@subtitle@format@wolabel}}% + {\expandonce{\jlreq@format}}% + }% + }}% }% \expandafter\endgroup \jlreq@do @@ -1689,21 +1834,27 @@ \@ifundefined{l@#1}{\expandafter\def\csname l@#1\endcsname{\@dottedtocline{#2}{0\jlreq@mol}{2\jlreq@gol}}}{}% \begingroup \def\jlreq@font{\normalfont\normalsize}% - \def\jlreq@indent{0}% + \def\jlreq@indent{0\jlreq@mol}% \def\jlreq@mark{}% + \def\jlreq@label@font{}% + \def\jlreq@after@space{1\jlreq@mol}% \jlreq@parsekeyval[RuninHeading]{% {font}{\def\jlreq@font{##1}} {indent}{\def\jlreq@indent{##1}} {mark}{\def\jlreq@mark{##1}} + {after_space}{% + \ifdim##1<0pt\ClassWarning{jlreq}{after_space in Runin Heading #1 should be positive}\fi + \def\jlreq@after@space{##1}% + } }{#3}% - % \@startsection{#1}{#2}{<indent>*fontsize}{0pt}{-fontsize}{font} + % \@startsection{#1}{#2}{indent}{0pt}{-after_space}{font} \edef\jlreq@do{% \noexpand\def\expandonce{\csname #1\endcsname}{% \unexpanded{\jlreq@hook@beforeheadings{#1}}% \expandafter\jlreq@ifempty\expandafter{\jlreq@mark}{% - \noexpand\@startsection{\unexpanded{#1}}{\unexpanded{#2}}{\expandonce{\jlreq@indent}\noexpand\jlreq@mol}{0pt}{-1\jlreq@fontsize}{\expandonce{\jlreq@font}}% + \noexpand\@startsection{\unexpanded{#1}}{\unexpanded{#2}}{\expandonce{\jlreq@indent}}{0pt}{-\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@font}}% }{% - \noexpand\@startsection{\unexpanded{#1}}{\unexpanded{#2}}{\expandonce{\jlreq@indent}\noexpand\jlreq@mol}{0pt}{-1\jlreq@fontsize}{\noexpand\kern\expandonce{\jlreq@indent}\noexpand\jlreq@mol\expandonce{\jlreq@mark}\noexpand\kern-\expandonce{\jlreq@indent}\noexpand\jlreq@mol\expandonce{\jlreq@font}}% + \noexpand\@startsection{\unexpanded{#1}}{\unexpanded{#2}}{\expandonce{\jlreq@indent}}{0pt}{-\expandonce{\jlreq@after@space}}{\noexpand\kern\expandonce{\jlreq@indent}\expandonce{\jlreq@mark}\noexpand\kern-\expandonce{\jlreq@indent}\expandonce{\jlreq@font}}% }% }% }% @@ -1742,7 +1893,7 @@ \else\def\jlreq@CutinHeading@linecount{1}\fi\fi % \@tempdimaが実際の一行の長さに近い \divide\@tempdima by \jlreq@CutinHeading@linecount - % \jlreq@resultboxに見出し部分を,\jlreq@CutinHeading@linecountに何行使うかを入れる + % \jlreq@resultboxに見出し部分を,\jlreq@CutinHeading@linecountに見出し自身に何行使うかを入れる \ifnum\jlreq@CutinHeading@linecount=1\relax \setbox\jlreq@resultbox=\vbox{\parindent=0pt\rightskip=0pt\leftskip=0pt\hbox{#1#6}}% \def\jlreq@CutinHeading@linecount{2}% @@ -1757,10 +1908,10 @@ \dp\@tempboxa=\dp\jlreq@tempboxa \@tempdima=\wd\@tempboxa % \hang****を設定 - \hangindent=\dimexpr#2\jlreq@mol + \@tempdima + #3\relax\hangafter=-\jlreq@CutinHeading@linecount + \hangindent=\dimexpr#2 + \@tempdima + #3\relax\hangafter=-\jlreq@CutinHeading@linecount \jlreq@hangindent=\hangindent\jlreq@wraplinecount=\hangafter - \hspace*{#2\jlreq@mol}% - \kern-\dimexpr\@tempdima + #3 + \parindent\relax + \hspace*{#2}% + \kern-\dimexpr\hangindent + \parindent\relax \box\@tempboxa \hspace*{#3}% % 改段落が起こっても\hang****をキープするように\parを書き換えておく(終わったら元に戻す). @@ -1791,18 +1942,21 @@ \def\jlreq@fontcommand{\headfont}% \def\jlreq@onelinemax{6\jlreq@fontsize}% \def\jlreq@twolinemax{20\jlreq@fontsize}% - \def\jlreq@indent{0}% - \def\jlreq@afterindent{1\jlreq@mol}% + \def\jlreq@indent{0\jlreq@mol}% + \def\jlreq@after@space{1\jlreq@mol}% \jlreq@parsekeyval[CutinHeading]{ {font}{\def\jlreq@fontcommand{##1}} {onelinemax}{\def\jlreq@onelinemax{##1}} {twolinemax}{\def\jlreq@twolinemax{##1}} {indent}{\def\jlreq@indent{##1}} - {afterindent}{\def\jlreq@afterindent{##1}} + {after_space}{\def\jlreq@after@space{##1}} }{#3}% + \ifthenelse{\lengthtest{\jlreq@after@space < 0.99\jlreq@mol} \OR \lengthtest{\jlreq@after@space > 2.01\jlreq@mol}}{% + \jlreq@warning{窓見出しと本文との空き量は,基本版面の文字サイズの全角以上,2倍未満とする(4.1.10.c)}%& + }{}% \edef\jlreq@do{% \noexpand\def\expandonce{\csname #1\endcsname}{% - \noexpand\jlreq@CutinHeading@start{#1}{\expandonce{\jlreq@fontcommand}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@afterindent}}{\expandonce{\jlreq@onelinemax}}{\expandonce{\jlreq@twolinemax}}% + \noexpand\jlreq@CutinHeading@start{#1}{\expandonce{\jlreq@fontcommand}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@onelinemax}}{\expandonce{\jlreq@twolinemax}}% }% }% \expandafter\endgroup @@ -1830,7 +1984,7 @@ } % 見出し#1をマクロ#2に保存する \newcommand{\SaveHeading}[2]{% - \@ifundefined{jlreq@heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}% + \@ifundefined{jlreq@heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}% \begingroup \edef\jlreq@do{% \unexpanded{\edef#2}{% @@ -1852,20 +2006,6 @@ \jlreq@do } -\setcounter{secnumdepth}{3} -\newcounter{part} -\jlreq@switch{\jlreq@article@type}{ - {article}{\newcounter{section}} - {\newcounter{chapter}\newcounter{section}[chapter]}% book, report -} -\newcounter{subsection}[section] -\newcounter{subsubsection}[subsection] -\newcounter{paragraph}[subsubsection] -\newcounter{subparagraph}[paragraph] -\renewcommand*{\@seccntformat}[1]{\csname the#1\endcsname\hspace{1\jlreq@mol}} -\newcommand*{\headfont}{\gtfamily\sffamily} - - \newcommand*\jlreq@HeadingType[1]{% \expandafter\ifx\csname jlreq@heading@type@#1\endcsname\relax UndefinedHeading \else @@ -1880,7 +2020,47 @@ \expandafter\expandafter\expandafter\ifx\csname jlreq@heading@type@#1\endcsname#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi } +% 全ての見出しにマクロ#1を適用する. +\def\jlreq@heading@execmacro@toallheadings#1{% + \begingroup + \def\jlreq@do{}% + \ifx\jlreq@heading@allheadings\@undefined + \jlreq@heading@execmacro@toallheadings@{#1}{chapter,part,section,subsection,subsubsection,paragraph,subparagraph}% + \else + \def\@tempa{\jlreq@heading@execmacro@toallheadings@{#1}}% + \expandafter\@tempa\expandafter{\jlreq@heading@allheadings}% + \fi + \expandafter\endgroup + \jlreq@do +} + +\def\jlreq@heading@execmacro@toallheadings@#1#2{ + \@for\jlreq@tempa:=#2\do{% + \@ifundefined{\jlreq@tempa}{}{% + \eappto\jlreq@do{\noexpand#1{\expandonce{\jlreq@tempa}}}% + }% + }% +} +\def\jlreq@clearheadingmarks#1{% + \@ifundefined{#1mark}{}{% + \expandafter\let\csname#1mark\endcsname=\@gobble + }% +} + %.. 各種定義 +\setcounter{secnumdepth}{3} +\newcounter{part} +\jlreq@switch{\jlreq@article@type}{ + {article}{\newcounter{section}} + {\newcounter{chapter}\newcounter{section}[chapter]}% book, report +} +\newcounter{subsection}[section] +\newcounter{subsubsection}[subsection] +\newcounter{paragraph}[subsubsection] +\newcounter{subparagraph}[paragraph] +\renewcommand*{\@seccntformat}[1]{\csname the#1\endcsname} +\newcommand*{\headfont}{\sffamily\bfseries} + \if@tate \renewcommand{\thepart}{\Kanji{part}} \ifthenelse{\equal{\jlreq@article@type}{article}}{}{\renewcommand{\thechapter}{\Kanji{chapter}}} @@ -1894,18 +2074,23 @@ (\rensuji{\@arabic\c@subparagraph})} \ifthenelse{\equal{\jlreq@article@type}{article}}{ - \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\headfont}},indent=4,lines=4} + \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\headfont}},indent=4\zh,lines=4,after_label_space=1\zh,second_heading_text_indent={-1\zh,1\zh},subtitle_font={\jlreq@keepbaselineskip{\large}}} + \if@twoside\ModifyHeading{part}{allowbreak_if_evenpage=true}\fi } {% book, report \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@mol}},format={\null\vfill {\Huge\headfont \hspace*{2\jlreq@mol}#1#2}\vspace*{2\jlreq@gol}}} - \NewBlockHeading{chapter}{0}{indent=2,lines=6,label_format={第\thechapter 章\hspace*{1\jlreq@gol}},font={\huge\headfont}} + \NewBlockHeading{chapter}{0}{indent=2\zh,lines=6,label_format={第\thechapter 章},font={\huge\headfont},after_label_space=1\zh,second_heading_text_indent={-1\zh,1\zh},subtitle_font={\jlreq@keepbaselineskip{\Large}}} + \if@twoside\ModifyHeading{chapter}{allowbreak_if_evenpage=true}\fi \renewcommand{\thechapter}{\Kanji{chapter}} } - \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\headfont}},indent=6,lines=3} - \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\headfont}},indent=8,lines=2} - \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=10,lines=1,before_lines=1} + \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\headfont}},indent=6\zh,lines=3,after_label_space=1\zh,second_heading_text_indent={-1\zh,1\zh},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}} + \if@twoside\ModifyHeading{section}{allowbreak_if_evenpage=true}\fi + \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\headfont}},indent=8\zh,lines=2,after_label_space=1\zh,second_heading_text_indent={-1\zh,1\zh},subtitle_font={\jlreq@keepbaselineskip{\small}}} + \if@twoside\ModifyHeading{subsection}{allowbreak_if_evenpage=true}\fi + \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=10\zh,lines=1,before_lines=1,subtitle_break=false,after_label_space=1\zh,second_heading_text_indent={-1\zh,1\zh},,subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}} + \if@twoside\ModifyHeading{subsubsection}{allowbreak_if_evenpage=true}\fi \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize\headfont}}} - \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=1} + \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=1\zh} \else \renewcommand{\thepart}{\Roman{part}} \renewcommand{\thesubsection}{\thesection .\arabic{subsection}} @@ -1913,7 +2098,7 @@ \renewcommand{\theparagraph}{\thesubsubsection .\arabic{paragraph}} \renewcommand{\thesubparagraph}{\theparagraph .\arabic{subparagraph}} \ifthenelse{\equal{\jlreq@article@type}{article}}{ - \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\headfont}},label_format={第\thepart 部\hspace{1\jlreq@mol}},lines=4} + \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\headfont}},label_format={第\thepart 部},lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\large}}} \renewcommand{\thesection}{\arabic{section}} } {% book, report @@ -1921,7 +2106,8 @@ \NewBlockHeading{chapter}{0}{% format={{\jlreq@keepbaselineskip{\huge\headfont} #1#2}#3}, label_format={第\thechapter 章\quad}, - lines=5} + lines=5,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw}, + subtitle_font={\jlreq@keepbaselineskip{\Large}}} \renewcommand{\thechapter}{\arabic{chapter}} \renewcommand{\thesection}{\thechapter.\arabic{section}} \ifthenelse{\equal{\jlreq@article@type}{book}}{ @@ -1930,11 +2116,11 @@ \ModifyHeading{chapter}{pagebreak=clearpage} } } - \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\headfont}},lines=3} - \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\headfont}},lines=2} - \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},lines=1,before_lines=1} - \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=1} - \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=2} + \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\headfont}},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\headfont}},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\headfont}},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\headfont}},indent=1\zw} + \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=2\zw} \fi \ifthenelse{\equal{\jlreq@article@type}{article}}{}{% book, report @@ -2174,7 +2360,7 @@ \expandafter\@tempa\jlreq@tempa\jlreq@endmark \edef\jlreq@tempc{\jlreq@tempc,\jlreq@result} \else - \ClassError{jlreq}{invalid value \jlreq@tempa\space in endnote_position}{\@ehc} + \ClassError{jlreq}{Invalid value \jlreq@tempa\space in endnote_position}{\@ehc} \fi } } @@ -2206,22 +2392,35 @@ \setlength{\marginparsep}{2\jlreq@mol} % フォントサイズ×2(4.2.7:特に問題に~e) {% \footnotesize - \setlength{\jlreq@tempdima}{\dimexpr \paperwidth - \textwidth - 1in - \oddsidemargin - \marginparsep\relax} + % \jlreq@tempdimaにマージン最小値を入れる + \if@tate + \setlength{\jlreq@tempdima}{\dimexpr\paperheight - \topmargin - \headheight - \headsep - \voffset - 1in - \textwidth\relax} + \if@twocolumn + \ifdim\jlreq@tempdima>\dimexpr\paperheight - \jlreq@tempdima - \textwidth\relax + \setlength{\jlreq@tempdima}{\dimexpr\paperheight - \jlreq@tempdima - \textwidth\relax} + \fi + \fi + \else + \setlength{\jlreq@tempdima}{\dimexpr \paperwidth - \textwidth - 1in - \oddsidemargin - \marginparsep\relax} + \ifdim\jlreq@tempdima>\dimexpr\oddsidemargin + 1in\relax + \setlength{\jlreq@tempdima}{\dimexpr\oddsidemargin + 1in\relax} + \fi + \fi \ifx\jlreq@option@sidenote@width\@empty - \setlength{\marginparwidth}{\dimexpr\jlreq@tempdima-2\jlreq@fontsize\relax} + \setlength{\marginparwidth}{\dimexpr\jlreq@tempdima - 2\jlreq@fontsize - \marginparsep\relax} + % 4.7.2.b: 並列中の行長は15文から20字程度 + \ifdim\marginparwidth>20\jlreq@mol + \global\marginparwidth=20\jlreq@mol + \fi \else \setlength{\marginparwidth}{\jlreq@speciallength{\jlreq@option@sidenote@width}} \ifnum\marginparwidth>\jlreq@tempdima \ClassWarningNoLine{jlreq}{sidenote_width is greater than the width of the margin} \fi \fi - \ifdim\marginparwidth>18\jlreq@mol - \global\marginparwidth=18\jlreq@mol - \else - \@tempdima=1\zw% 1\jlreq@mol - \global\divide\marginparwidth\@tempdima - \global\multiply\marginparwidth\@tempdima - \fi + \@tempdima=1\zw% 1\jlreq@mol + \global\divide\marginparwidth\@tempdima + \global\multiply\marginparwidth\@tempdima \global\setlength{\marginparpush}{.5\@tempdima} % 同上:g } @@ -2620,7 +2819,7 @@ {mark_format}{\edef\jlreq@mark@format{\unexpanded{##1}}} {command}{\edef\jlreq@command{\unexpanded{##1}}} {gap}{\def\jlreq@gap{##1}} - *{no_clear_mark}{\jlreq@clearmarkfalse} + {clear_mark}[true,false]{\csname jlreq@clearmark##1\endcsname} }{#2}% \ifthenelse{\( \boolean{@tate} \AND \( @@ -2747,7 +2946,7 @@ {left}{\def\jlreq@tempe{right}} }% \edef##1{{\expandafter\@firstoftwo##1}{\jlreq@tempe}}% - } + }% \getoppositeposition\jlreq@nombre@position \getoppositeposition\jlreq@running@head@position % 上と同じことをする @@ -2783,33 +2982,6 @@ \jlreq@do } -% 全ての見出しにマクロ#1を適用する. -\def\jlreq@heading@execmacro@toallheadings#1{% - \begingroup - \def\jlreq@do{}% - \ifx\jlreq@heading@allheadings\@undefined - \jlreq@heading@execmacro@toallheadings@{#1}{chapter,part,section,subsection,subsubsection,paragraph,subparagraph}% - \else - \def\@tempa{\jlreq@heading@execmacro@toallheadings@{#1}}% - \expandafter\@tempa\expandafter{\jlreq@heading@allheadings}% - \fi - \expandafter\endgroup - \jlreq@do -} - -\def\jlreq@heading@execmacro@toallheadings@#1#2{ - \@for\jlreq@tempa:=#2\do{% - \@ifundefined{\jlreq@tempa}{}{% - \eappto\jlreq@do{\noexpand#1{\expandonce{\jlreq@tempa}}}% - }% - }% -} -\def\jlreq@clearheadingmarks#1{% - \@ifundefined{#1mark}{}{% - \expandafter\let\csname#1mark\endcsname=\@gobble - }% -} - \newcommand*{\NewPageStyle}[2]{% \expandafter\@ifdefinable\csname ps@#1\endcsname{\DeclarePageStyle{#1}{#2}}% } @@ -2845,8 +3017,8 @@ \ModifyPageStyle{headings}{mark_format={_chapter={第\thechapter 章\quad #1}}} } \if@tate - \RenewPageStyle{plain}{nombre=\thepage,odd_running_head={},even_running_head={},no_clear_mark} - \NewPageStyle{myheadings}{nombre=\thepage,odd_running_head=\rightmark,even_running_head=\leftmark,no_clear_mark} + \RenewPageStyle{plain}{nombre=\thepage,odd_running_head={},even_running_head={},clear_mark=false} + \NewPageStyle{myheadings}{nombre=\thepage,odd_running_head=\rightmark,even_running_head=\leftmark,clear_mark=false} \if@twoside \ModifyPageStyle{plain}{nombre_position={top-left}} \ModifyPageStyle{headings}{nombre=\thepage,nombre_position=bottom-left,running_head_position=top-left} @@ -2857,9 +3029,9 @@ \ModifyPageStyle{myheadings}{nombre_position=bottom-center,running_head_position=top-center} \fi \else% yoko - \RenewPageStyle{plain}{nombre=\thepage,odd_running_head={},even_running_head={},nombre_position={bottom-center},no_clear_mark} + \RenewPageStyle{plain}{nombre=\thepage,odd_running_head={},even_running_head={},nombre_position={bottom-center},clear_mark=false} \ModifyPageStyle{headings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center} - \NewPageStyle{myheadings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center,odd_running_head=\rightmark,even_running_head=\leftmark,no_clear_mark} + \NewPageStyle{myheadings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center,odd_running_head=\rightmark,even_running_head=\leftmark,clear_mark=false} \fi %. フロート関連 @@ -3081,7 +3253,7 @@ \null\vfil \@beginparpenalty\@lowpenalty \begin{center}% - {\bfseries\gtfamily\abstractname}% + {\sffamily\bfseries\abstractname}% \@endparpenalty\@M \end{center}% \par @@ -3109,15 +3281,31 @@ \small \parindent=1\jlreq@mol \begin{center}% - {\bfseries\abstractname}% + {\sffamily\bfseries\abstractname}% \end{center}% - \quotation + \list{}{% + \listparindent\parindent + \itemindent\listparindent + \labelwidth\z@ + \labelsep\z@ + \leftmargin=2\jlreq@mol + \rightmargin\leftmargin + \@tempdima=1\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\jlreq@mol\relax\fi + \leftmargin=\dimexpr\leftmargin + (\@tempdimc - \@tempdimb)/2\relax + \rightmargin=\dimexpr\rightmargin + (\@tempdimc - \@tempdimb)/2\relax + \parsep\z@ \@plus.1\jlreq@gol + }% + \item\relax \else \section*{\abstractname}% \fi }{% \ifnum0\if@twocolumn\else1\fi\ifjlreq@preamble1\fi>0 - \endquotation + \endlist \egroup \vspace{\baselineskip}% \if@twocolumn @@ -3199,7 +3387,7 @@ \renewcommand{\theenumi}{\Kanji{enumi}} \renewcommand{\theenumii}{\rensuji{\@arabic\c@enumii}} \renewcommand{\theenumiii}{\rensuji{\@arabic\c@enumiii}} - \renewcommand{\theenumiv}{\rensuji{\@arabc\c@enumiv}} + \renewcommand{\theenumiv}{\rensuji{\@arabic\c@enumiv}} \fi \newcommand{\labelenumi}{\theenumi} \newcommand{\labelenumii}{\theenumii} @@ -3227,23 +3415,47 @@ \listparindent\itemindent \labelwidth\z@ \labelsep\z@ - \leftmargin=2\jlreq@mol - \rightmargin\leftmargin \advance\leftmargin 2\jlreq@mol}% + \leftmargin=\jlreq@speciallength{\jlreq@quote@indent}% + \addtolength{\leftmargin}{2\jlreq@mol}% + \rightmargin=\jlreq@speciallength{\jlreq@quote@end@indent}% + \csname\jlreq@quote@fontsize\endcsname + \@tempdima=1\zw + \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax + \@tempdimc=\@tempdimb + \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima + \topsep=\jlreq@speciallength{\jlreq@quote@beforeafter@space}% + \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax}% \item\relax}{\endlist} \newenvironment{quotation} - {\list{}{\listparindent\parindent + {\list{}{% + \leftmargin=\jlreq@speciallength{\jlreq@quote@indent}% + \rightmargin=\jlreq@speciallength{\jlreq@quote@end@indent}% + \csname\jlreq@quote@fontsize\endcsname + \@tempdima=1\zw + \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax + \@tempdimc=\@tempdimb + \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima + \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax + \listparindent\parindent \itemindent\listparindent \labelwidth\z@ \labelsep\z@ - \leftmargin=2\jlreq@mol - \rightmargin\leftmargin + \topsep=\jlreq@speciallength{\jlreq@quote@beforeafter@space}% \parsep\z@ \@plus.1\jlreq@gol}% \item\relax}{\endlist} \newenvironment{quote} {\list{}{% - \rightmargin\leftmargin + \leftmargin=\jlreq@speciallength{\jlreq@quote@indent}% + \rightmargin=\jlreq@speciallength{\jlreq@quote@end@indent}% + \csname\jlreq@quote@fontsize\endcsname + \@tempdima=1\zw + \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax + \@tempdimc=\@tempdimb + \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima + \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax \labelwidth\z@ - \leftmargin=2\jlreq@mol + \itemindent\z@ + \topsep=\jlreq@speciallength{\jlreq@quote@beforeafter@space}% \listparindent\z@}% \item\relax}{\endlist} @@ -3429,7 +3641,7 @@ \ifthenelse{\equal{\jlreq@article@type}{book}}{ \newif\if@mainmatter \@mainmattertrue - \newcommand*\frontmatter{% + \newcommand*{\frontmatter}{% \if@openright \cleardoublepage \else @@ -3437,13 +3649,11 @@ \fi \@mainmatterfalse \let\jlreq@pagestyle@atmain\jlreq@current@pagestyle - \ifthenelse{\equal{\jlreq@article@type}{article}}{}{%book, report - \SaveHeading{chapter}{\jlreq@heading@chapter@atmain}% - \ModifyHeading{chapter}{label_format={}}% - }% + \SaveHeading{chapter}{\jlreq@heading@chapter@atmain}% + \ModifyHeading{chapter}{label_format={}}% \pagestyle{plain}% \pagenumbering{roman}} - \newcommand*\mainmatter{% + \newcommand*{\mainmatter}{% \cleardoublepage \@mainmattertrue \@ifundefined{jlreq@pagestyle@atmain}{}{% @@ -3452,7 +3662,7 @@ \@ifundefined{jlreq@heading@chapter@atmain}{}{\jlreq@heading@chapter@atmain}% \setcounter{chapter}{0}% \pagenumbering{arabic}} - \newcommand*\backmatter{% + \newcommand*{\backmatter}{% \if@openright \cleardoublepage \else @@ -3466,7 +3676,7 @@ \@mainmatterfalse \setcounter{chapter}{0}} }{} -\newcommand*\appendix{\par +\newcommand*{\appendix}{\par \setcounter{section}{0}% } @@ -3530,9 +3740,11 @@ %. 定理環境 \def\jlreq@theorem@abovebelowspace{1\baselineskip}%とりあえず前後に一行分のアキ +\let\jlreq@original@@begintheorem=\@begintheorem \def\@begintheorem#1#2{\topsep=\jlreq@theorem@abovebelowspace \trivlist\labelsep=1\jlreq@mol \item[\hskip \labelsep{\headfont #1\ #2}]} +\let\jlreq@original@@opargbegintheorem=\@opargbegintheorem \def\@opargbegintheorem#1#2#3{\topsep=\jlreq@theorem@abovebelowspace \trivlist\labelsep=1\jlreq@mol \item[\hskip \labelsep{\headfont #1\ #2(#3)}]} |