diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/jlreq/jlreq.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq.cls | 764 |
1 files changed, 369 insertions, 395 deletions
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls index e8c784eafa0..0b062cf4363 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/12/02 jlreq] +\ProvidesClass{jlreq}[2017/12/22 jlreq] \RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen} %. helper1 @@ -101,12 +101,54 @@ } \jlreq@do +% #1(skipレジスタ)が0か(展開不可). \def\jlreq@ifgluezero#1{% - \edef\@tempa{\the#1}% - \edef\@tempb{\detokenize{0.0pt}}% - \ifx\@tempa\@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + \begingroup + \edef\@tempa{\the#1}% + \edef\@tempb{\detokenize{0.0pt}}% + \edef\jlreq@do{\ifx\@tempa\@tempb\noexpand\@firstoftwo\else\noexpand\@secondoftwo\fi}% + \expandafter\endgroup + \jlreq@do } +% #1が#2で終わるか(展開不可) +\def\jlreq@ifendswith#1#2{% + \jlreq@ifempty{#2}{\@firstoftwo}{% + \begingroup + \def\jlreq@tempa##1#2\jlreq@uniqtoken##2\jlreq@endmark{% + \edef\jlreq@do{\jlreq@ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}% + }% + \jlreq@tempa#1\jlreq@uniqtoken#2\jlreq@uniqtoken\jlreq@endmark + \expandafter\endgroup + \jlreq@do + }% +} +% #1が#2で始まるか(展開不可) +\def\jlreq@ifstartswith#1#2{% + \jlreq@ifempty{#2}{\@firstoftwo}{% + \jlreq@ifempty{#1}{\@secondoftwo}{% + \begingroup + \def\jlreq@tempa##1#2##2\jlreq@endmark{% + \edef\jlreq@do{\jlreq@ifempty{##1}{\noexpand\@firstoftwo}{\noexpand\@secondoftwo}}% + }% + \jlreq@tempa#1#2\jlreq@endmark + \expandafter\endgroup + \jlreq@do + }% + }% +} +% #1が#2を含むか(展開不可){}内に#2があってもFALSE判定. +\def\jlreq@ifcontains#1#2{% + \jlreq@ifempty{#2}{\@firstoftwo}{% + \begingroup + \def\jlreq@tempa##1#2##2\jlreq@endmark{% + \edef\jlreq@do{\jlreq@ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}% + }% + \jlreq@tempa#1#2\jlreq@endmark + \expandafter\endgroup + \jlreq@do + }% +} % @removeelementの括弧があっても動くかもしれない版 % 次の変数を使う:\jlreq@tempa:消したいやつ,\jlreq@tempb:消していない分を放り込んでいく @@ -144,7 +186,7 @@ \ifx\jlreq@nextchar\reserved@d\let\reserved@b\reserved@a\fi \reserved@b } -% \@ifsart +% 空白を無視しない\@ifsart \def\jlreq@ifstar#1#2{\jlreq@ifnextchar *{\edef\reserved@a*{\unexpanded{#1}}\reserved@a}{#2}} % カンマで区切って,その前と後ろを\jlreq@resulta,\jlreq@resultbに入れる % もしカンマがない場合は\ifjlreq@resultがfalseになる. @@ -849,282 +891,171 @@ \xkanjiskip=\jlreq@xkanjiskip \fi -% 禁則処理,表1,2に従う -% 行末 -% 初め括弧類 +% 文字クラスのリスト(必要なものだけ) +% 開き括弧(文字クラス1) +\edef\jlreq@charlist@openingbrackets{(〔[{〈《「『【‘“\ifx p\jlreq@engine\else ⦅〘〖«〝\fi} +% 閉じ括弧(文字クラス2) +\edef\jlreq@charlist@closingbrackets{)〕]}〉》」』】’”\ifx p\jlreq@engine\else⦆〙〗»〟\fi} +% ハイフン(文字クラス3) +\edef\jlreq@charlist@hyphens{‐〜\ifx p\jlreq@engine\else ゠–\fi} +% 区切り約物(文字クラス4) +\edef\jlreq@charlist@dividingpunctuationmarks{!?\ifx p\jlreq@engine\else ‼⁇⁈⁉\fi} +% 中点類(文字クラス5) +\edef\jlreq@charlist@middlenodes{・:;} +% 句点類(文字クラス6) +\edef\jlreq@charlist@fullstops{。.} +% 読点類(文字クラス7) +\edef\jlreq@charlist@commas{、,} +% 分離禁止文字(文字クラス8) +\edef\jlreq@charlist@inseparablecharacters{—…‥\ifx p\jlreq@engine\else 〳〴〵\fi} +% 繰返し記号(文字クラス9) +\edef\jlreq@charlist@iterationmarks{ヽヾゝゞ々\ifx p\jlreq@engine\else 〻\fi} +% 長音記号(文字クラス10) +\edef\jlreq@charlist@prolongedsoundmark{ー} +% 小書きの仮名(文字クラス11) +\edef\jlreq@charlist@smallkana{ぁぃぅぇぉァィゥェォっゃゅょゎッャュョヮヵヶ\ifx p\jlreq@engine\else ゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ\fi}%ㇷ゚ +% 前置省略記号(文字クラス12) +\edef\jlreq@charlist@prefixedabbreviations{¥$£#\ifx p\jlreq@engine\else €№\fi} +% 平仮名(文字クラス15) +\edef\jlreq@charlist@hiragana{あいうえおかがきぎくぐけげこごさざしじすずせぜそぞただちぢつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもやゆよらりるれろわゐゑをん\ifx p\jlreq@engine\else ゔ\fi}% か゚き゚く゚け゚こ゚ +% 片仮名(文字クラス16) +\edef\jlreq@charlist@katakana{アイウエオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモヤユヨラリルレロワヰヱヲンヴ\ifx p\jlreq@engine\else ヷヸヹヺ\fi}% カ゚キ゚ク゚ケ゚コ゚セ゚ツ゚ト゚ + \ifx l\jlreq@engine - \newcommand*{\jlreq@setpostbreakpenalty}[2]{\ltjsetparameter{postbreakpenalty={`#1,#2}}} - \newcommand*{\jlreq@setprebreakpenalty}[2]{\ltjsetparameter{prebreakpenalty={`#1,#2}}} - \newcommand*{\jlreq@setjaxspmode}[2]{\ltjsetparameter{jaxspmode={`#1,#2}}} + \newcommand*{\jlreq@setpostbreakpenalty@}[2]{\ltjsetparameter{postbreakpenalty={`#1,#2}}} + \newcommand*{\jlreq@setprebreakpenalty@}[2]{\ltjsetparameter{prebreakpenalty={`#1,#2}}} + \newcommand*{\jlreq@addjaxspmode@}[2]{% + \jlreq@tempcnta=\ltjgetparameter{jaxspmode}{`#1}% + \jlreq@switch{#2}{ + {pre}{% + \ifnum\jlreq@tempcnta=2 + \ltjsetparameter{jaxspmode={`#1,allow}}% + \else\ifnum\jlreq@tempcnta=0 + \ltjsetparameter{jaxspmode={`#1,preonly}}% + \fi\fi + } + {post}{% + \ifnum\jlreq@tempcnta=1 + \ltjsetparameter{jaxspmode={`#1,allow}}% + \else\ifnum\jlreq@tempcnta=0 + \ltjsetparameter{jaxspmode={`#1,postonly}}% + \fi\fi + } + }% + } + \newcommand*{\jlreq@deljaxspmode@}[2]{% + \jlreq@tempcnta=\ltjgetparameter{jaxspmode}{`#1}% + \jlreq@switch{#2}{ + {pre}{% + \ifnum\jlreq@tempcnta=2 + \ltjsetparameter{jaxspmode={`#1,postonly}}% + \else\ifnum\jlreq@tempcnta=1 + \ltjsetparameter{jaxspmode={`#1,inhibit}}% + \fi\fi + } + {post}{% + \ifnum\jlreq@tempcnta=3 + \ltjsetparameter{jaxspmode={`#1,preonly}}% + \else\ifnum\jlreq@tempcnta=2 + \ltjsetparameter{jaxspmode={`#1,inhibit}}% + \fi\fi + } + }% + } \else - \newcommand*{\jlreq@setpostbreakpenalty}[2]{\postbreakpenalty`#1=#2} - \newcommand*{\jlreq@setprebreakpenalty}[2]{\prebreakpenalty`#1=#2} - \newcommand*{\jlreq@setjaxspmode}[2]{% + \newcommand*{\jlreq@setpostbreakpenalty@}[2]{\postbreakpenalty`#1=#2} + \newcommand*{\jlreq@setprebreakpenalty@}[2]{\prebreakpenalty`#1=#2} + \newcommand*{\jlreq@addjaxspmode@}[2]{% + \jlreq@tempcnta=\inhibitxspcode`#1 \jlreq@switch{#2}{ - {inhibit}{\inhibitxspcode`#1=0} - {preonly}{\inhibitxspcode`#1=1} - {postonly}{\inhibitxspcode`#1=2} - {allow}{\inhibitxspcode`#1=3} - {\inhibitxspcode`#1=#2} - } + {pre}{% + \ifnum\jlreq@tempcnta=1 + \inhibitxspcode`#1=3 + \else\ifnum\jlreq@tempcnta=0 + \inhibitxspcode`#1=2 + \fi\fi + } + {post}{% + \ifnum\jlreq@tempcnta=2 + \inhibitxspcode`#1=3 + \else\ifnum\jlreq@tempcnta=0 + \inhibitxspcode`#1=1 + \fi\fi + } + }% + } + \newcommand*{\jlreq@deljaxspmode@}[2]{% + \jlreq@tempcnta=\inhibitxspcode`#1 + \jlreq@switch{#2}{ + {pre}{% + \ifnum\jlreq@tempcnta=3 + \inhibitxspcode`#1=1 + \else\ifnum\jlreq@tempcnta=2 + \inhibitxspcode`#1=0 + \fi\fi + } + {post}{% + \ifnum\jlreq@tempcnta=3 + \inhibitxspcode`#1=2 + \else\ifnum\jlreq@tempcnta=1 + \inhibitxspcode`#1=0 + \fi\fi + } + }% } \fi +% #1{...}{#3}を...が#2のリストに対して適用. +\newcommand*\jlreq@iterateapply[3]{% + \edef\jlreq@tempa{#2}% + \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq@tempa\do{% + \expandafter#1\expandafter{\@tempa}{#3}% + }% +} +\def\jlreq@setpostbreakpenalty{\jlreq@iterateapply{\jlreq@setpostbreakpenalty@}} +\def\jlreq@setprebreakpenalty{\jlreq@iterateapply{\jlreq@setprebreakpenalty@}} +\def\jlreq@addjaxspmode{\jlreq@iterateapply{\jlreq@addjaxspmode@}} +\def\jlreq@deljaxspmode{\jlreq@iterateapply{\jlreq@deljaxspmode@}} + +\jlreq@aftercls@addtodeletecs{\jlreq@iterateapply} \jlreq@aftercls@addtodeletecs{\jlreq@setpostbreakpenalty} +\jlreq@aftercls@addtodeletecs{\jlreq@setpostbreakpenalty@} \jlreq@aftercls@addtodeletecs{\jlreq@setprebreakpenalty} -\jlreq@aftercls@addtodeletecs{\jlreq@setjaxspmode} - -\jlreq@setpostbreakpenalty{(}{10000} -\jlreq@setpostbreakpenalty{〔}{10000} -\jlreq@setpostbreakpenalty{[}{10000} -\jlreq@setpostbreakpenalty{{}{10000} -\jlreq@setpostbreakpenalty{〈}{10000} -\jlreq@setpostbreakpenalty{《}{10000} -\jlreq@setpostbreakpenalty{「}{10000} -\jlreq@setpostbreakpenalty{『}{10000} -\jlreq@setpostbreakpenalty{【}{10000} -\ifx p\jlreq@engine\else -\jlreq@setpostbreakpenalty{⦅}{10000} -\jlreq@setpostbreakpenalty{〘}{10000} -\jlreq@setpostbreakpenalty{〖}{10000} -\jlreq@setpostbreakpenalty{«}{10000} -\jlreq@setpostbreakpenalty{〝}{10000} -\fi -\jlreq@setpostbreakpenalty{‘}{10000} -\jlreq@setpostbreakpenalty{“}{10000} -% 前置省略記号 -\jlreq@setpostbreakpenalty{¥}{10000} -\jlreq@setpostbreakpenalty{$}{10000} -\jlreq@setpostbreakpenalty{£}{10000} -\jlreq@setpostbreakpenalty{#}{10000} -\ifx p\jlreq@engine\else -\jlreq@setpostbreakpenalty{€}{10000} -\jlreq@setpostbreakpenalty{№}{10000} -\fi -% 行頭 -% 終わり括弧類 -\jlreq@setprebreakpenalty{)}{10000} -\jlreq@setprebreakpenalty{〕}{10000} -\jlreq@setprebreakpenalty{]}{10000} -\jlreq@setprebreakpenalty{}}{10000} -\jlreq@setprebreakpenalty{〉}{10000} -\jlreq@setprebreakpenalty{》}{10000} -\jlreq@setprebreakpenalty{」}{10000} -\jlreq@setprebreakpenalty{』}{10000} -\jlreq@setprebreakpenalty{】}{10000} -\ifx p\jlreq@engine\else -\jlreq@setprebreakpenalty{⦆}{10000} -\jlreq@setprebreakpenalty{〙}{10000} -\jlreq@setprebreakpenalty{〗}{10000} -\jlreq@setprebreakpenalty{»}{10000} -\jlreq@setprebreakpenalty{〟}{10000} -\fi -\jlreq@setprebreakpenalty{’}{10000} -\jlreq@setprebreakpenalty{”}{10000} -% ハイフン類 -\jlreq@setprebreakpenalty{‐}{10000} -\ifx p\jlreq@engine\else -\jlreq@setprebreakpenalty{゠}{10000} -\jlreq@setprebreakpenalty{–}{10000} -\jlreq@setprebreakpenalty{〜}{10000} -\fi -% 区切り約物 -\jlreq@setprebreakpenalty{!}{10000} -\jlreq@setprebreakpenalty{?}{10000} -\ifx p\jlreq@engine\else -\jlreq@setprebreakpenalty{‼}{10000} -\jlreq@setprebreakpenalty{⁇}{10000} -\jlreq@setprebreakpenalty{⁈}{10000} -\jlreq@setprebreakpenalty{⁉}{10000} -\fi -% 中点類 -\jlreq@setprebreakpenalty{・}{10000} -\jlreq@setprebreakpenalty{:}{10000} -\jlreq@setprebreakpenalty{;}{10000} -% 句点類 -\jlreq@setprebreakpenalty{。}{10000} -\jlreq@setprebreakpenalty{.}{10000} -% 読点類 -\jlreq@setprebreakpenalty{、}{10000} -\jlreq@setprebreakpenalty{,}{10000} -% 繰返し記号 -\jlreq@setprebreakpenalty{ヽ}{10000} -\jlreq@setprebreakpenalty{ヾ}{10000} -\jlreq@setprebreakpenalty{ゝ}{10000} -\jlreq@setprebreakpenalty{ゞ}{10000} -\jlreq@setprebreakpenalty{々}{10000} -\ifx p\jlreq@engine\else -\jlreq@setprebreakpenalty{〻}{10000} -\fi -% 長音記号 -\jlreq@setprebreakpenalty{ー}{10000} -% 小書きの仮名 -\jlreq@setprebreakpenalty{ぁ}{10000} -\jlreq@setprebreakpenalty{ぃ}{10000} -\jlreq@setprebreakpenalty{ぅ}{10000} -\jlreq@setprebreakpenalty{ぇ}{10000} -\jlreq@setprebreakpenalty{ぉ}{10000} -\jlreq@setprebreakpenalty{ァ}{10000} -\jlreq@setprebreakpenalty{ィ}{10000} -\jlreq@setprebreakpenalty{ゥ}{10000} -\jlreq@setprebreakpenalty{ェ}{10000} -\jlreq@setprebreakpenalty{ォ}{10000} -\jlreq@setprebreakpenalty{っ}{10000} -\jlreq@setprebreakpenalty{ゃ}{10000} -\jlreq@setprebreakpenalty{ゅ}{10000} -\jlreq@setprebreakpenalty{ょ}{10000} -\jlreq@setprebreakpenalty{ゎ}{10000} -\ifx p\jlreq@engine\else -\jlreq@setprebreakpenalty{ゕ}{10000} -\jlreq@setprebreakpenalty{ゖ}{10000} -\fi -\jlreq@setprebreakpenalty{ッ}{10000} -\jlreq@setprebreakpenalty{ャ}{10000} -\jlreq@setprebreakpenalty{ュ}{10000} -\jlreq@setprebreakpenalty{ョ}{10000} -\jlreq@setprebreakpenalty{ヮ}{10000} -\jlreq@setprebreakpenalty{ヵ}{10000} -\jlreq@setprebreakpenalty{ヶ}{10000} -\ifx p\jlreq@engine\else -\jlreq@setprebreakpenalty{ㇰ}{10000} -\jlreq@setprebreakpenalty{ㇱ}{10000} -\jlreq@setprebreakpenalty{ㇲ}{10000} -\jlreq@setprebreakpenalty{ㇳ}{10000} -\jlreq@setprebreakpenalty{ㇴ}{10000} -\jlreq@setprebreakpenalty{ㇵ}{10000} -\jlreq@setprebreakpenalty{ㇶ}{10000} -\jlreq@setprebreakpenalty{ㇷ}{10000} -\jlreq@setprebreakpenalty{ㇸ}{10000} -\jlreq@setprebreakpenalty{ㇹ}{10000} -\jlreq@setprebreakpenalty{ㇺ}{10000} -\jlreq@setprebreakpenalty{ㇻ}{10000} -\jlreq@setprebreakpenalty{ㇼ}{10000} -\jlreq@setprebreakpenalty{ㇽ}{10000} -\jlreq@setprebreakpenalty{ㇾ}{10000} -\jlreq@setprebreakpenalty{ㇿ}{10000} -\fi +\jlreq@aftercls@addtodeletecs{\jlreq@setprebreakpenalty@} +\jlreq@aftercls@addtodeletecs{\jlreq@addjaxspmode} +\jlreq@aftercls@addtodeletecs{\jlreq@addjaxspmode@} +\jlreq@aftercls@addtodeletecs{\jlreq@deljaxspmode} +\jlreq@aftercls@addtodeletecs{\jlreq@deljaxspmode@} + +% 行末禁則 +\jlreq@setpostbreakpenalty{\jlreq@charlist@openingbrackets}{10000} +\jlreq@setpostbreakpenalty{\jlreq@charlist@prefixedabbreviations}{10000} + +% 行頭禁則 +\jlreq@setprebreakpenalty{\jlreq@charlist@closingbrackets}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@hyphens}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@dividingpunctuationmarks}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@middlenodes}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@fullstops}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@commas}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@iterationmarks}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@prolongedsoundmark}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@smallkana}{10000} % xkanjiskip -% 初め括弧類(二分) -\jlreq@setjaxspmode{(}{preonly} -\jlreq@setjaxspmode{〔}{preonly} -\jlreq@setjaxspmode{[}{preonly} -\jlreq@setjaxspmode{{}{preonly} -\jlreq@setjaxspmode{〈}{preonly} -\jlreq@setjaxspmode{《}{preonly} -\jlreq@setjaxspmode{「}{preonly} -\jlreq@setjaxspmode{『}{preonly} -\jlreq@setjaxspmode{【}{preonly} -\ifx p\jlreq@engine\else -\jlreq@setjaxspmode{⦅}{preonly} -\jlreq@setjaxspmode{〘}{preonly} -\jlreq@setjaxspmode{〖}{preonly} -\jlreq@setjaxspmode{«}{preonly} -\jlreq@setjaxspmode{〝}{preonly} -\fi -\jlreq@setjaxspmode{‘}{preonly} -\jlreq@setjaxspmode{“}{preonly} -% 終わり括弧類(二分) -\jlreq@setjaxspmode{)}{postonly} -\jlreq@setjaxspmode{〕}{postonly} -\jlreq@setjaxspmode{]}{postonly} -\jlreq@setjaxspmode{}}{postonly} -\jlreq@setjaxspmode{〉}{postonly} -\jlreq@setjaxspmode{》}{postonly} -\jlreq@setjaxspmode{」}{postonly} -\jlreq@setjaxspmode{』}{postonly} -\jlreq@setjaxspmode{】}{postonly} -\ifx p\jlreq@engine\else -\jlreq@setjaxspmode{⦆}{postonly} -\jlreq@setjaxspmode{〙}{postonly} -\jlreq@setjaxspmode{〗}{postonly} -\jlreq@setjaxspmode{»}{postonly} -\jlreq@setjaxspmode{〟}{postonly} -\fi -\jlreq@setjaxspmode{’}{postonly} -\jlreq@setjaxspmode{”}{postonly} -% ハイフン類(二分) -\jlreq@setjaxspmode{‐}{inhibit} -\ifx p\jlreq@engine\else -\jlreq@setjaxspmode{゠}{inhibit} -\jlreq@setjaxspmode{–}{inhibit} -\jlreq@setjaxspmode{〜}{inhibit} -\fi -% 区切り約物 -\jlreq@setjaxspmode{!}{postonly} -\jlreq@setjaxspmode{?}{postonly} -\ifx p\jlreq@engine\else -\jlreq@setjaxspmode{‼}{postonly} -\jlreq@setjaxspmode{⁇}{postonly} -\jlreq@setjaxspmode{⁈}{postonly} -\jlreq@setjaxspmode{⁉}{postonly} -\fi -% 中点類 -\jlreq@setjaxspmode{・}{postonly} -\jlreq@setjaxspmode{:}{postonly} -\jlreq@setjaxspmode{;}{postonly} -% 句点類(二分) -\jlreq@setjaxspmode{。}{postonly} -\jlreq@setjaxspmode{.}{postonly} -% 読点類(二分) -\jlreq@setjaxspmode{、}{postonly} -\jlreq@setjaxspmode{,}{postonly} -% 分離禁止文字 -\jlreq@setjaxspmode{—}{inhibit} -\jlreq@setjaxspmode{…}{inhibit} -\jlreq@setjaxspmode{‥}{inhibit} -\ifx p\jlreq@engine\else -\jlreq@setjaxspmode{〳}{inhibit} -\jlreq@setjaxspmode{〴}{inhibit} -\jlreq@setjaxspmode{〵}{inhibit} -\fi -% 前置省略記号 -\jlreq@setjaxspmode{¥}{inhibit} -\jlreq@setjaxspmode{$}{inhibit} -\jlreq@setjaxspmode{£}{inhibit} -\jlreq@setjaxspmode{#}{inhibit} -\ifx p\jlreq@engine\else -\jlreq@setjaxspmode{€}{inhibit} -\jlreq@setjaxspmode{№}{inhibit} -\fi -% 後置省略記号 -\jlreq@setjaxspmode{°}{inhibit} -\jlreq@setjaxspmode{′}{inhibit} -\jlreq@setjaxspmode{″}{inhibit} -\jlreq@setjaxspmode{℃}{inhibit} -\jlreq@setjaxspmode{¢}{inhibit} -\jlreq@setjaxspmode{%}{inhibit} -\jlreq@setjaxspmode{‰}{inhibit} -\ifx p\jlreq@engine\else -\jlreq@setjaxspmode{㏋}{inhibit} -\jlreq@setjaxspmode{ℓ}{inhibit} -\jlreq@setjaxspmode{㌃}{inhibit} -\jlreq@setjaxspmode{㌍}{inhibit} -\jlreq@setjaxspmode{㌔}{inhibit} -\jlreq@setjaxspmode{㌘}{inhibit} -\jlreq@setjaxspmode{㌢}{inhibit} -\jlreq@setjaxspmode{㌣}{inhibit} -\jlreq@setjaxspmode{㌦}{inhibit} -\jlreq@setjaxspmode{㌧}{inhibit} -\jlreq@setjaxspmode{㌫}{inhibit} -\jlreq@setjaxspmode{㌶}{inhibit} -\jlreq@setjaxspmode{㌻}{inhibit} -\jlreq@setjaxspmode{㍉}{inhibit} -\jlreq@setjaxspmode{㍊}{inhibit} -\jlreq@setjaxspmode{㍍}{inhibit} -\jlreq@setjaxspmode{㍑}{inhibit} -\jlreq@setjaxspmode{㍗}{inhibit} -\jlreq@setjaxspmode{㎎}{inhibit} -\jlreq@setjaxspmode{㎏}{inhibit} -\jlreq@setjaxspmode{㎜}{inhibit} -\jlreq@setjaxspmode{㎝}{inhibit} -\jlreq@setjaxspmode{㎞}{inhibit} -\jlreq@setjaxspmode{㎡}{inhibit} -\jlreq@setjaxspmode{㏄}{inhibit} -\fi +\jlreq@addjaxspmode{\jlreq@charlist@iterationmarks}{pre} +\jlreq@addjaxspmode{\jlreq@charlist@iterationmarks}{post} +\jlreq@addjaxspmode{\jlreq@charlist@prolongedsoundmark}{pre} +\jlreq@addjaxspmode{\jlreq@charlist@prolongedsoundmark}{post} +\jlreq@addjaxspmode{\jlreq@charlist@smallkana}{pre} +\jlreq@addjaxspmode{\jlreq@charlist@smallkana}{post} +\jlreq@addjaxspmode{\jlreq@charlist@hiragana}{pre} +\jlreq@addjaxspmode{\jlreq@charlist@hiragana}{post} +\jlreq@addjaxspmode{\jlreq@charlist@katakana}{pre} +\jlreq@addjaxspmode{\jlreq@charlist@katakana}{post} +\jlreq@addjaxspmode{\jlreq@charlist@dividingpunctuationmarks}{post} + % 分割禁止(分離禁止文字は特定の並びで分割禁止だが,とりあえず一括で禁止しておく.) -\jlreq@setprebreakpenalty{—}{10000} -\jlreq@setprebreakpenalty{…}{10000} -\jlreq@setprebreakpenalty{‥}{10000} +\jlreq@setprebreakpenalty{\jlreq@charlist@inseparablecharacters}{10000} % ¥100とか70%とか…… %.. 文字範囲 @@ -1228,13 +1159,6 @@ \DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal} %.. 和文 -% 必要になりそうなリスト -% 開き括弧(文字クラス1) -\edef\jlreq@charlist@openingbrackets{(〔[{〈《「『【‘“\ifx p\jlreq@engine\else ⦅〘〖«〝\fi} -% 閉じ括弧(文字クラス2) -\edef\jlreq@charlist@closingbrackets{)〕]}〉》」』】’”\ifx p\jlreq@engine\else⦆〙〗»〟\fi} -% 区切り約物(文字クラス4) -\edef\jlreq@charlist@dividingpunctuationmarks{!?\ifx p\jlreq@engine\else ‼⁇⁈⁉\fi} % JFMに関連する設定 \ifx l\jlreq@engine % この値は後でjfm-jlreq内で読む @@ -1243,8 +1167,8 @@ % \item後の行頭括弧のために仕込み. \jlreq@saveoriginalcs{list} \jlreq@saveoriginalcs{endlist} - \pretocmd{\list}{\jlreq@pushhook@postpar{\directlua{luatexja.jfmglue.create_beginpar_node()}}}{}{}% ltjsclassesから - \apptocmd{\endlist}{\jlreq@pophook@postpar} + \pretocmd{\list}{\jlreq@pushhook@postpar{\ltjfakeparbegin}}{}{} + \apptocmd{\endlist}{\jlreq@pophook@postpar}{}{} \else % 非LuaTeXの場合はJFMの入れ替えと\everyparでの処理で対処. % 行頭括弧に対して\inhibitglueを入れたりする命令を作る @@ -1294,8 +1218,8 @@ \ifx l\jlreq@engine \RequirePackage{luatexja-adjust} \ltjenableadjust[lineend=extended,priority=true] - \ltjsetparameter{stretch_priority={kanjiskip=10,xkanjiskip=-30}} - \ltjsetparameter{shrink_priority={kanjiskip=0,xkanjiskip=0}} + \ltjsetparameter{stretch_priority={kanjiskip=0,xkanjiskip=10}} + \ltjsetparameter{shrink_priority={kanjiskip=0,xkanjiskip=-30}} \fi \ifx p\jlreq@engine @@ -1394,7 +1318,6 @@ \AtBeginDocument{\catcode` =\active} \fi - % \jaspace \DeclareRobustCommand*{\jaspace}[1]{% \ifcsname jlreq@jaspace@#1\endcsname\csname jlreq@jaspace@#1\endcsname @@ -1474,20 +1397,23 @@ \fi } \fi -\jlreq@divide{\jlreq@fontsize}{\jlreq@jafontsize} -\edef\jlreq@jafontinvscale{\strip@pt\jlreq@resultdimen} -\newcommand*{\jafontsize}[2]{% - \begingroup - \jlreq@iffloat{#1}{% - \jlreq@tempdima=\jlreq@jafontinvscale\dimexpr #1pt\relax - \edef\jlreq@do{\noexpand\fontsize{\strip@pt\jlreq@tempdima}{\unexpanded{#2}}}% - }{% - \jlreq@tempdima=\jlreq@jafontinvscale\dimexpr#1\relax - \edef\jlreq@do{\noexpand\fontsize{\expandonce{\the\jlreq@tempdima}}{\unexpanded{#2}}}% - }% - \expandafter\endgroup - \jlreq@do + +% \jafontsize +\def\@tempa#1{ + \newcommand*{\jafontsize}[2]{% + \begingroup + \jlreq@iffloat{##1}{% + \edef\jlreq@do{\noexpand\fontsize{\strip@pt\dimexpr#1\dimexpr##1pt\relax\relax}}% + }{% + \edef\jlreq@do{\noexpand\fontsize{\the\dimexpr#1\dimexpr##1\relax\relax}}% + }% + \expandafter\endgroup + \jlreq@do{##2}% + } } +\jlreq@divide{\jlreq@fontsize}{\jlreq@jafontsize} +\edef\jlreq@do{\noexpand\@tempa{\strip@pt\jlreq@resultdimen}} +\jlreq@do \renewcommand{\normalsize}{% \@setfontsize\normalsize{\jlreq@fontsize}{\jlreq@baselineskip}% @@ -1627,11 +1553,13 @@ \ifdim\marginparwidth>0pt \setlength{\marginparsep}{2\zw} % フォントサイズ×2(4.2.7:特に問題に~e) \else - \setlength{\marginparsep}{0pt} % フォントサイズ×2(4.2.7:特に問題に~e) + \setlength{\marginparsep}{0pt} \fi -\ifdim\marginparwidth>25\zw\relax - \jlreq@note{並列注の字詰め方向の長さ(行長)は,15字から20字くらいである.ケースによっては25字程度にする場合もある (4.2.7).} +\ifdim\marginparwidth>0pt + \ifnum 0\ifdim\marginparwidth>25\zw 1\fi\ifdim\marginparwidth<15\zw 1\fi>0 + \jlreq@note{並列注の字詰め方向の長さ(行長)は,15字から20字くらいである.ケースによっては25字程度にする場合もある (4.2.7).} + \fi \fi % 縦書きの時は脚注に固定 % (TODO: 頭注) @@ -1926,7 +1854,6 @@ % ラベルフォーマットでは#1=カウンタ名,見出し文字列フォーマットでは#1=見出し文字列,副題フォーマットでは#1=副題 % ラベルのみのフォーマットは目次に使われる. \newcommand{\jlreq@startBlockHeading}[5]{% - % 一端フックを無効化 \edef\jlreq@BlockHeading@start@format{\unexpanded{#4}}% この二つは\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる) \edef\jlreq@BlockHeading@start@totalformat{\unexpanded{#5}}% \jlreq@BlockHeading@start@{#1}{#2}{#3}% @@ -1964,11 +1891,13 @@ \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@format@\the\jlreq@BlockHeading@spaces@current@count\endcsname{% \unexpanded{#5}% }% - \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@before@\the\jlreq@BlockHeading@spaces@current@count\endcsname{ + \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@before@\the\jlreq@BlockHeading@spaces@current@count\endcsname{% \expandonce{\jlreq@resulta}% }% \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count\endcsname{}% - \jlreq@BlockHeading@start@afterheading + \ifx\jlreq@BlockHeading@spaces@headingslist\@empty\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\jlreq@BlockHeading@spaces@outputwospace\ignorespaces}% + {\jlreq@BlockHeading@start@afterheading}% } \def\jlreq@BlockHeading@start@afterheading{\futurelet\jlreq@nextchar\jlreq@BlockHeading@start@afterheading@} @@ -1979,28 +1908,42 @@ % スペースを読み飛ばす \expandafter\def\expandafter\jlreq@BlockHeading@start@afterheading@@\space{\jlreq@BlockHeading@start@afterheading} \def\jlreq@BlockHeading@start@afterheading@@@{% - \def\jlreq@do{\jlreq@BlockHeading@spaces@output\jlreq@BlockHeading@spaces@clear}% + \def\jlreq@do{\jlreq@BlockHeading@spaces@output}% \expandafter\@for\expandafter\@tempa\expandafter:\expandafter=\jlreq@BlockHeading@allheadings\do{% \expandafter\ifx\csname\@tempa\endcsname\jlreq@nextchar\def\jlreq@do{}\fi }% % \jlreq@BlockHeading@HeadingSpaces@ignoretokens内のものは特別扱いする \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq@BlockHeading@HeadingSpaces@ignoretokens\do{% \expandafter\ifx\@tempa\jlreq@nextchar - \edef\jlreq@do{% - \unexpanded{\let\jlreq@BlockHeading@start@savecs=}\expandonce{\@tempa}% - \noexpand\pretocmd\expandonce{\@tempa}{\noexpand\let\expandonce{\@tempa}=\noexpand\jlreq@BlockHeading@start@savecs\noexpand\jlreq@BlockHeading@HeadingSpaces@saveafter}{}{}% - \noexpand\apptocmd\expandonce{\@tempa}{\unexpanded{\jlreq@endmark\jlreq@BlockHeading@start@afterheading}}{}{}% - }% + \def\jlreq@do{\jlreq@BlockHeading@start@afterheading@saveafter@cs}% \fi }% \jlreq@do } -\def\jlreq@BlockHeading@HeadingSpaces@saveafter#1\jlreq@endmark{% - \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{#1}}% +% コントロールシークエンスを保存 +\def\jlreq@BlockHeading@start@afterheading@saveafter@cs#1{% + \csgappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{#1}% + \jlreq@BlockHeading@start@afterheading@saveafter@option +} +% オプションがあれば保存 +\def\jlreq@BlockHeading@start@afterheading@saveafter@option{% + \@ifnextchar[{\jlreq@BlockHeading@start@afterheading@saveafter@option@}{\jlreq@BlockHeading@start@afterheading@saveafter@arguments}% +} +\def\jlreq@BlockHeading@start@afterheading@saveafter@option@[#1]{% + \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{[#1]}}% + \jlreq@BlockHeading@start@afterheading@saveafter@arguments +} +% 引数を保存し続けるループ +\def\jlreq@BlockHeading@start@afterheading@saveafter@arguments{% + \jlreq@ifnextchar\bgroup{\jlreq@BlockHeading@start@afterheading@saveafter@arguments@}{\jlreq@BlockHeading@start@afterheading}% +} +\def\jlreq@BlockHeading@start@afterheading@saveafter@arguments@#1{% + \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{{#1}}}% + \jlreq@BlockHeading@start@afterheading@saveafter@arguments } -% 特別扱いしたいトークンの列を並べる +% 特別扱いしたいマクロを並べる \def\jlreq@BlockHeading@HeadingSpaces@ignoretokens{\label} % \jlreq@resultaにaux吐き出しとかを入れて,\jlreq@resultbに出力を入れる(縦方向調整なし) @@ -2036,7 +1979,7 @@ % {1 = 配置(clr)}{2 = 字下げ}{3 = 字上げ}{4 = 出力} \long\def\jlreq@BlockHeading@start@makeoutput@#1#2#3#4{% \edef\jlreq@result{% - \noindent + \noexpand\noindent \jlreq@ifempty{#2}{}{\unexpanded{\hskip #2}}% \noexpand\vbox{% \noexpand\noindent @@ -2422,7 +2365,7 @@ \@ifundefined{#1}{\DeclareBlockHeading{#1}{#2}{#3}}{}% } -% 別行見出しが連続した場合の処理 +%.. 別行見出しが連続した場合の処理 % 設定値保存に次のマクロを使う % \jlreq@BlockHeading@spaces@headingslist % : スペースを考慮しないとならない見出しのリスト.,_chapter_section_subsection,_section_subsection,...みたいな感じ @@ -2532,9 +2475,14 @@ }% } \def\jlreq@SetBlockHeadingSpaces@@@@#1#{% - \expandafter\jlreq@SetBlockHeadingSpaces@ifcontainsunderbar\expandafter{\@gobble #1}{% + \expandafter\jlreq@ifcontains\expandafter{\@gobble #1}{_}{% \ClassWarning{jlreq}{Unusual heading name `\@gobble #1' is found. You forgot a comma? (in SetBlockHeadingSpaces)}% }{}% + \jlreq@ifendswith{#1}{*}{{% + \def\@tempa_##1*{\def\@tempa{##1}}% + \@tempa#1 + \ClassWarning{jlreq}{The heading name `\@gobble #1' ends with `*'. Do you mean `\@tempa{*}'? (in SetBlockHeadingSpaces)}% + }}{}% \appto\jlreq@headings{#1}% \jlreq@SetBlockHeadingSpaces@@@@@ } @@ -2551,14 +2499,6 @@ \@gobble % \jlreq@endmarkを食う }% } -% #1に_が含まれているか -\def\jlreq@SetBlockHeadingSpaces@ifcontainsunderbar@#1_#2\jlreq@endmark{% - \jlreq@ifempty{#2}{\@secondoftwo}{\@firstoftwo}% -} -\def\jlreq@SetBlockHeadingSpaces@ifcontainsunderbar#1{% - \jlreq@SetBlockHeadingSpaces@ifcontainsunderbar@#1_\jlreq@endmark -} - % 現在の情報に基づき出力 \def\jlreq@BlockHeading@spaces@output{% @@ -2571,10 +2511,18 @@ % 連続スペース情報とか無視して各々の見出しを出力する \def\jlreq@BlockHeading@spaces@outputwospace{% - \jlreq@tempcnta=0 - \@whilenum\jlreq@tempcnta<\jlreq@BlockHeading@spaces@current@count\do{% + \begingroup + \jlreq@tempcnta=0 + \def\jlreq@do{}% + \jlreq@BlockHeading@spaces@outputwospace@ + \jlreq@BlockHeading@spaces@clear + \expandafter\endgroup + \jlreq@do +} +\def\jlreq@BlockHeading@spaces@outputwospace@{% + \ifnum\jlreq@tempcnta<\jlreq@BlockHeading@spaces@current@count \advance\jlreq@tempcnta by 1 - \csname jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta\endcsname + \eappto\jlreq@do{\csexpandonce{jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}}% \edef\jlreq@tempa{% \unexpanded{\long\def\jlreq@tempa##1}{\csexpandonce{jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}% }% @@ -2586,10 +2534,9 @@ {\csexpandonce{jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}% }}% }% - \edef\jlreq@do{\jlreq@tempb}% - \jlreq@do - \csname jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta\endcsname - }% + \eappto\jlreq@do{\jlreq@tempb\csexpandonce{jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}}% + \expandafter\jlreq@BlockHeading@spaces@outputwospace@ + \fi } \def\jlreq@BlockHeading@spaces@output@#1#2\jlreq@endmark{% @@ -2608,6 +2555,7 @@ \expandonce{\jlreq@result}% \fi }% + \jlreq@BlockHeading@spaces@clear \jlreq@do } % jlreq@resultに出力すべきものを入れていく @@ -2657,16 +2605,18 @@ % 連続見出しスペース調整用のデータをすべてクリアする \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@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 + \begingroup + \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@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 + \endgroup } %.. 同行見出し @@ -2732,38 +2682,43 @@ % 1 = 書式指定,2 = インデント, 3 = 見出しと本文の間, 4 = これを越えたら二行以上,5 = これを越えたら三行以上,6 = テキスト \def\jlreq@CutinHeading@start@#1#2#3#4#5#6{% % 一行で処理したときの見出し長さを計測 - \setbox\@tempboxa=\hbox{#1#6}% - \@tempdima=\wd\@tempboxa - % 何行必要かを\jlreq@CutinHeading@linecountに入れる - \ifdim\@tempdima>#5\def\jlreq@CutinHeading@linecount{3}% - \else\ifdim\@tempdima>#4\def\jlreq@CutinHeading@linecount{2}% - \else\def\jlreq@CutinHeading@linecount{1}\fi\fi - % \@tempdimaが実際の一行の長さに近い - \divide\@tempdima by \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}% - \else - \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\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 - \noindent - \hspace*{#2}% - \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 + \begingroup + \setbox\@tempboxa=\hbox{#1#6}% + \@tempdima=\wd\@tempboxa + % 何行必要かを\jlreq@CutinHeading@linecountに入れる + \ifdim\@tempdima>#5\def\jlreq@CutinHeading@linecount{3}% + \else\ifdim\@tempdima>#4\def\jlreq@CutinHeading@linecount{2}% + \else\def\jlreq@CutinHeading@linecount{1}\fi\fi + % \@tempdimaが実際の一行の長さに近い + \divide\@tempdima by \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}% + \else + \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\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 + \noindent + \hspace*{#2}% + \copy\@tempboxa + \hspace*{#3}% + \par + % でかい見出しボックスの分をキャンセルする空きを入れる + % \baselineskip - \ht\jlreq@tempboxaはTeXが挿入するスキップの分 + \vskip -\dimexpr\ht\@tempboxa + \dp\@tempboxa + \baselineskip - \ht\jlreq@tempboxa\relax\relax + \edef\jlreq@do{% + \noexpand\hangindent=\the\dimexpr#2 + \wd\@tempboxa + #3\relax\relax + \noexpand\hangafter=-\jlreq@CutinHeading@linecount\relax + }% + \expandafter\endgroup + \jlreq@do \prevdepth=0pt % 改段落が起こっても\hang****をキープするように\parを書き換えておく(終わったら元に戻す). \def\par{% @@ -2771,10 +2726,8 @@ \jlreq@tempcnta=\hangafter\relax \jlreq@tempdima=\hangindent\relax \@@par - \ifnum\jlreq@tempcnta<-\prevgraf\relax - \ifjlreq@tempa\else - \advance\jlreq@tempcnta by \prevgraf\relax - \fi + \ifjlreq@tempa\else\advance\jlreq@tempcnta by \prevgraf\relax\fi + \ifnum\jlreq@tempcnta<0 \hangafter=\jlreq@tempcnta\relax \hangindent=\jlreq@tempdima\relax \else @@ -3000,7 +2953,7 @@ % 文字サイズは6ポイントくらい(4.2.3.a)とりあえす\scriptsize % \footnoteと\footnotemarkの前後に\jlreq@hook@prenote/\jlreq@hook@postnoteを入れる -\jlreq@saveoriginalcs{footnote}% +\jlreq@saveoriginalcs{footnote} \edef\jlreq@do{ \unexpanded{\long\def\jlreq@fixjfm@footnote@[#1]#2}{% \expandonce{\footnote[#1]{#2}}% @@ -3138,6 +3091,8 @@ \else \renewcommand*{\thefootnote}{\arabic{footnote}\hbox{})\inhibitglue} \fi +\ifthenelse{\equal{\jlreq@article@type}{article}}{}{\@addtoreset{footnote}{chapter}} + %.. 後注(4.2.4) \def\jlreq@endnotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名 @@ -4092,7 +4047,12 @@ %.. figure環境 \newcounter{figure} -\renewcommand*{\thefigure}{\arabic{figure}} +\ifthenelse{\equal{\jlreq@article@type}{article}}{% + \renewcommand{\thefigure}{\@arabic\c@figure} +}{% + \@addtoreset{figure}{chapter} + \renewcommand{\thefigure}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@figure} +} \newcommand*{\fps@figure}{h} \newcommand*{\ftype@figure}{1} \newcommand*{\ext@figure}{lof} @@ -4104,7 +4064,12 @@ %.. table環境 \newcounter{table} -\renewcommand*{\thetable}{\arabic{table}} +\ifthenelse{\equal{\jlreq@article@type}{article}}{% + \renewcommand{\thetable}{\@arabic\c@table} +}{% + \@addtoreset{table}{chapter} + \renewcommand{\thetable}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@table} +} \newcommand*{\fps@table}{h} \newcommand*{\ftype@table}{2} \newcommand*{\ext@table}{lot} @@ -4487,7 +4452,12 @@ \setlength\fboxsep{.3\zw} \setlength\fboxrule{\jlreq@omotekeiwidth} % 根拠はない % 後で -\renewcommand{\theequation}{\@arabic\c@equation} +\ifthenelse{\equal{\jlreq@article@type}{article}}{% + \renewcommand{\theequation}{\@arabic\c@equation} +}{% + \@addtoreset{equation}{chapter} + \renewcommand{\theequation}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@equation} +} %. 目次 \setcounter{tocdepth}{3} @@ -4728,19 +4698,17 @@ \hbox{\yoko \setbox\jlreq@tempboxa=\hbox{阿}% \vrule width 0pt height \ht\jlreq@tempboxa depth \dp\jlreq@tempboxa #1}% - \def\jlreq@do{% - % 後ろのJFM glue - \jlreq@ifletter{\jlreq@nextchar}{% - \jlreq@expandmacros{\jlreq@nextchar}{\jlreq@tempa}% - \def\jlreq@tempb####1####2\jlreq@endmark{\def\jlreq@tempa{####1}}% - \expandafter\jlreq@tempb\jlreq@tempa\jlreq@endmark - \jlreq@calc@jfmglue{\char\jlreq@lastnodechar}{\jlreq@tempa}% - \jlreq@calc@jfmglue{阿}{\jlreq@tempa}% - \jlreq@ifgluezero\jlreq@resultskip{}{\hskip\jlreq@resultskip}% - \inhibitglue - }{}% - }% - \futurelet\jlreq@nextchar\jlreq@do + \futurelet\jlreq@nextchar\jlreq@tatechuyoko@ +} +\def\jlreq@tatechuyoko@{% + \jlreq@ifletter{\jlreq@nextchar}{% + \jlreq@expandmacros{\jlreq@nextchar}{\jlreq@tempa}% + \def\jlreq@tempb##1##2\jlreq@endmark{\def\jlreq@tempa{##1}}% + \expandafter\jlreq@tempb\jlreq@tempa\jlreq@endmark + \jlreq@calc@jfmglue{阿}{\jlreq@tempa}% + \jlreq@ifgluezero\jlreq@resultskip{}{\hskip\jlreq@resultskip}% + \inhibitglue + }{}% } % 日にち @@ -4749,13 +4717,19 @@ \def\和暦{\西暦false} % #1年#2月#3日 #4は\numberとか\kansujiとか \def\jlreq@wareki#1#2#3#4{% + \jlreq@warekiyear{#1}{#2}{#3}{#4}% + #4#2月#4#3日% +} +\def\jlreq@warekiyear#1#2#3#4{% % 昭和:1989年1月7日まで \ifnum0\ifnum#1<1988 1\fi\ifnum#1=1989 \ifnum#2=1 \ifnum#3<8 1\fi\fi\fi>0 昭和\jlreq@warekiyear@{#1}{1926}{#4}% - \else + % 平成:2019年4月末日まで + \else%\ifnum0\ifnum#1<2019 1\fi\ifnum#1=1989 \ifnum#2<5 1\fi\fi>0 平成\jlreq@warekiyear@{#1}{1989}{#4}% - \fi - #4#2月#4#3日% +% \else +% 新元号\jlreq@warekiyear@{#1}{2019}{#4}% + \fi%\fi } \def\jlreq@warekiyear@#1#2#3{\ifnum#1=#2 元年\else #3\numexpr#1-#2+1\relax 年\fi} \def\today{% |