OSDN Git Service

ltjsclasses: sync with jsclasses
[luatex-ja/luatexja.git] / src / ltjsarticle.cls
index 6b05930..df5287c 100644 (file)
@@ -38,7 +38,8 @@
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjsarticle}
-  [2016/07/15 ltjsclasses ]
+  [2016/08/27 ltjsclasses ]
+\def\jsc@clsname{ltjsarticle}
 \RequirePackage{luatexja}
 \newif\if@restonecol
 \newif\if@titlepage
@@ -98,7 +99,7 @@
 \@slidefalse
 \def\jsc@magscale{1}
 \DeclareOption{slide}{\@slidetrue\def\jsc@magscale{3.583}\@landscapetrue\@titlepagetrue}
-\DeclareOption{8pt} {\def\jsc@magscale{0.83}}% 1.2^(-1)
+\DeclareOption{8pt} {\def\jsc@magscale{0.833}}% 1.2^(-1)
 \DeclareOption{9pt} {\def\jsc@magscale{0.913}}% 1.2^(-0.5}
 \DeclareOption{10pt}{\def\jsc@magscale{1}}
 \DeclareOption{11pt}{\def\jsc@magscale{1.095}}% 1.2^0.5
 \@ltjs@mag@xrealtrue
 \DeclareOption{nomag*}{\@ltjs@mag@xrealtrue}
 \DeclareOption{nomag}{\@ltjs@mag@xrealfalse}
-\DeclareOption{noxreal}{\@ltjs@mag@xrealfalse}
-\DeclareOption{real}{\@ltjs@mag@xrealfalse}
+\DeclareOption{noxreal}{%
+  \ClassWarningNoLine{\jsc@clsname}{%
+    The class option `noxreal' is obsolete. \MessageBreak
+    Please use the `nomag' option instead}%
+  \@ltjs@mag@xrealfalse}
+\DeclareOption{real}{%
+  \ClassWarningNoLine{\jsc@clsname}{%
+    The class option `real' is obsolete. \MessageBreak
+    Please use the `nomag' option instead}%
+  \@ltjs@mag@xrealfalse}
+\DeclareOption{usemag}{%
+  \ClassWarningNoLine{\jsc@clsname}{%
+    This \jsc@clsname\space cls does not support `usemag'\MessageBreak
+option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
+  \@ltjs@mag@xrealtrue}
+
 \hour\time \divide\hour by 60\relax
 \@tempcnta\hour \multiply\@tempcnta 60\relax
 \minute\time \advance\minute-\@tempcnta
     \tabskip\z@skip\cr
     }}
 \DeclareOption{disablejfam}{%
-  \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
+  \ClassWarningNoLine{\jsc@clsname}{The class option 'disablejfam' is obsolete}}
 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
 \DeclareOption{final}{\setlength\overfullrule{0pt}}
 \newif\ifmingoth
 \newif\ifptexjis
 \ptexjisfalse
 \DeclareOption{winjis}{%
-  \ClassWarningNoLine{\@currname}{The class option 'winjis' is obsolete}}
+  \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}}
 \DeclareOption{uplatex}{%
-  \ClassWarningNoLine{\@currname}{The class option 'uplatex' is obsolete}}
+  \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}}
 \DeclareOption{mingoth}{\mingothtrue}
 \DeclareOption{ptexjis}{\ptexjistrue}
 \DeclareOption{jis}{\jisfonttrue}
 \newif\if@english
 \@englishfalse
 \DeclareOption{english}{\@englishtrue}
+\newif\if@jslogo \@jslogotrue
+\DeclareOption{jslogo}{\@jslogotrue}
+\DeclareOption{nojslogo}{\@jslogofalse}
 \ExecuteOptions{a4paper,oneside,onecolumn,notitlepage,final}
 \ProcessOptions
 \if@slide
   \newluafunction\ltjs@@magnify@font@calc
   \begingroup\catcode`\%=12\relax
   \directlua{
-    local getdimen, mpt=tex.getdimen, tex.getdimen('js@mpt')/65536
+    local getdimen, mpt=tex.getdimen, tex.getdimen('jsc@mpt')/65536
     local t = lua.get_functions_table()
     t[\the\ltjs@@magnify@font@calc] = function()
       tex.sprint(math.floor(0.5+mpt*getdimen('dimen@')))
 \@lowpenalty   51
 \@medpenalty  151
 \@highpenalty 301
-\setlength\topskip{10\jsc@mpt}
+\setlength\topskip{1.38\zh}%% from 10\jsc@mpt (2016-08-17)
 \if@slide
   \setlength\headheight{0\jsc@mpt}
 \else
-  \setlength\headheight{2\topskip}
+  \setlength\headheight{20\jsc@mpt}%% from 2\topskip (2016-08-17); from \topskip (2003-06-26)
 \fi
 \if@slide
   \setlength\footskip{\z@}
 \else
   \setlength{\textheight}{0.83\paperheight}
 \fi
-\addtolength{\textheight}{-\topskip}
+\addtolength{\textheight}{-0.5\headheight}%% from -\topskip (2016-08-26); from -\headheight (2003-06-26)
 \addtolength{\textheight}{-\headsep}
 \addtolength{\textheight}{-\footskip}
 \addtolength{\textheight}{-\topskip}
 \multiply\textheight\baselineskip
 \addtolength{\textheight}{\topskip}
 \addtolength{\textheight}{0.1\jsc@mpt}
+\def\flushbottom{%
+   \def\@textbottom{\vskip \z@ \@plus.1\jsc@mpt}%
+   \let\@texttop\relax}
 \setlength\marginparsep{\columnsep}
 \setlength\marginparpush{\baselineskip}
 \setlength{\oddsidemargin}{\paperwidth}
 \if@slide
   \addtolength\topmargin{-\headheight}
 \else
-  \addtolength\topmargin{-\topskip}
+  \addtolength\topmargin{-0.5\headheight}%% from -\topskip (2016-08-17); from -\headheight (2003-06-26)
 \fi
 \addtolength\topmargin{-\headsep}
 \addtolength\topmargin{-\footskip}
     \@afterheading
   \fi
   \if@slide
-    {\vskip-6\jsc@mpt\maybeblue\hrule height0\jsc@mpt depth1\jsc@mpt\vskip7\jsc@mpt\relax}%
+    {\vskip\if@twocolumn-5\jsc@mpt\else-6\jsc@mpt\fi
+     \maybeblue\hrule height0\jsc@mpt depth1\jsc@mpt
+     \vskip\if@twocolumn 4\jsc@mpt\else 7\jsc@mpt\fi\relax}
   \fi
   \par  % 2000-12-18
   \ignorespaces}
 \fi
 \if@twocolumn
   \newcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
-    {\z@}{\z@}%
+    {\z@}{\if@slide .4\Cvs \else \z@ \fi}%
     {\normalfont\normalsize\headfont}}
 \else
   \newcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
 \fi
 \if@twocolumn
   \newcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
-    {\z@}{\z@}%
+    {\z@}{\if@slide .4\Cvs \else \z@ \fi}%
     {\normalfont\normalsize\headfont}}
 \else
   \newcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
     {\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
-    {\z@}%
+    {\if@slide .5\Cvs \@plus.3\Cdp \else \z@ \fi}%
     {\normalfont\normalsize\headfont}}
 \fi
 \if@twocolumn
   \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
-    {\z@}{-1\zw}% 改行せず 1\zw のアキ
+    {\z@}{\if@slide .4\Cvs \else -1\zw\fi}% 改行せず 1\zw のアキ
     {\normalfont\normalsize\headfont ■}}
 \else
   \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
     {0.5\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
-    {-1\zw}% 改行せず 1\zw のアキ
+    {\if@slide .5\Cvs \@plus.3\Cdp \else -1\zw\fi}% 改行せず 1\zw のアキ
     {\normalfont\normalsize\headfont ■}}
 \fi
-\newcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
-   {\z@}{-1\zw}%
-   {\normalfont\normalsize\headfont}}
+\if@twocolumn
+  \newcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
+    {\z@}{\if@slide .4\Cvs \@plus.3\Cdp \else -1\zw\fi}%
+    {\normalfont\normalsize\headfont}}
+\else
+  \newcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
+    {\z@}{\if@slide .5\Cvs \@plus.3\Cdp \else -1\zw\fi}%
+    {\normalfont\normalsize\headfont}}
+\fi
 \if@slide
   \setlength\leftmargini{1\zw}
 \else
   \ifdim \wd\@tempboxa <\hsize \centering \fi
   #1{\hskip1\zw}#2\par
   \vskip\belowcaptionskip}}
-\DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc}
-\DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt}
-\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
-\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
-\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
-\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
-\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
-\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
-\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
+\newif\if@jsc@warnoldfontcmd
+\@jsc@warnoldfontcmdtrue
+\newif\if@jsc@warnoldfontcmdexception
+\@jsc@warnoldfontcmdexceptionfalse
+\newcommand*{\jsc@DeclareOldFontCommand}[3]{%
+  \DeclareOldFontCommand{#1}{%
+    \jsc@warnoldfontcmd{#1}#2%
+  }{%
+    \jsc@warnoldfontcmd{#1}#3%
+  }%
+}
+\DeclareRobustCommand*{\jsc@warnoldfontcmd}[1]{%
+  \if@jsc@warnoldfontcmdexception\else\if@jsc@warnoldfontcmd
+  \ClassWarning{\jsc@clsname}{%
+    deprecated old font command `\string#1' used.\MessageBreak
+    You should note, that since 1994 LaTeX2e provides a\MessageBreak
+    new font selection scheme called NFSS2 with several\MessageBreak
+    new, combinable font commands. This \jsc@clsname\MessageBreak
+class has defined the old font commands like\MessageBreak
+`\string#1' only for compatibility%
+  }%
+  \global\@jsc@warnoldfontcmdfalse
+  \fi\fi
+}
+\jsc@DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc}
+\jsc@DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt}
+\jsc@DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+\jsc@DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+\jsc@DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+\jsc@DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+\jsc@DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+\jsc@DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
+\jsc@DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
 \DeclareRobustCommand*{\cal}{\@fontswitch\relax\mathcal}
 \DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal}
 \newcommand\@pnumwidth{1.55em}
 \newdimen\bibindent
 \setlength\bibindent{2\zw}
 \newenvironment{thebibliography}[1]{%
+  \global\@jsc@warnoldfontcmdexceptiontrue
   \global\let\presectionname\relax
   \global\let\postsectionname\relax
   \section*{\refname}\@mkboth{\refname}{\refname}%
    \sfcode`\.\@m}
   {\def\@noitemerr
     {\@latex@warning{Empty `thebibliography' environment}}%
-   \endlist}
+   \endlist
+   \global\@jsc@warnoldfontcmdexceptionfalse}
 \newcommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em}
 \let\@openbib@code\@empty
 \newenvironment{theindex}{% 索引を3段組で出力する環境
 \def\footnote{\inhibitglue\footnotes@ve}
 \let\footnotemarks@ve=\footnotemark
 \def\footnotemark{\inhibitglue\footnotemarks@ve}
-\renewcommand\@makefnmark{%
-  \unless\ifnum\ltjgetparameter{direction}=3
-    \hbox{}\hbox{\@textsuperscript{\normalfont\@thefnmark}}\hbox{}%
-  \else\hbox{\yoko \@textsuperscript{\normalfont\@thefnmark}}\fi}
 \def\thefootnote{\ifnum\c@footnote>\z@\leavevmode\lower.5ex\hbox{*}\@arabic\c@footnote\fi}
 \renewcommand{\footnoterule}{%
   \kern-3\jsc@mpt
     \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
     \inhibitglue \ignorespaces
   \fi}
+\IfFileExists{jslogo.sty}{}{\@jslogofalse}%
+\if@jslogo
+  \RequirePackage{jslogo}
+  \def\小{\jslg@small}
+  \def\上小{\jslg@uppersmall}
+\else
 \def\小#1{\hbox{$\m@th$%
   \csname S@\f@size\endcsname
   \fontsize\sf@size\z@
   \ifx\f@family\cmr\kern-.08em\else\kern-.15em\fi\TeX}
 \DeclareRobustCommand{\SliTeX}{%
   S\kern-.06emL\kern-.18em\上小{I}\kern -.03em\TeX}
+\fi
 \newcommand{\prepartname}{\if@english Part~\else 第\fi}
 \newcommand{\postpartname}{\if@english\else 部\fi}
 \newcommand{\presectionname}{}%  第