diff options
author | Norbert Preining <preining@logic.at> | 2017-04-05 02:07:50 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2017-04-05 02:07:50 +0000 |
commit | 8b1d816c858a3e07d6dad996e97ffd940ace64f9 (patch) | |
tree | 19304defdfad551dd5081c831fdf723eafa292d2 /Master/texmf-dist/tex/latex/jlreq/jlreq.cls | |
parent | aa89222697f74b3ae3488cfc3889a238a810089b (diff) |
jlreq (5Apr)
git-svn-id: svn://tug.org/texlive/trunk@43693 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/jlreq/jlreq.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq.cls | 541 |
1 files changed, 352 insertions, 189 deletions
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls index 83238525119..7d25d0efd4c 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/03/20 jlreq] +\ProvidesClass{jlreq}[2017/04/04 jlreq] \RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen} %. helper1 @@ -30,6 +30,33 @@ \newbox\jlreq@resultbox \newif\ifjlreq@result +\newcommand*{\jlreq@undefcs}[1]{% + \expandafter\ifx\csname\expandafter\@gobble\string #1\endcsname\relax\expandafter\@firstofone\else\expandafter\@gobble\fi + {\ClassError{jlreq}{Trying to delete \string#1\space even though it is not defined, maybe a bug}{\@ehc}}% + \let#1=\@undefined +} + +% クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする +\newcommand*{\jlreq@aftercls@addtodeletecs}[1]{% + \appto\jlreq@aftercls@deletecslist{\jlreq@undefcs{#1}}% +} +\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeletecs} +\newcommand*{\jlreq@aftercls@addtodeleteif}[1]{% + \edef\@tempa{\expandafter\@gobble\string#1}% + \edef\@tempa{\expandafter\@gobbletwo\@tempa}% + \eappto\jlreq@aftercls@deletecslist{% + \unexpanded{\jlreq@undefcs{#1}}% + \noexpand\jlreq@undefcs{\expandonce{\csname\@tempa true\endcsname}}% + \noexpand\jlreq@undefcs{\expandonce{\csname\@tempa false\endcsname}}% + }% +} +\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeleteif} +\AtEndOfClass{% + \jlreq@aftercls@deletecslist + \jlreq@undefcs{\jlreq@aftercls@deletecslist}% + \let\jlreq@undefcs=\@undefined +} + \def\jlreq@uniqtoken{\jlreq@uniqtoken} \def\jlreq@endmark{\jlreq@endmark} \long\def\jlreq@deleteuntileendmark#1\jlreq@endmark{} @@ -241,7 +268,8 @@ \long\def\jlreq@switch#1#2{% \begingroup \let\jlreq@do\@undefined - \jlreq@helper@switch@{#1}#2\jlreq@endmark + \edef\jlreq@tempa{#1}% + \expandafter\jlreq@helper@switch@\expandafter{\jlreq@tempa}#2\jlreq@endmark \ifx\jlreq@do\@undefined \def\jlreq@do{\@ifnextchar[{\jlreq@helper@switch@executeoption{#1}}{}}% \else @@ -263,7 +291,7 @@ \edef\jlreq@do{\unexpanded{#2}}% \def\jlreq@next{}% }{% - \edef\jlreq@tempa{#1}% + \def\jlreq@tempa{#1}% 最初に\edefで展開済み \edef\jlreq@tempb{#2}% \ifx\jlreq@tempa\jlreq@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi {% @@ -294,7 +322,7 @@ \global\jlreq@currentpage=\zref@extractdefault{jlreq@rest@width.page.\the\jlreq@zref@reference@count}{jlreq@page}{\c@page}% } -\def\jlreq@saveoriginalcs#1{ +\def\jlreq@saveoriginalcs#1{% \@ifundefined{jlreq@original@#1}{}{% \ClassError{jlreq}{Trying to save \expandafter\string\csname #1\endcsname\space twice, maybe a bug}{\@ehc}% }% @@ -317,17 +345,31 @@ \fi } +% #1が[0-9\.]*に当てはまるか. +\def\jlreq@iffloat#1{\jlreq@helper@iffloat#1\jlreq@endmark} +\def\jlreq@helper@chknumlist#1{\ifx#101\fi\ifx#111\fi\ifx#121\fi\ifx#131\fi\ifx#141\fi\ifx#151\fi\ifx#161\fi\ifx#171\fi\ifx#181\fi\ifx#191\fi} +\def\jlreq@helper@chkfloatlist#1{\jlreq@helper@chknumlist{#1}\ifx#1.1\fi} +\def\jlreq@helper@iffloat#1{% + \jlreq@ifendmark{#1}{\@firstoftwo}% + {% + \ifnum0\jlreq@helper@chkfloatlist{#1}>0 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\jlreq@helper@iffloat}% + {\expandafter\@secondoftwo\jlreq@deleteuntileendmark}% + }% +} + %. オプションの定義 % オプション処理の際にしか使わない変数(後でそれを元に別の変数を調整する) % ものは\jlreq@option@<key>に格納する. % _とかは@に変換する. -\newcommand*{\jlreq@checkempty}[2]{ - \jlreq@ifempty{#2}{}{\ClassError{jlreq}{The option #1 should have no value}{\@ehc}}% -} % 引数無しの\DeclareOptionX \newcommand*{\jlreq@DeclareOption}[2]{% - \DeclareOptionX{#1}{\jlreq@checkempty{#1}{##1}#2} + \DeclareOptionX{#1}{% + \jlreq@ifempty{##1}{}{\ClassError{jlreq}{The option #1 should have no value}{\@ehc}}% + #2% + } } +\jlreq@aftercls@addtodeletecs{\jlreq@DeclareOption} % エンジン類 \jlreq@DeclareOption{uplatex}{\let\jlreq@engine=u} \jlreq@DeclareOption{platex}{\let\jlreq@engine=p} @@ -342,6 +384,7 @@ %.. 基本版面.まずは紙サイズ. \def\jlreq@switchpapersize{} +\jlreq@aftercls@addtodeletecs{\jlreq@switchpapersize} \newcommand*\jlreq@addpapersize[4][]{% \jlreq@ifempty{#2}{}{ \jlreq@DeclareOption{#2}{\setlength\paperheight{#3}\setlength\paperwidth{#4}} @@ -351,6 +394,7 @@ \appto\jlreq@switchpapersize{{#1}{\setlength\paperheight{#3}\setlength\paperwidth{#4}}} } } +\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize} \DeclareOptionX{paper}{ \edef\jlreq@do{% \unexpanded{\jlreq@switch{#1}}{\expandonce{\jlreq@switchpapersize}}% @@ -410,10 +454,10 @@ \jlreq@addpapersize[c7]{}{114mm}{81mm} \jlreq@addpapersize[c8]{}{81mm}{57mm} -\let\jlreq@addpapersize=\@undefined %.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a) \newcommand*{\jlreq@option@fontsize}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@fontsize} \DeclareOptionX{fontsize}{\renewcommand*{\jlreq@option@fontsize}{#1}} \jlreq@DeclareOption{10pt}{\renewcommand*{\jlreq@option@fontsize}{10pt}} \jlreq@DeclareOption{11pt}{\renewcommand*{\jlreq@option@fontsize}{11pt}} @@ -421,35 +465,43 @@ %.. 行の長さ \newcommand*{\jlreq@option@line@length}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@line@length} \DeclareOptionX{line_length}{\renewcommand*{\jlreq@option@line@length}{#1}} %.. 1ページあたりの行数 \newcommand*{\jlreq@option@number@of@lines}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@number@of@lines} \DeclareOptionX{number_of_lines}{\renewcommand*{\jlreq@option@number@of@lines}{#1}} % 地の空き量,のどの空き量で配置位置を決める(2.4.1.b)省略されたら中央配置. %.. 天 \newcommand*{\jlreq@option@head@space}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@head@space} \DeclareOptionX{head_space}{\renewcommand*{\jlreq@option@head@space}{#1}} %.. 地 \newcommand*{\jlreq@option@foot@space}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@foot@space} \DeclareOptionX{foot_space}{\renewcommand*{\jlreq@option@foot@space}{#1}} %.. のど \newcommand*{\jlreq@option@gutter}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@gutter} \DeclareOptionX{gutter}{\renewcommand*{\jlreq@option@gutter}{#1}} %.. 柱とノンブル \newcommand*{\jlreq@option@headfoot@verticalpos}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@headfoot@verticalpos} \DeclareOptionX{headfoot_verticalposition}{\renewcommand*{\jlreq@option@headfoot@verticalpos}{#1}} \newcommand*{\jlreq@headfoot@sidemargin}{0pt} \DeclareOptionX{headfoot_sidemargin}{\renewcommand*{\jlreq@headfoot@sidemargin}{#1}} %.. 段間 \newcommand*{\jlreq@option@column@gap}{2zw} +\jlreq@aftercls@addtodeletecs{\jlreq@option@column@gap} \DeclareOptionX{column_gap}{\renewcommand*{\jlreq@option@column@gap{#1}}} %.. 行送り,指定無しの場合は文字サイズの1.7倍とする.(1.5から2倍が好ましい:2.4.2.d 注3) \newcommand*{\jlreq@option@baselineskip}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@baselineskip} \DeclareOptionX{baselineskip}{\def\jlreq@option@baselineskip{#1}} \DeclareOptionX{linegap}{\def\jlreq@option@baselineskip{1zw + #1}} @@ -476,6 +528,7 @@ \newcommand*{\jlreq@sidenote@type}{number} \define@choicekey{jlreq.cls}{sidenote_type}{number,symbol}{\renewcommand*{\jlreq@sidenote@type}{#1}} \newcommand*{\jlreq@option@sidenote@width}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@sidenote@width} \DeclareOptionX{sidenote_width}{\renewcommand*{\jlreq@option@sidenote@width}{#1}} %.. 引用 @@ -507,6 +560,7 @@ \jlreq@DeclareOption{tate}{\@tatetrue} \newif\ifjlreq@option@twoside\jlreq@option@twosidefalse % onesideかtwosideが指定された +\jlreq@aftercls@addtodeleteif{\ifjlreq@option@twoside} \jlreq@DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse\jlreq@option@twosidetrue} \jlreq@DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue\jlreq@option@twosidetrue} \jlreq@DeclareOption{onecolumn}{\@twocolumnfalse} @@ -517,6 +571,7 @@ \jlreq@DeclareOption{final}{\setlength\overfullrule{0pt}} \newif\if@openright \newif\ifjlreq@option@open \jlreq@option@openfalse % openrightかopenanyが指定された +\jlreq@aftercls@addtodeleteif{\ifjlreq@option@open} \jlreq@DeclareOption{openright}{\@openrighttrue\jlreq@option@opentrue} \jlreq@DeclareOption{openany}{\@openrightfalse\jlreq@option@opentrue} \jlreq@DeclareOption{leqno}{\input{leqno.clo}} @@ -525,13 +580,11 @@ \newcommand*{\jlreq@warning}[1]{} \jlreq@DeclareOption{jlreq_warnings}{\renewcommand*{\jlreq@warning}[1]{\ClassWarningNoLine{jlreq}{(JLReq warning) ##1}}} -\let\jlreq@DeclareOption=\@undefined - \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を実行する \let\jlreq@original@@removeelement=\@removeelement \let\@removeelement=\jlreq@helper@removeelement -\ProcessOptionsX*\relax +\ProcessOptionsX\relax \let\@removeelement=\jlreq@original@@removeelement \ifjlreq@option@titlepage\else @@ -541,7 +594,12 @@ \ifthenelse{\equal{\jlreq@article@type}{book}}{\@openrighttrue}{\@openrightfalse} \fi % articleではopenrightは効かない. -\ifthenelse{\equal{\jlreq@article@type}{article}}{\@openrightfalse}{} +\ifthenelse{\equal{\jlreq@article@type}{article}}{% + \if@openright + \ClassWarningNoLine{jlreq}{The option `openright' is ignored in article} + \@openrightfalse + \fi +}{} \ifjlreq@option@twoside\else \ifthenelse{\equal{\jlreq@article@type}{book}}{\@twosidetrue}{\@twosidefalse} \fi @@ -556,6 +614,7 @@ \newcommand{\jlreq@jlreqsetup@add}[2]{% \eappto\jlreq@jlreqsetup@keyvallist{\unexpanded{{#1}{#2}}}% } +\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@add} \@onlypreamble\jlreqsetup % エンジンの設定 @@ -599,10 +658,10 @@ % 組方向を判定 % \jlreq@if(y|t)(dir|box)を定義する. \ifx l\jlreq@engine\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{ - \def\jlreq@ifydir{\ifnum\ltjgetparameter{direction}=4\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} - \def\jlreq@iftdir{\ifnum\numexpr\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8=3\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} - \def\jlreq@ifybox#1{\ifnum\ltjgetparameter{boxdir}{#1}=4\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} - \def\jlreq@iftbox#1{\ifnum\numexpr\ltjgetparameter{boxdir}{#1}-(\ltjgetparameter{boxdir}{#1}/8)*8=3\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} + \def\jlreq@ifydir{\ifnum\ltjgetparameter{direction}=4 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} + \def\jlreq@iftdir{\ifnum\numexpr\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8\relax=3 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} + \def\jlreq@ifybox#1{\ifnum\ltjgetparameter{boxdir}{#1}=4 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} + \def\jlreq@iftbox#1{\ifnum\numexpr\ltjgetparameter{boxdir}{#1}-(\ltjgetparameter{boxdir}{#1}/8)*8\relax=3 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} }{ \def\jlreq@ifydir{\ifydir\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} \def\jlreq@iftdir{\iftdir\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} @@ -659,11 +718,11 @@ \edef\jlreq@savepos@iflabelundefined{\noexpand\zref@ifrefundefined{jlreq@rest@width.pos.\the\jlreq@zref@reference@count}}% } -\ifx\jlreq@engine l - \def\lastnodechar{\directlua{luatexja.pltx_composite_last_node_char()}} +\ifx l\jlreq@engine + \newcommand*{\lastnodechar}{\directlua{luatexja.pltx_composite_last_node_char()}} \fi -% #1と#2の間に入るjmglueを\jlreq@resultskip((x)kanjiskipも)に入れる +% #1と#2の間に入るjmglue((x)kanjiskipも)を\jlreq@resultskipに入れる \newcommand*{\jlreq@calc@jfmglue}[2]{% \begingroup \setbox\jlreq@tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}% @@ -692,10 +751,10 @@ } %. 基本設定 -% 和文文字,欧文文字の設定(とりあえずLuaTeX-jaのデフォルトのまま) \def\jlreq@kanjiskip{0pt plus 0.25zw minus 0pt} \def\jlreq@xkanjiskip{0.25zw plus 0.25zw minus 0.125zw} \ifx l\jlreq@engine + % 和文文字,欧文文字の設定(とりあえずLuaTeX-jaのデフォルトのまま) \ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8}} % kanjiskip, xkanjiskipはjfmのものを使う \ltjsetparameter{kanjiskip=\maxdimen} @@ -725,6 +784,9 @@ } } \fi +\jlreq@aftercls@addtodeletecs{\jlreq@setpostbreakpenalty} +\jlreq@aftercls@addtodeletecs{\jlreq@setprebreakpenalty} +\jlreq@aftercls@addtodeletecs{\jlreq@setjaxspmode} \jlreq@setpostbreakpenalty{(}{10000} \jlreq@setpostbreakpenalty{〔}{10000} @@ -980,9 +1042,6 @@ \jlreq@setprebreakpenalty{‥}{10000} % ¥100とか70%とか…… - -%. オプション処理 -%.. フォント関連 \newdimen\jlreq@fontsize \ifx l\jlreq@engine \setlength{\jlreq@fontsize}{% @@ -1000,7 +1059,7 @@ %. フォント \RequirePackage{lmodern} -% 古いフォントコマンド +%.. 古いフォントコマンド \DeclareOldFontCommand{\jlreq@oldfontcommand@mc}{\normalfont\mcfamily}{\mathmc} \DeclareOldFontCommand{\jlreq@oldfontcommand@gt}{\normalfont\gtfamily}{\mathgt} \DeclareOldFontCommand{\jlreq@oldfontcommand@rm}{\normalfont\rmfamily}{\mathrm} @@ -1173,6 +1232,7 @@ \emergencystretch 3\jlreq@gol +%.. 文字サイズ変更 % 文字サイズを基準としているような寸法に対しては, % \@setfontsizeが実行されるたびに追随して値を変える % その処理は\jlreq@setfontsizehookに入れる @@ -1183,7 +1243,7 @@ } \def\jlreq@setfontsizehook{} \appto\jlreq@setfontsizehook{\ifdim\parindent>0pt\setlength{\parindent}{1\jlreq@mol}\fi} -\ifx\jlreq@engine l\else +\ifx l\jlreq@engine\else \appto\jlreq@setfontsizehook{% \kanjiskip=\jlreq@kanjiskip \ifdim\xkanjiskip>0pt @@ -1409,6 +1469,7 @@ \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - 1in - \topskip + \Cht\relax} \fi } +\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyhead} % 地の値から \def\jlreq@settopmarginbyfoot#1{ \if@tate @@ -1417,7 +1478,8 @@ \jlreq@warning{横組の場合は天の空き量を指定する (2.4.1.b)} \setlength{\topmargin}{\dimexpr\paperheight - \textheight + \topskip - 1\zh - \headsep - \headheight - 1in - #1\relax} \fi -} +} +\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyfoot} \ifx\jlreq@option@head@space\@empty \ifx\jlreq@option@foot@space\@empty \if@tate @@ -1442,8 +1504,6 @@ \fi \fi \fi -\let\jlreq@settopmarginbyhead=\@undefined -\let\jlreq@settopmarginbyfoot=\@undefined %.. 下 \setlength{\footskip}{\dimexpr\headsep + 1\zw\relax} @@ -1522,7 +1582,7 @@ }% \noexpand\def\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}####1{% \expandonce{\jlreq@format{}{##1}}% - \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{}{\expandonce{\jlreq@label@format}}{####1}% + \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{*}{\expandonce{\jlreq@label@format}}{####1}% \noexpand\@afterheading \expandonce{\jlreq@heading@clearpage}% \unexpanded{\if@restonecol\twocolumn\fi}% @@ -2018,7 +2078,7 @@ \expandafter\def\csname jlreq@heading@setting@#1\endcsname{#3}% \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewCutinHeading}% \begingroup - \def\jlreq@fontcommand{\headfont}% + \def\jlreq@fontcommand{\sffamily\bfseries}% \def\jlreq@onelinemax{6\jlreq@fontsize}% \def\jlreq@twolinemax{20\jlreq@fontsize}% \def\jlreq@indent{0\jlreq@mol}% @@ -2137,38 +2197,34 @@ \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}}} \renewcommand{\thesection}{\rensuji{\@arabic\c@section}} \renewcommand{\thesubsection}{\rensuji{\@alph\c@subsection}} - \renewcommand{\thesubsubsection}{% - \rensuji{\@arabic\c@subsubsection}} - \renewcommand{\theparagraph}{% - (\rensuji{\@arabic\c@paragraph})} - \renewcommand{\thesubparagraph}{% - (\rensuji{\@arabic\c@subparagraph})} + \renewcommand{\thesubsubsection}{\rensuji{\@arabic\c@subsubsection}} + \renewcommand{\theparagraph}{(\rensuji{\@arabic\c@paragraph})} + \renewcommand{\thesubparagraph}{(\rensuji{\@arabic\c@subparagraph})} \ifthenelse{\equal{\jlreq@article@type}{article}}{ - \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\headfont}},indent=4\jlreq@mol,lines=4,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\large}}} + \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE}},indent=4\jlreq@mol,lines=4,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},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\jlreq@mol,lines=6,label_format={第\thechapter 章},font={\huge\headfont},after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\Large}}} + \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@mol}},format={\null\vfill {\Huge\hspace*{2\jlreq@mol}#1#2}\vspace*{2\jlreq@gol}}} + \NewBlockHeading{chapter}{0}{indent=2\jlreq@mol,lines=6,label_format={第\thechapter 章},font={\huge},after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},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\jlreq@mol,lines=3,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}} + \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large}},indent=6\jlreq@mol,lines=3,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}} \if@twoside\ModifyHeading{section}{allowbreak_if_evenpage=true}\fi - \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\headfont}},indent=8\jlreq@mol,lines=2,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\small}}} + \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large}},indent=8\jlreq@mol,lines=2,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\small}}} \if@twoside\ModifyHeading{subsection}{allowbreak_if_evenpage=true}\fi - \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=10\jlreq@mol,lines=1,before_lines=1,subtitle_break=false,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},,subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}} + \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize}},indent=10\jlreq@mol,lines=1,before_lines=1,subtitle_break=false,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},,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\jlreq@mol} + \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize}}} + \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize}},indent=1\jlreq@mol} \else% yoko \renewcommand{\thepart}{\Roman{part}} \renewcommand{\thesubsection}{\thesection .\arabic{subsection}} @@ -2176,13 +2232,13 @@ \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 部},lines=4,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\large}}} + \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\sffamily\bfseries}},label_format={第\thepart 部},lines=4,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\large}}} \renewcommand{\thesection}{\arabic{section}} } {% book, report - \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@gol}},format={\null\vfil {\Huge\headfont #1#2}\vfil}} + \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@gol}},format={\null\vfil {\Huge\sffamily\bfseries #1#2}\vfil}} \NewBlockHeading{chapter}{0}{% - font={\jlreq@keepbaselineskip{\huge\headfont}}, + font={\jlreq@keepbaselineskip{\huge\sffamily\bfseries}}, label_format={第\thechapter 章}, lines=5,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol}, subtitle_font={\jlreq@keepbaselineskip{\Large}}} @@ -2194,11 +2250,11 @@ \ModifyHeading{chapter}{pagebreak=clearpage} } } - \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\headfont}},lines=3,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}} - \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\headfont}},lines=2,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},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\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}} - \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=1\jlreq@mol} - \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\headfont}},indent=2\jlreq@mol} + \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\sffamily\bfseries}},lines=3,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}} + \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\sffamily\bfseries}},lines=2,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\small}}} + \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},lines=1,before_lines=1,subtitle_break=false,after_label_space=1\jlreq@mol,second_heading_text_indent={-1\jlreq@mol,1\jlreq@mol},subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}} + \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},indent=1\jlreq@mol} + \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},indent=2\jlreq@mol} \fi \ifthenelse{\equal{\jlreq@article@type}{article}}{}{% book, report @@ -2213,8 +2269,8 @@ \jlreq@switch{\jlreq@article@type}{ {book}{% \renewcommand{\jlreq@heading@maketoc@chapter}[3]{% - \chaptermark{#3}% \jlreq@ifempty{#1}{% + \chaptermark{#3}% \ifnum0\if@mainmatter\else1\fi\ifnum\jlreq@heading@level@chapter>\c@secnumdepth 1\fi>0 \addcontentsline{toc}{chapter}{#3}% \else @@ -2225,8 +2281,8 @@ } {report}{ \renewcommand{\jlreq@heading@maketoc@chapter}[3]{% - \chaptermark{#3}% \jlreq@ifempty{#1}{% + \chaptermark{#3}% \ifnum0\ifnum\jlreq@heading@level@chapter>\c@secnumdepth 1\fi>0 \addcontentsline{toc}{chapter}{#3}% \else @@ -2299,7 +2355,7 @@ \fi \setbox\jlreq@tempboxa=\hbox to\z@{\hskip-\@tempdima\raise\dimexpr.5\zw + (\ht\@tempboxa + \dp\@tempboxa)/2\relax\box\@tempboxa\hss}% \dp\jlreq@tempboxa=0pt\ht\jlreq@tempboxa=0pt\box\jlreq@tempboxa}}% - \ifx\jlreq@engine l + \ifx l\jlreq@engine % luatexの時は\inhibitglueすると\lastnodechar=-1になる \newcommand*{\jlreq@modify@noteandmark@fixjfm}[2]{% \jlreq@modify@noteandmark{#1}{#2}{% @@ -2317,6 +2373,7 @@ } \fi } +\jlreq@aftercls@addtodeletecs{\jlreq@modify@noteandmark@fixjfm} \jlreq@modify@noteandmark@fixjfm{\footnote}{\footnotemark} % \@footnotemarkをシンプルなものにする \def\jlreq@setdefaultnotemark#1#2{% @@ -2626,7 +2683,7 @@ \ifthenelse{\equal{\jlreq@referencemark}{inline}}{% \def\@tempa{\inhibitglue} }{ - \ifx\jlreq@engine l + \ifx l\jlreq@engine \def\@tempa{% \jlreq@lastnodechar=\lastnodechar \ifnum\lastnodechar>-1\inhibitglue\fi @@ -2651,10 +2708,10 @@ \def\@sidenotemark{\@makesidemark} % カスタマイズできるべき? \long\def\jlreq@sidenotetext#1#2{% - \expandafter\def\csname\jlreq@sidenotemarkname\endcsname{\inhibitglue\null{\reset@font\headfont\inhibitglue #1}}% + \expandafter\def\csname\jlreq@sidenotemarkname\endcsname{\inhibitglue\null{\reset@font\sffamily\bfseries\inhibitglue #1}}% \@sidenotetext{#2}% } - \long\def\@makesidetext#1{{\headfont\csname\jlreq@sidenotemarkname\endcsname}\hspace*{1\jlreq@mol}#1} + \long\def\@makesidetext#1{{\sffamily\bfseries\csname\jlreq@sidenotemarkname\endcsname}\hspace*{1\jlreq@mol}#1} \def\@makesidemark{\@makefnmark} \ifthenelse{\equal{\jlreq@referencemark}{interlinear}}{\def\@tempa{\jlreq@fixjfm}}{\def\@tempa{\inhibitglue}} \edef\jlreq@do{ @@ -2851,8 +2908,6 @@ \newcommand{\jlreq@inlinenote@endnote}{% \jlreq@in@inlinenotefalse {% -% \jlreq@inlinenote@kakkofontsize -% \hbox{)}\inhibitglue \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize)}% \jlreq@box@putcenter\jlreq@tempboxa \inhibitglue @@ -2926,7 +2981,21 @@ } % bottom-leftみたいなのを解釈する.入力の順番はどっちでも良いが,出力は<top/bottom><left/right>の順番 -% #1にセットする. +% #1 = bottom-leftみたいなのを{bottom}{left}に変換し,#2に代入,#3はデフォルト値,出力形式で入れる +\newcommand*{\jlreq@pagestyle@parse@position}[3]{% + \begingroup + \jlreq@pagestyle@parse@position@#1-\jlreq@endmark + % \jlreq@tempcに縦方向を,\jlreq@tempdに横方向を入れる + \def\jlreq@tempc{}\def\jlreq@tempd{}% + \jlreq@pagestyle@parse@position@@{\jlreq@tempa}% + \jlreq@pagestyle@parse@position@@{\jlreq@tempb}% + \ifx\jlreq@tempc\@empty\edef\jlreq@tempc{\expandafter\@firstoftwo#3}\fi + \ifx\jlreq@tempd\@empty\edef\jlreq@tempd{\expandafter\@secondoftwo#3}\fi + \edef\jlreq@do{\unexpanded{\def#2}{{\jlreq@tempc}{\jlreq@tempd}}}% + \expandafter\endgroup + \jlreq@do +} + \def\jlreq@pagestyle@parse@position@#1-#2\jlreq@endmark{% \def\jlreq@tempa{#1}\def\jlreq@tempb{#2}% \jlreq@ifempty{#2}{% @@ -2936,26 +3005,20 @@ \@tempa#2\relax }% } + \newcommand*\jlreq@pagestyle@parse@position@@[1]{% - \ifthenelse{\equal{#1}{top} \OR \equal{#1}{bottom}}{\def\jlreq@tempc{#1}}{% - \ifthenelse{\equal{#1}{left} \OR \equal{#1}{right} \OR \equal{#1}{center}}{\def\jlreq@tempd{#1}}{% - \ClassError{jlreq}{Invalid position: #1}{\@ehc}% - }% + \jlreq@switch{#1}{ + {top}{\def\jlreq@tempc{#1}} + {bottom}{\def\jlreq@tempc{#1}} + {left}{\def\jlreq@tempd{#1}} + {right}{\def\jlreq@tempd{#1}} + {center}{\def\jlreq@tempd{#1}} + {gutter}{\if@tate\def\jlreq@tempd{right}\else\def\jlreq@tempd{left}\fi} + {fore_edge}{\if@tate\def\jlreq@tempd{left}\else\def\jlreq@tempd{right}\fi} + {\ClassError{jlreq}{Invalid position: #1}{\@ehc}} }% } -\newcommand*{\jlreq@pagestyle@parse@position}[2]{% - \begingroup - \jlreq@pagestyle@parse@position@#2-\jlreq@endmark - % \jlreq@tempcに縦方向を,\jlreq@tempdに横方向を入れる - \def\jlreq@tempc{}\def\jlreq@tempd{}% - \expandafter\jlreq@pagestyle@parse@position@@\expandafter{\jlreq@tempa}% - \expandafter\jlreq@pagestyle@parse@position@@\expandafter{\jlreq@tempb}% - \ifx\jlreq@tempc\@empty\edef\jlreq@tempc{\expandafter\@firstoftwo#1}\fi - \ifx\jlreq@tempd\@empty\edef\jlreq@tempd{\expandafter\@secondoftwo#1}\fi - \edef\jlreq@do{\unexpanded{\def#1}{{\jlreq@tempc}{\jlreq@tempd}}}% - \expandafter\endgroup - \jlreq@do -} + % odd_running_head=_sectionのように下線から始まる場合,その値の見出し命令を柱に出すようにする. % 要するに\ps@***に\sectionmarkを定義するように仕込む. @@ -2966,48 +3029,41 @@ \newcommand*{\DeclarePageStyle}[2]{% \expandafter\edef\csname jlreq@pagestyle@setting@#1\endcsname{\unexpanded{#2}}% \begingroup - \def\jlreq@nombre@position{{bottom}{center}}% - \def\jlreq@running@head@position{{top}{center}}% + \def\jlreq@nombre@position{}% + \def\jlreq@running@head@position{}% \def\jlreq@nombre{\thepage}% \def\jlreq@odd@running@head{}% \def\jlreq@even@running@head{}% \def\jlreq@command{}% \def\jlreq@mark@format{}% + \def\jlreq@font{}% % 柱とノンブルの間 \def\jlreq@gap{1.5\zw}% \newif\ifjlreq@clearmark\jlreq@clearmarktrue + \newif\ifjlreq@tate\jlreq@tatefalse \jlreq@parsekeyval[PageStyle]{ - {nombre_position}{\jlreq@pagestyle@parse@position{\jlreq@nombre@position}{##1}} - {running_head_position}{\jlreq@pagestyle@parse@position{\jlreq@running@head@position}{##1}} + *{tate}{\jlreq@tatetrue} + *{yoko}{\jlreq@tatefalse} + {nombre_position}{\def\jlreq@nombre@position{##1}} + {running_head_position}{\def\jlreq@running@head@position{##1}} {nombre}{\def\jlreq@nombre{##1}} {odd_running_head}{\def\jlreq@odd@running@head{##1}} {even_running_head}{\def\jlreq@even@running@head{##1}} + {font}{\def\jlreq@font{##1}} {mark_format}{\edef\jlreq@mark@format{\unexpanded{##1}}} {command}{\edef\jlreq@command{\unexpanded{##1}}} {gap}{\def\jlreq@gap{##1}} {clear_mark}[true,false]{\csname jlreq@clearmark##1\endcsname} }{#2}% - \ifthenelse{\( - \boolean{@tate} \AND \( - \equal{\expandafter\@secondoftwo\jlreq@nombre@position}{right} \OR - \equal{\expandafter\@secondoftwo\jlreq@running@head@position}{right} - \)\) \OR \( - \(\NOT \boolean{@tate}\) \AND \( - \equal{\expandafter\@secondoftwo\jlreq@nombre@position}{left} \OR - \equal{\expandafter\@secondoftwo\jlreq@running@head@position}{left} - \) - \)}{% - \if@twoside - \jlreq@warning{柱やノンブルは,左ページでは,基本版面の左端の延長線にノンブル又は柱の先頭をそろえて配置するか,基本版面の左端の延長線から基本版面の文字サイズの全角アキだけ右に寄せた位置に配置する (ページスタイル #1 内,2.6.1.b)}% - \fi - }{}% - \ifthenelse{\lengthtest{\jlreq@gap < 1.49\zw} \OR \( \lengthtest{\jlreq@gap > 1.51\zw} \AND \lengthtest{\jlreq@gap < 1.99\zw} \) \OR \lengthtest{\jlreq@gap > 2.01\zw}}{\jlreq@warning{ノンブルと柱との空き量は文字サイズの2倍又は1.5倍とする (ページスタイル #1 内,2.6.1.c)}}{}% % 見出しを出す場合:evenに章などの高いレベルの見出しを出す(2.6.3.a) \def\jlreq@markdefinition{}% \def\jlreq@even@running@head@level{}% - % **markを作る - % \jlreq@makemark{odd/even}running_headの中身\jlreq@endmark \def\jlreq@markdefinition{}% + % _***な指定な時に, + % * \jlreq@[even/odd]@running@headを\leftmarkや\rightmarkに書き換える + % * \jlreq@markdefinitionに\***markを定義するマクロを入れる. + % また\jlreq@[even/odd]@running@head@levelに見出しのレベルを入れる. + % \jlreq@makemark{odd/even}running_headの中身\jlreq@endmark \def\jlreq@makemark##1##2##3\jlreq@endmark{% \ifx_##2% \ifthenelse{\equal{##1}{even}}{% @@ -3018,6 +3074,7 @@ \@ifundefined{jlreq@heading@setting@##3}{}{% \expandafter\edef\csname jlreq@##1@running@head@level\endcsname{\csname jlreq@heading@level@##3\endcsname}% }% + % mark_formatを調べる \def\jlreq@tempa####1{% \jlreq@tempafalse \let\jlreq@result=\@undefined @@ -3030,7 +3087,8 @@ \ifx\jlreq@result\@undefined \edef\jlreq@result{\expandonce{\csname the##3\endcsname}\noexpand\quad\unexpanded{####1}}% \fi - \ifthenelse{\equal{##1}{even}}{% + % どっちを\markbothにしてどっちを\markrightにするかは縦組か横組かに依る + \ifthenelse{\equal{##1}{\if@tate odd\else even\fi}}{% \def\jlreq@markcommand{\markboth}% \def\jlreq@markcommandafter{{}}% }{% @@ -3039,7 +3097,7 @@ }% \edef\jlreq@markdefinition{% \expandonce{\jlreq@markdefinition}% - \noexpand\def\expandonce{\csname ##3mark\endcsname}\unexpanded{####1}{\expandonce{\jlreq@markcommand} + \noexpand\def\expandonce{\csname ##3mark\endcsname}\unexpanded{####1}{\expandonce{\jlreq@markcommand}% {\expandonce{\jlreq@result}}\expandonce{\jlreq@markcommandafter}}% }% \fi @@ -3055,79 +3113,182 @@ \jlreq@warning{偶数ページには奇数ページよりアウトラインレベルの高い見出しを入れる (ページスタイル #1内,2.6.3.a)}% \fi \fi\fi - % ##1 ##2 ##3と並んだヘッダを作る,戻り値は\jlreq@result - \def\jlreq@setheadfoot@##1##2##3{% - % -.5\zwは端にそろえるための補正 - \jlreq@ifempty{##1}{\def\jlreq@left{}}{\edef\jlreq@left{\noexpand\hspace*{\dimexpr\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate - 0.5\zw\fi\relax}\unexpanded{##1}}}% - % +\topskip - .5\zwは\jlreq@headfoot@sidemargin = 0ptの時に本文の右に一致させるための補正. - \jlreq@ifempty{##3}{\def\jlreq@right{}}{\edef\jlreq@right{\unexpanded{##3}\noexpand\hspace*{\dimexpr\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate + \topskip - .5\zw\fi\relax}}}% - \jlreq@ifempty{##2}{% - \edef\jlreq@result{\expandonce{\jlreq@left}\hfil\expandonce{\jlreq@right}}% - \jlreq@ifempty{##1}{\jlreq@ifempty{##3}{\def\jlreq@result{}}{}}{}% - }{% - \ifx\jlreq@left\@empty\else\edef\jlreq@left{\noexpand\hbox to 0pt{\expandonce{\jlreq@left}\hss}}\fi - \ifx\jlreq@right\@empty\else\edef\jlreq@right{\noexpand\hbox to 0pt{\hss\expandonce{\jlreq@right}}}\fi - \edef\jlreq@result{\expandonce{\jlreq@left}\hfil\unexpanded{##2}\hfil\expandonce{\jlreq@right}}% + % \jlreq@[even/odd][head/foot]に入れていく.tateか否かで場合分け. + \ifjlreq@tate\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{% + \ifx\jlreq@nombre@position\@empty\def\jlreq@nombre@position{0pt}\fi + \ifx\jlreq@running@head@position\@empty\def\jlreq@running@head@position{0pt}\fi + \if@tate\else + \jlreq@warning{ノンブルおよび柱を縦組にして配置するのは縦組の場合のみである (ページスタイル #1 内,2.6.1)}% + \fi + % 柱とノンブルを入れる箱を作る(\jlreq@resultを展開すると\setboxするマクロがでる) + \def\jlreq@make@tatebox##1{% + \edef\jlreq@result{% + \unexpanded{\setbox\jlreq@tempboxa=\hbox to }% + \unexpanded{\dimexpr\headsep + \headheight + \textheight}\if@tate\else\unexpanded{ - \topskip + 1\zh}\fi\noexpand\relax + {\unexpanded{\tate\adjustbaseline}% + \ifx##1\@empty\else + \noexpand\hspace{\unexpanded{\dimexpr\headsep + \headheight + }% + \if@tate\else\unexpanded{\topskip - \Cht + }\fi + \expandonce{\jlreq@running@head@position}\noexpand\relax}% + \expandonce{##1}% + \fi + \ifx\jlreq@nombre\@empty\else + \noexpand\hfill + \expandonce{\jlreq@nombre}% + \ifdim\dimexpr\jlreq@nombre@position\relax=0pt\else + \unexpanded{\hspace{\dimexpr\jlreq@nombre@position\relax}}% + \fi + \fi + }% + % Overfull防止 + \ifx l\jlreq@engine + \unexpanded{\wd\jlreq@tempboxa=\headheight}% + \else + \unexpanded{\ht\jlreq@tempboxa=\headheight\dp\jlreq@tempboxa=0pt}% + \fi + }% }% - }% - % ##2を##1 = left/center/rightの場所,##4を##3の場所に置く.被った場合は##2を外側にする. - % 戻り値は\jlreq@result - \def\jlreq@setheadfoot##1##2##3##4{% - \def\jlreq@left{}\def\jlreq@center{}\def\jlreq@right{}% - % \ifjlreq@tempa = if(##1 == ##3 && ##2 != "" && ##4 != "") - \jlreq@tempatrue - \jlreq@ifempty{##2}{\jlreq@tempafalse}{}% - \jlreq@ifempty{##4}{\jlreq@tempafalse}{}% - \ifthenelse{\equal{##1}{##3}}{}{\jlreq@tempafalse}% - \ifjlreq@tempa - \ifthenelse{\equal{##1}{right}}{% - \edef\jlreq@right{\unexpanded{##4}\noexpand\hspace{\gap}\unexpanded{##2}}% - }{% - \expandafter\edef\csname jlreq@##1\endcsname{\unexpanded{##2}\noexpand\hspace{\gap}\unexpanded{##4}}% + % 左に配置するヘッダ.#1は柱の中身.(一回展開で正しくでてくる.) + \def\jlreq@make@lefthead##1{% + \jlreq@make@tatebox{##1}% + \edef\jlreq@lefthead{% + \expandonce{\jlreq@result}% + \noexpand\hspace{\noexpand\dimexpr + \if@tate\unexpanded{-\Cdp}\fi - \unexpanded{\headsep - 1\zw}% + \noexpand\relax}% + \unexpanded{\box\jlreq@tempboxa\hfil}% }% + }% + % 右に配置するヘッダ. + \def\jlreq@make@righthead##1{% + \jlreq@make@tatebox{##1}% + \edef\jlreq@righthead{% + \expandonce{\jlreq@result}% + \noexpand\hspace{\unexpanded{\dimexpr\textwidth} + \if@tate\unexpanded{- \topskip + \Cht}\fi + \unexpanded{ + \headsep}% + \noexpand\relax}% + \unexpanded{\box\jlreq@tempboxa\hss}% + }% + }% + \if@tate + \jlreq@make@lefthead{\jlreq@odd@running@head}% + \let\jlreq@oddhead=\jlreq@lefthead + \jlreq@make@righthead{\jlreq@even@running@head}% + \let\jlreq@evenhead=\jlreq@righthead \else - \jlreq@ifempty{##2}{}{\expandafter\def\csname jlreq@##1\endcsname{##2}}% - \jlreq@ifempty{##4}{}{\expandafter\def\csname jlreq@##3\endcsname{##4}}% + \jlreq@make@righthead{\jlreq@odd@running@head}% + \let\jlreq@oddhead=\jlreq@righthead + \jlreq@make@lefthead{\jlreq@even@running@head}% + \let\jlreq@evenhead=\jlreq@lefthead \fi - \edef\jlreq@do{\noexpand\jlreq@setheadfoot@{\expandonce{\jlreq@left}}{\expandonce{\jlreq@center}}{\expandonce{\jlreq@right}}}% - \jlreq@do - }% - % \nombre@<top/bottom>を定義 - \def\jlreq@nombre@top{}\def\jlreq@nombre@bottom{}% - \expandafter\edef\csname jlreq@nombre@\expandafter\@firstoftwo\jlreq@nombre@position\endcsname{\expandonce{\jlreq@nombre}}% - % \odd@running@head@<top/bottom>を定義 - \def\jlreq@odd@running@head@top{}\def\jlreq@odd@running@head@bottom{}% - \expandafter\edef\csname jlreq@odd@running@head@\expandafter\@firstoftwo\jlreq@running@head@position\endcsname{\expandonce{\jlreq@odd@running@head}}% - % \@oddheadを定義 - \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@top}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@odd@running@head@top}}}% - \jlreq@do\let\jlreq@oddhead=\jlreq@result - % \@oddfootを定義 - \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@bottom}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@odd@running@head@bottom}}}% - \jlreq@do\let\jlreq@oddfoot=\jlreq@result - % ##1 = {}{}の後ろを逆にする - \def\getoppositeposition##1{% - \jlreq@switch{\expandafter\@secondoftwo##1}{ - {center}{\def\jlreq@tempe{center}} - {right}{\def\jlreq@tempe{left}} - {left}{\def\jlreq@tempe{right}} + \let\jlreq@oddfoot=\@empty + \let\jlreq@evenfoot=\@empty + }{% yoko + \ifx\jlreq@nombre@position\@empty\def\jlreq@nombre@position{bottom-center}\fi + \expandafter\jlreq@pagestyle@parse@position\expandafter{\jlreq@nombre@position}{\jlreq@nombre@position}{{bottom}{center}}% + \ifx\jlreq@running@head@position\@empty\def\jlreq@running@head@position{top-center}\fi + \expandafter\jlreq@pagestyle@parse@position\expandafter{\jlreq@running@head@position}{\jlreq@running@head@position}{{top}{center}}% + \ifx\jlreq@running@head@position\@empty\def\jlreq@running@head@position{{top}{center}}\fi + \ifthenelse{\( + \boolean{@tate} \AND \( + \equal{\expandafter\@secondoftwo\jlreq@nombre@position}{right} \OR + \equal{\expandafter\@secondoftwo\jlreq@running@head@position}{right} + \)\) \OR \( + \(\NOT \boolean{@tate}\) \AND \( + \equal{\expandafter\@secondoftwo\jlreq@nombre@position}{left} \OR + \equal{\expandafter\@secondoftwo\jlreq@running@head@position}{left} + \) + \)}{% + \if@twoside + \jlreq@warning{柱やノンブルは,左ページでは,基本版面の左端の延長線にノンブル又は柱の先頭をそろえて配置するか,基本版面の左端の延長線から基本版面の文字サイズの全角アキだけ右に寄せた位置に配置する (ページスタイル #1 内,2.6.1.b)}% + \fi + }{}% + {\jlreq@font + \ifthenelse{\lengthtest{\jlreq@gap < 1.49\zw} \OR \( \lengthtest{\jlreq@gap > 1.51\zw} \AND \lengthtest{\jlreq@gap < 1.99\zw} \) \OR \lengthtest{\jlreq@gap > 2.01\zw}}{\jlreq@warning{ノンブルと柱との空き量は文字サイズの2倍又は1.5倍とする (ページスタイル #1 内,2.6.1.c)}}{}% + }% + % ##2を##1 = left/center/rightの場所,##4を##3の場所に置く.被った場合は##2を外側にする. + % 戻り値は\jlreq@result + \def\jlreq@setheadfoot##1##2##3##4{% + % 左,真ん中,右に置くもの(対応するものがなければ空)をそれぞれ格納する. + \def\jlreq@left{}\def\jlreq@center{}\def\jlreq@right{}% + % \ifjlreq@tempa = if(##1 == ##3 && ##2 != "" && ##4 != "") + \jlreq@tempatrue + \jlreq@ifempty{##2}{\jlreq@tempafalse}{}% + \jlreq@ifempty{##4}{\jlreq@tempafalse}{}% + \ifthenelse{\equal{##1}{##3}}{}{\jlreq@tempafalse}% + \ifjlreq@tempa + \ifthenelse{\equal{##1}{right}}{% + \edef\jlreq@right{\unexpanded{##4}\noexpand\hspace{\expandonce{\jlreq@gap}}\unexpanded{##2}}% + }{% + \expandafter\edef\csname jlreq@##1\endcsname{\unexpanded{##2}\noexpand\hspace{\expandonce{\jlreq@gap}}\unexpanded{##4}}% + }% + \else + \jlreq@ifempty{##2}{}{\expandafter\def\csname jlreq@##1\endcsname{##2}}% + \jlreq@ifempty{##4}{}{\expandafter\def\csname jlreq@##3\endcsname{##4}}% + \fi + % フォント命令を挿入 + \ifx\jlreq@font\@empty\else + \ifx\jlreq@left\@empty\else\edef\jlreq@left{{\expandonce{\jlreq@font}\expandonce{\jlreq@left}}}\fi + \ifx\jlreq@center\@empty\else\edef\jlreq@center{{\expandonce{\jlreq@font}\expandonce{\jlreq@center}}}\fi + \ifx\jlreq@right\@empty\else\edef\jlreq@right{{\expandonce{\jlreq@font}\expandonce{\jlreq@right}}}\fi + \fi + % \jlreq@setheadfoot@に回して処理 + \edef\jlreq@do{\noexpand\jlreq@setheadfoot@{\expandonce{\jlreq@left}}{\expandonce{\jlreq@center}}{\expandonce{\jlreq@right}}}% + \jlreq@do + }% + % ##1 ##2 ##3と並んだヘッダを作る,戻り値は\jlreq@result + \def\jlreq@setheadfoot@##1##2##3{% + % - \Cdpは端にそろえるための補正 + \jlreq@ifempty{##1}{\def\jlreq@left{}}{\edef\jlreq@left{\noexpand\hspace{\dimexpr\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate - \Cdp\fi\relax}\unexpanded{##1}}}% + % +\topskip - \Chtは\jlreq@headfoot@sidemargin = 0ptの時に本文の右に一致させるための補正. + \jlreq@ifempty{##3}{\def\jlreq@right{}}{\edef\jlreq@right{\unexpanded{##3}\noexpand\hspace{\dimexpr\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate + \topskip - \Cht\fi\relax}}}% + \jlreq@ifempty{##2}{% + \edef\jlreq@result{\expandonce{\jlreq@left}\hfil\expandonce{\jlreq@right}}% + \jlreq@ifempty{##1}{\jlreq@ifempty{##3}{\def\jlreq@result{}}{}}{}% + }{% + \ifx\jlreq@left\@empty\else\edef\jlreq@left{\noexpand\hbox to 0pt{\expandonce{\jlreq@left}\hss}}\fi + \ifx\jlreq@right\@empty\else\edef\jlreq@right{\noexpand\hbox to 0pt{\hss\expandonce{\jlreq@right}}}\fi + \edef\jlreq@result{\expandonce{\jlreq@left}\hfil\unexpanded{##2}\hfil\expandonce{\jlreq@right}}% + }% + }% + % \nombre@<top/bottom>を定義 + \def\jlreq@nombre@top{}\def\jlreq@nombre@bottom{}% + \expandafter\edef\csname jlreq@nombre@\expandafter\@firstoftwo\jlreq@nombre@position\endcsname{\expandonce{\jlreq@nombre}}% + % \odd@running@head@<top/bottom>を定義 + \def\jlreq@odd@running@head@top{}\def\jlreq@odd@running@head@bottom{}% + \expandafter\edef\csname jlreq@odd@running@head@\expandafter\@firstoftwo\jlreq@running@head@position\endcsname{\expandonce{\jlreq@odd@running@head}}% + % \@oddheadを定義 + \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@top}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@odd@running@head@top}}}% + \jlreq@do\let\jlreq@oddhead=\jlreq@result + % \@oddfootを定義 + \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@bottom}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@odd@running@head@bottom}}}% + \jlreq@do\let\jlreq@oddfoot=\jlreq@result + % ##1 = {}{}の後ろを逆にする + \def\getoppositeposition##1{% + \jlreq@switch{\expandafter\@secondoftwo##1}{ + {center}{\def\jlreq@tempe{center}} + {right}{\def\jlreq@tempe{left}} + {left}{\def\jlreq@tempe{right}} + }% + \edef##1{{\expandafter\@firstoftwo##1}{\jlreq@tempe}}% }% - \edef##1{{\expandafter\@firstoftwo##1}{\jlreq@tempe}}% + \getoppositeposition\jlreq@nombre@position + \getoppositeposition\jlreq@running@head@position + % 上と同じことをする + % \nombre@<top/bottom>を定義 + \def\jlreq@nombre@top{}\def\jlreq@nombre@bottom{}% + \expandafter\edef\csname jlreq@nombre@\expandafter\@firstoftwo\jlreq@nombre@position\endcsname{\expandonce{\jlreq@nombre}}% + % \even@running@head@<top/bottom>を定義 + \def\jlreq@even@running@head@top{}\def\jlreq@even@running@head@bottom{}% + \expandafter\edef\csname jlreq@even@running@head@\expandafter\@firstoftwo\jlreq@running@head@position\endcsname{\expandonce{\jlreq@even@running@head}}% + % \@evenheadを定義 + \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@top}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@even@running@head@top}}}% + \jlreq@do\let\jlreq@evenhead=\jlreq@result + % \@evenfootを定義 + \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@bottom}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@even@running@head@bottom}}}% + \jlreq@do\let\jlreq@evenfoot=\jlreq@result }% - \getoppositeposition\jlreq@nombre@position - \getoppositeposition\jlreq@running@head@position - % 上と同じことをする - % \nombre@<top/bottom>を定義 - \def\jlreq@nombre@top{}\def\jlreq@nombre@bottom{}% - \expandafter\edef\csname jlreq@nombre@\expandafter\@firstoftwo\jlreq@nombre@position\endcsname{\expandonce{\jlreq@nombre}}% - % \even@running@head@<top/bottom>を定義 - \def\jlreq@even@running@head@top{}\def\jlreq@even@running@head@bottom{}% - \expandafter\edef\csname jlreq@even@running@head@\expandafter\@firstoftwo\jlreq@running@head@position\endcsname{\expandonce{\jlreq@even@running@head}}% - % \@evenheadを定義 - \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@top}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@even@running@head@top}}}% - \jlreq@do\let\jlreq@evenhead=\jlreq@result - % \@evenfootを定義 - \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@bottom}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@even@running@head@bottom}}}% - \jlreq@do\let\jlreq@evenfoot=\jlreq@result \edef\jlreq@do{% \noexpand\def\expandonce{\csname ps@#1\endcsname}{% \unexpanded{\def\jlreq@current@pagestyle{#1}}% @@ -3138,6 +3299,7 @@ \unexpanded{\def\@evenhead}{\expandonce{\jlreq@evenhead}}% \unexpanded{\def\@evenfoot}{\expandonce{\jlreq@evenfoot}}% }% + % \jlreq@markdefinition/\jlreq@commandは引数トークンを持つ可能性がある \noexpand\edef\expandonce{\csname ps@#1\endcsname}{% \noexpand\expandonce{\expandonce{\csname ps@#1\endcsname}}% \noexpand\unexpanded{\expandonce{\jlreq@markdefinition}}% @@ -3199,6 +3361,9 @@ \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,clear_mark=false} \fi +\ModifyPageStyle{plain}{font=\small} +\ModifyPageStyle{headings}{font=\small} +\ModifyPageStyle{myheadings}{font=\small} %. フロート関連 % 4.3.3.dの例,縦組みの時だけど横にも適用…… @@ -3225,7 +3390,7 @@ \vskip\belowcaptionskip}} \jlreq@jlreqsetup@add{caption_font}{\def\jlreq@@makecaption@font{#1}} \jlreq@jlreqsetup@add{caption_label_font}{\def\jlreq@@makecaption@label@font{#1}} -\jlreqsetup{caption_font=\headfont,caption_label_font=\headfont} +\jlreqsetup{caption_font={\sffamily\bfseries},caption_label_font={\sffamily\bfseries}} % 特に根拠のない値 \setlength\abovecaptionskip{.5\jlreq@gol} \setlength\belowcaptionskip{0pt} @@ -3235,23 +3400,22 @@ % \begin{figure}\layoutfloat{***}\pcaption{???}\end{figure}にする. % %\long\def\jlreq@replace@layoutfloat#1\caption{\layoutfloat{#1}\jlreq@caption} -%\long\def\jlreq@caption#1{\ifx#1\jlreq@endmark\else\pcaption{#1}\expandafter\jlreq@replace@layoutfloat\fi} +%\long\def\jlreq@caption#1{\jlreq@ifendmark{#1}{}{\pcaption{#1}\csname\jlreq@replace@layoutfloat@#1\endcsname}} %\def\jlreq@modify@float#1{% -% \def\lgdef{\long\gdef} % \jlreq@saveoriginalcs{#1} % \@namedef{#1}{\@ifnextchar[{\@nameuse{jlreq@float@#1}}{\@nameuse{jlreq@float@@#1}}} -% \expandafter\lgdef\csname jlreq@float@#1\endcsname[##1]{% -% \expandafter\csname jlreq@original@#1\endcsname[##1] -% \csname jlreq@process@insertlayoutfloat@#1\endcsname{} +% \expandafter\long\expandafter\gdef\csname jlreq@float@#1\endcsname[##1]{% +% \csname jlreq@original@#1\endcsname[##1]% +% \csname jlreq@process@insertlayoutfloat@#1\endcsname{}% % } -% \expandafter\lgdef\csname jlreq@float@@#1\endcsname{% -% \expandafter\csname jlreq@original@#1\endcsname -% \csname \jlreq@process@insertlayoutfloat@#1\endcsname{} +% \expandafter\long\expandafter\gdef\csname jlreq@float@@#1\endcsname{% +% \csname jlreq@original@#1\endcsname +% \csname jlreq@process@insertlayoutfloat@#1\endcsname{}% % } -% \expandafter\lgdef\csname jlreq@process@insertlayoutfloat@#1\endcsname ##1##2\end{% +% \expandafter\long\expandafter\gdef\csname jlreq@process@insertlayoutfloat@#1\endcsname ##1##2\end{% % \csname jlreq@checkenvname@#1\endcsname{##1##2}\end % } -% \expandafter\lgdef\csname jlreq@checkenvname@#1\endcsname ##1\end##2{% +% \expandafter\long\expandafter\gdef\csname jlreq@checkenvname@#1\endcsname ##1\end##2{% % \def\@tempa{##2}% % \def\@tempb{#1}% % \ifx\@tempa\@tempb @@ -3262,6 +3426,7 @@ % \jlreq@next % } %} +%\jlreq@aftercls@addtodeletecs{\jlreq@modify@float} %.. figure環境 \newcounter{figure} @@ -3400,8 +3565,6 @@ \end{center}% \par \vskip\baselineskip -% \setbox\jlreq@tempboxa=\vbox{\everypar{}\leavevmode\begin{center}あいうえお\end{center}}% -% \unvbox\jlreq@tempboxa \ifvoid\jlreq@abstractbox\else\unvbox\jlreq@abstractbox\fi } @@ -3494,7 +3657,7 @@ % \let\jlreq@original@@item=\@item % \def\@item[##1]{\jlreq@original@@item[##1]\mbox{}\par }}{\endlist} -\newcommand{\descriptionlabel}[1]{\normalfont\headfont #1} +\newcommand{\descriptionlabel}[1]{\normalfont\sffamily\bfseries #1} % enumerateとitemize % 見出しが一つ上のレベルからどのくらいずれているかを入れる. @@ -3861,7 +4024,7 @@ \else \def\thechapter{\Alph{chapter}}% \fi - \ModifyHeading{chapter}{label_format={付録\thechapter\quad}}% + \ModifyHeading{chapter}{label_format={付録\thechapter}}% \ifx\jlreq@current@pagestyle\@undefined\else \ifthenelse{\equal{\jlreq@current@pagestyle}{headings}}{% \def\chaptermark#1{\markboth{付録\thechapter\quad #1}{}}% @@ -3906,19 +4069,19 @@ \jlreq@saveoriginalcs{@begintheorem} \def\@begintheorem#1#2{\topsep=\jlreq@theorem@abovebelowspace \trivlist\labelsep=1\jlreq@mol - \item[\hskip \labelsep{\headfont #1\ #2}]} + \item[\hskip \labelsep{\sffamily\bfseries #1\ #2}]} \jlreq@saveoriginalcs{@opargbegintheorem} \def\@opargbegintheorem#1#2#3{\topsep=\jlreq@theorem@abovebelowspace \trivlist\labelsep=1\jlreq@mol - \item[\hskip \labelsep{\headfont #1\ #2(#3)}]} + \item[\hskip \labelsep{\sffamily\bfseries #1\ #2(#3)}]} \AtEndOfPackageFile*{amsthm}{ - \newtheoremstyle{jlreq}{\jlreq@theorem@abovebelowspace}{\jlreq@theorem@abovebelowspace}{\normalfont}{}{\headfont}{}{1\jlreq@mol}{\thmname{#1}\thmnumber{\ #2}\thmnote{ (#3)}} + \newtheoremstyle{jlreq}{\jlreq@theorem@abovebelowspace}{\jlreq@theorem@abovebelowspace}{\normalfont}{}{\sffamily\bfseries}{}{1\jlreq@mol}{\thmname{#1}\thmnumber{\ #2}\thmnote{ (#3)}} \theoremstyle{jlreq} \jlreq@saveoriginalcs{proof} \jlreq@saveoriginalcs{endproof} \def\proof{\@ifnextchar[{\jlreq@proof}{\jlreq@proof[\proofname]}} - \def\jlreq@proof[#1]{\labelsep=1\jlreq@mol\jlreq@original@proof[{\normalfont\headfont #1\inhibitglue}\nopunct]} + \def\jlreq@proof[#1]{\labelsep=1\jlreq@mol\jlreq@original@proof[{\normalfont\sffamily\bfseries #1\inhibitglue}\nopunct]} \renewcommand{\proofname}{証明} } |