OSDN Git Service

sync with jsclasses 4eace08
[luatex-ja/luatexja.git] / src / ltjsbook.cls
index 4681823..0cf0d6b 100644 (file)
@@ -38,7 +38,7 @@
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjsbook}
-  [2016/07/21 ltjsclasses ]
+  [2017/01/12 ltjsclasses ]
 \def\jsc@clsname{ltjsbook}
 \RequirePackage{luatexja}
 \newif\if@restonecol
 \newif\if@slide
 \@slidefalse
 \def\jsc@magscale{1}
-\DeclareOption{slide}{\@slidetrue\def\jsc@magscale{3.583}\@landscapetrue\@titlepagetrue}
 \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{12ptj}{\def\jsc@magscale{1.302}}
 \newif\if@ltjs@mag@xreal
 \@ltjs@mag@xrealtrue
-\DeclareOption{nomagx}{\@ltjs@mag@xrealtrue}
+\DeclareOption{nomag*}{\@ltjs@mag@xrealtrue}
 \DeclareOption{nomag}{\@ltjs@mag@xrealfalse}
 \DeclareOption{noxreal}{%
   \ClassWarningNoLine{\jsc@clsname}{%
@@ -221,7 +220,9 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \DeclareOption{winjis}{%
   \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}}
 \DeclareOption{uplatex}{%
-  \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}}
+  \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}}
+\DeclareOption{autodetect-engine}{%
+  \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}}
 \DeclareOption{mingoth}{\mingothtrue}
 \DeclareOption{ptexjis}{\ptexjistrue}
 \DeclareOption{jis}{\jisfonttrue}
@@ -231,6 +232,9 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \newif\if@report
 \@reportfalse
 \DeclareOption{report}{\@reporttrue\@openrightfalse\@twosidefalse\@mparswitchfalse}
+\newif\if@jslogo \@jslogotrue
+\DeclareOption{jslogo}{\@jslogotrue}
+\DeclareOption{nojslogo}{\@jslogofalse}
 \ExecuteOptions{a4paper,twoside,onecolumn,titlepage,openright,final}
 \ProcessOptions
 \if@slide
@@ -293,20 +297,31 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
     \expandafter\endgroup\@tempa
   }
 \fi\fi
-\newlength{\stockwidth}
-\newlength{\stockheight}
-\setlength{\stockwidth}{\paperwidth}
-\setlength{\stockheight}{\paperheight}
+\def\jsc@smallskip{\vspace\jsc@smallskipamount}
+\newskip\jsc@smallskipamount
+\jsc@smallskipamount=3\jsc@mpt plus 1\jsc@mpt minus 1\jsc@mpt
 \iftombow
+  \newlength{\stockwidth}
+  \newlength{\stockheight}
+  \setlength{\stockwidth}{\paperwidth}
+  \setlength{\stockheight}{\paperheight}
   \advance \stockwidth 2in
   \advance \stockheight 2in
-\fi
-\ifdefined\pdfpagewidth
-  \setlength{\pdfpagewidth}{\stockwidth}
-  \setlength{\pdfpageheight}{\stockheight}
+  \ifdefined\pdfpagewidth
+    \setlength{\pdfpagewidth}{\stockwidth}
+    \setlength{\pdfpageheight}{\stockheight}
+  \else
+    \setlength{\pagewidth}{\stockwidth}
+    \setlength{\pageheight}{\stockheight}
+  \fi
 \else
-  \setlength{\pagewidth}{\stockwidth}
-  \setlength{\pageheight}{\stockheight}
+  \ifdefined\pdfpagewidth
+    \setlength{\pdfpagewidth}{\paperwidth}
+    \setlength{\pdfpageheight}{\paperheight}
+  \else
+    \setlength{\pagewidth}{\paperwidth}
+    \setlength{\pageheight}{\paperheight}
+  \fi
 \fi
 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
 \ifmingoth
@@ -465,11 +480,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \@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@report
   \setlength\footskip{0.03367\paperheight}
@@ -484,6 +499,8 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
   \addtolength\headsep{-\topskip}
 \else
   \setlength\headsep{6\jsc@mmm}
+  \addtolength\headsep{-\topskip}%% added (2016-10-08)
+  \addtolength\headsep{10\jsc@mpt}%% added (2016-10-08)
 \fi
 \setlength\maxdepth{.5\topskip}
 \newdimen\fullwidth
@@ -508,7 +525,7 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \else
   \setlength{\textheight}{0.83\paperheight}
 \fi
-\addtolength{\textheight}{-\topskip}
+\addtolength{\textheight}{-10\jsc@mpt}%% from -\topskip (2016-10-08); from -\headheight (2003-06-26)
 \addtolength{\textheight}{-\headsep}
 \addtolength{\textheight}{-\footskip}
 \addtolength{\textheight}{-\topskip}
@@ -544,7 +561,7 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \if@slide
   \addtolength\topmargin{-\headheight}
 \else
-  \addtolength\topmargin{-\topskip}
+  \addtolength\topmargin{-10\jsc@mpt}%% from -\topskip (2016-10-08); from -\headheight (2003-06-26)
 \fi
 \addtolength\topmargin{-\headsep}
 \addtolength\topmargin{-\footskip}
@@ -649,9 +666,9 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
           \mbox{} \\[1\zw]
           \large
           {\maybeblue\hrule height0\jsc@mpt depth2\jsc@mpt\relax}\par
-          \smallskip
+          \jsc@smallskip
           \@title
-          \smallskip
+          \jsc@smallskip
           {\maybeblue\hrule height0\jsc@mpt depth2\jsc@mpt\relax}\par
           \vfill
           {\small \@author}%
@@ -818,7 +835,9 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
     \@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}
@@ -915,9 +934,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
   \@endpart}
 \def\@endpart{\vfil\newpage
   \if@twoside
+   \if@openright %% added (2016/12/13)
     \null
     \thispagestyle{empty}%
     \newpage
+   \fi %% added (2016/12/13)
   \fi
   \if@restonecol
     \twocolumn
@@ -995,7 +1016,7 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \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@}%
@@ -1005,27 +1026,34 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \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
+\newcommand{\jsParagraphMark}{■}
 \if@twocolumn
   \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
-    {\z@}{-1\zw}% 改行せず 1\zw のアキ
-    {\normalfont\normalsize\headfont ■}}
+    {\z@}{\if@slide .4\Cvs \else -1\zw\fi}% 改行せず 1\zw のアキ
+    {\normalfont\normalsize\headfont\jsParagraphMark}}
 \else
   \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
     {0.5\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
-    {-1\zw}% 改行せず 1\zw のアキ
-    {\normalfont\normalsize\headfont ■}}
+    {\if@slide .5\Cvs \@plus.3\Cdp \else -1\zw\fi}% 改行せず 1\zw のアキ
+    {\normalfont\normalsize\headfont\jsParagraphMark}}
+\fi
+\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
-\newcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
-   {\z@}{-1\zw}%
-   {\normalfont\normalsize\headfont}}
 \if@slide
   \setlength\leftmargini{1\zw}
 \else
@@ -1408,10 +1436,6 @@ class has defined the old font commands like\MessageBreak
 \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
@@ -1509,14 +1533,15 @@ class has defined the old font commands like\MessageBreak
   \ifvmode
     \@nolnerr
   \else
-    \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
+    \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \hskip\z@
     \inhibitglue \ignorespaces
   \fi}
-\IfFileExists{jslogo.sty}{%
+\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@
@@ -1647,7 +1672,7 @@ class has defined the old font commands like\MessageBreak
   \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{\prechaptername}{\if@english Chapter~\else 第\fi}
@@ -1700,7 +1725,7 @@ class has defined the old font commands like\MessageBreak
   \renewcommand\familydefault{\sfdefault}
   \raggedright
   \ltj@setpar@global
-  \ltjsetxkanjiskip{0.1em}\relax
+  \ltjsetxkanjiskip0.1em\relax
 \fi
 \endinput
 %%