summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/jlreq
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-29 21:02:07 +0000
committerKarl Berry <karl@freefriends.org>2017-08-29 21:02:07 +0000
commit3de87825b7a5cd47065c0c4522b0d355fd6607d8 (patch)
tree876c8433bf1213d869b72b0f36016fa2ee2ec14d /Master/texmf-dist/tex/latex/jlreq
parent9be802636efdf9737227f59f80216b3cd1b2cd82 (diff)
jlreq (29aug17)
git-svn-id: svn://tug.org/texlive/trunk@45162 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/jlreq')
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq.cls85
1 files changed, 32 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
index 5a62b68228e..9ea6a9bf3ec 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/08/13 jlreq]
+\ProvidesClass{jlreq}[2017/08/29 jlreq]
\RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
%. helper1
@@ -31,9 +31,7 @@
\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
+ \ifundef{#1}{\ClassError{jlreq}{Trying to delete \string#1\space even though it is not defined, maybe a bug}{\@ehc}}{\undef{#1}}%
}
% クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする
@@ -54,7 +52,7 @@
\AtEndOfClass{%
\jlreq@aftercls@deletecslist
\jlreq@undefcs{\jlreq@aftercls@deletecslist}%
- \let\jlreq@undefcs=\@undefined
+ \undef{\jlreq@undefcs}%
}
\def\jlreq@uniqtoken{\jlreq@uniqtoken}
@@ -747,7 +745,7 @@
}
\fi
\newcount\jlreq@lastnodechar
-% \futurelet\jlreq@nextchar\jlreq@fixjfm の形で使う.
+% \jlreq@fixjfm<次の文字>の形で使う.
% jlreq@lastnodecharに入っている値と次のトークン(\futureletで得る)の間に入るJFMグルー等を挿入する
\newcommand*{\jlreq@fixjfm}{%
\ifnum\jlreq@lastnodechar>-1
@@ -1207,17 +1205,8 @@
% \item後の行頭括弧のために仕込み.
\jlreq@saveoriginalcs{list}
\jlreq@saveoriginalcs{endlist}
- \edef\jlreq@do{
- \unexpanded{\def\list#1#2}{%
- \unexpanded{\jlreq@pushhook@postpar{\directlua{luatexja.jfmglue.create_beginpar_node()}}}%
- \expandonce{\list{#1}{#2}}%
- }
- \unexpanded{\def\endlist}{%
- \expandonce{\endlist}%
- \noexpand\jlreq@pophook@postpar
- }
- }
- \jlreq@do
+ \pretocmd{\list}{\jlreq@pushhook@postpar{\directlua{luatexja.jfmglue.create_beginpar_node()}}}{}{}%
+ \apptocmd{\endlist}{\jlreq@pophook@postpar}
\else
% 非LuaTeXの場合はJFMの入れ替えと\everyparでの処理で対処.
% 行頭括弧に対して\inhibitglueを入れたりする命令を作る
@@ -1362,6 +1351,7 @@
\AtBeginDocument{\catcode` =\active}
\fi
+% \jaspace
\DeclareRobustCommand*{\jaspace}[1]{%
\expandafter\ifx\csname jlreq@jaspace@#1\endcsname\relax\ClassError{jlreq}{unknown jaspace: #1}{\@ehc}%
\else\csname jlreq@jaspace@#1\endcsname\fi
@@ -1422,13 +1412,7 @@
%.. 文字サイズ変更
\def\jlreq@setfontsizehook{}% set@fontsizeの最後に実行される.
\jlreq@saveoriginalcs{set@fontsize}
-\edef\jlreq@do{
- \unexpanded{\def\set@fontsize#1#2#3}{%
- \expandonce{\set@fontsize{#1}{#2}{#3}}%
- \noexpand\jlreq@setfontsizehook
- }
-}
-\jlreq@do
+\apptocmd{\set@fontsize}{\jlreq@setfontsizehook}{}{}
\appto\jlreq@setfontsizehook{\ifdim\parindent>0pt\setlength{\parindent}{1\zw}\fi}
\ifx l\jlreq@engine
\@tempskipa=\ltjgetparameter{kanjiskip}
@@ -1493,10 +1477,11 @@
\belowdisplayskip \abovedisplayskip}
% tsize10.cloの引数を,そのまま\jlreq@fontsize/\jlreq@baselineskipでスケーリングしているだけ.
\newcommand{\small}{%
- \@setfontsize\small{.9\jlreq@fontsize}{\dimexpr 11\jlreq@baselineskip/17\relax}%
- \abovedisplayskip .85\jlreq@fontsize \@plus.3\jlreq@fontsize \@minus.4\jlreq@fontsize
- \abovedisplayshortskip \z@ \@plus.2\jlreq@fontsize
- \belowdisplayshortskip .4\jlreq@fontsize \@plus.2\jlreq@fontsize \@minus.2\jlreq@fontsize
+ % jsarticleのもの
+ \@setfontsize\small{.9\jlreq@fontsize}{\dimexpr 13\jlreq@baselineskip/17\relax}%
+ \abovedisplayskip .9\jlreq@fontsize \@plus.3\jlreq@fontsize \@minus.4\jlreq@fontsize
+ \abovedisplayshortskip \z@ \@plus.3\jlreq@fontsize
+ \belowdisplayshortskip \abovedisplayshortskip
\belowdisplayskip \abovedisplayskip}
\newcommand{\scriptsize}{\@setfontsize\scriptsize{\dimexpr 7\jlreq@fontsize/10\relax}{\dimexpr 8\jlreq@baselineskip/17\relax}}
\newcommand{\tiny}{\@setfontsize\tiny{\dimexpr 5\jlreq@fontsize/10\relax}{\dimexpr 6\jlreq@baselineskip/17\relax}}
@@ -1922,6 +1907,7 @@
\expandafter\jlreq@tempa\expandafter{\jlreq@tempb}%
}%
\expandafter\jlreq@do\expandafter{\jlreq@startBlockHeading@totalformat}%
+ \ignorespaces
}
\def\jlreq@startBlockHeading@removecolumn#1:{#1}
@@ -2822,10 +2808,7 @@
% \theendnoteの出力を仕込む
\PushPostHook{par}{\jlreq@endnote@parhook}
-\edef\jlreq@do{
- \unexpanded{\def\jlreq@hook@beforeheadings#1}{\expandonce{\jlreq@hook@beforeheadings{#1}}\unexpanded{\jlreq@endnote@hook@beforeheadings{#1}}}
-}
-\jlreq@do
+\apptocmd{\jlreq@hook@beforeheadings}{\jlreq@endnote@hook@beforeheadings{#1}}{}{}
\jlreq@jlreqsetup@add{endnote_position}{
\def\jlreq@endnote@parhook{}
@@ -2861,12 +2844,7 @@
}
\ifjlreq@tempa
- \edef\jlreq@do{%
- \unexpanded{\def\jlreq@endnote@hook@beforeheadings##1}{\expandonce{\jlreq@endnote@hook@beforeheadings{##1}}%
- \noexpand\theendnotes
- }
- }
- \jlreq@do
+ \apptocmd{\jlreq@endnote@hook@beforeheadings}{\theendnotes}{}{}
\else
\@for\@tempa:=\jlreq@tempc\do{
\ifx\@tempa\@empty\else
@@ -2946,9 +2924,9 @@
\fi
\def\@makesidemark{\@makefnmark}
}{% sidenote_type = symbol
- \def\sidenote{\jlreq@sidenote}
- \def\sidenotemark{\jlreq@sidenotemark}
- \def\sidenotetext{\jlreq@sidenotetext}
+ \long\def\sidenote#1#2{\jlreq@sidenote{#1}{#2}}
+ \def\sidenotemark#1{\jlreq@sidenotemark{#1}}
+ \long\def\sidenotetext#1#2{\jlreq@sidenotetext{#1}{#2}}
\long\def\jlreq@sidenote#1#2{\jlreq@sidenotemark{#1}\jlreq@sidenotetext{#1}{#2}}
\edef\jlreq@sidenotemark#1{%
{\unexpanded{\reset@font\jlreq@sidenote@keywordfont}#1}%
@@ -2966,18 +2944,8 @@
\long\def\@makesidetext#1{{\sffamily\bfseries\csname\jlreq@sidenotemarkname\endcsname}\hspace*{1\jlreq@mol}#1}
\def\@makesidemark{\@makefnmark}
- \edef\jlreq@do{
- % \jlreq@lastnodecharの仕込みはすんでいる
- \unexpanded{\long\def\sidenote#1#2}{%
- \expandonce{\sidenote{#1}{#2}}%
- \noexpand\jlreq@hook@postnote
- }
- \unexpanded{\long\def\sidenotemark#1}{%
- \expandonce{\sidenotemark{#1}}%
- \noexpand\jlreq@hook@postnote
- }
- }
- \jlreq@do
+ \apptocmd{\sidenote}{\jlreq@hook@postnote}{}{}
+ \apptocmd{\sidenotemark}{\jlreq@hook@postnote}{}{}
}
}
\jlreq@jlreqsetup@add{sidenote_symbol}{\def\jlreq@sidenote@defaultmark{#1}}
@@ -3759,6 +3727,11 @@
\vskip\baselineskip%
{\Large
\lineskip .75em%
+ % 縦書き時には表組み内でも縦書きにするようにする
+ \if@tate
+ \let\jlreq@temporary@original@ialign=\ialign
+ \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
+ \fi
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
@@ -3823,6 +3796,11 @@
\vskip\baselineskip
{\jlreq@keepbaselineskip{\large}%
\lineskip .5\jlreq@gol
+ % 縦書き時には表組み内でも縦書きにするようにする
+ \if@tate
+ \let\jlreq@temporary@original@ialign=\ialign
+ \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
+ \fi
\begin{tabular}[t]{c}%
\@author
\end{tabular}%
@@ -4240,6 +4218,7 @@
}{%
\if@restonecol\onecolumn\else\clearpage\fi
\ifjlreq@resttate\tate\fi
+ \jlreq@oldfontcommand@disable
}
\newcommand{\@idxitem}{\par\hangindent 4\jlreq@mol}
\newcommand{\subitem}{\@idxitem \hspace*{2\jlreq@mol}}