OSDN Git Service

ltj[s]classes.dtx: apply a patch by aminophen
[luatex-ja/luatexja.git] / src / ltjsclasses.dtx
index 4110b06..41e5549 100644 (file)
@@ -3,29 +3,16 @@
 %  -----------------------------------------
 %  Original: jsclasses.dtx
 %
-%  pLaTeX2ε新ドキュメントクラス
+%  pLaTeX2ε新ドキュメントクラス(日本語 TeX 開発コミュニティ版)
+%  原作者:奥村晴彦 <okumura@okumuralab.org>
 %
-%  これは LaTeX3 Project の classes.dtx と株式会社アスキーの jclasses.dtx
-%  に基づいて,もともと奥村晴彦 <okumura@okumuralab.org> により
-%  作成されたものです。
-%  現在は日本語\TeX 開発コミュニティにより管理されています。
-%
-%  [2002-12-19] いろいろなものに収録していただく際にライセンスを明確にする
-%  必要が生じてきました。アスキーのものが最近はmodified BSDライセンスになっ
-%  ていますので,私のものもそれに準じてmodified BSDとすることにします。
-%
-%  [2016-07-11] abenoriさんによる\texttt{nomag}オプションをマージしました。
-%  なお,ソースコードの管理はGitHubで行うことにしました。
-%
-%  [2016-07-13] 日本語\TeX 開発コミュニティによる管理に移行しました。
-%
-%  Copyright 1993 1994 1995 1996 1997 1998 1999
+%  Copyright 1993-2016
 %  The LaTeX3 Project and any individual authors listed elsewhere
 %  in this file.
 %
 %  Copyright 1995-1999 ASCII Corporation.
 %  Copyright 1999-2016 Haruhiko Okumura
-%  Copyright 2016 Japanese TeX Development Community
+%  Copyright 2016-2018 Japanese TeX Development Community
 %  -----------------------------------------
 %
 % \fi
 % \iffalse
 %
 %    \begin{macrocode}
-%<article|book|jspf|kiyou>\NeedsTeXFormat{LaTeX2e}
+\NeedsTeXFormat{LaTeX2e}
 %<article>\ProvidesClass{ltjsarticle}
 %<book>\ProvidesClass{ltjsbook}
+%<report>\ProvidesClass{ltjsreport}
 %<jspf>\ProvidesClass{ltjspf}
 %<kiyou>\ProvidesClass{ltjskiyou}
 %<*driver>
 \ProvidesFile{ltjsclasses.dtx}
 %</driver>
-  [2017/01/12 ltjsclasses ]
+  [2018/03/22 ltjsclasses ]
 %<*driver>
 \IfFileExists{luatex85.sty}{\RequirePackage{luatex85}}{}
 \documentclass{ltjsarticle}
 \usepackage{hypdoc}
 \hypersetup{unicode=true}
-\usepackage{fontspec}
-\usepackage[ipaex,nfssonly]{luatexja-preset}
+\begingroup
+ \suppressfontnotfounderror=1
+ \global\font\testfont=file:KozMinPr6N-Regular.otf
+\endgroup
+\ifx\testfont\nullfont
+  \usepackage[ipaex,nfssonly]{luatexja-preset}
+\else
+  \usepackage[kozuka-pr6n,nfssonly]{luatexja-preset}
+\fi  
 \ltjsetparameter{alxspmode={`\*,allow}}
 \ltjsetparameter{alxspmode={`\\,allow}}
 %%%%\usepackage{unicode-math}
 \addtolength{\marginparwidth}{1in}
 \setlength\marginparpush{0pt}
 % \OnlyDescription
+\CodelineNumbered
 \EnableCrossrefs
 \setcounter{StandardModuleDepth}{1}
 \GetFileInfo{ltjsclasses.dtx}
-\CodelineNumbered
 \begin{document}
 \DocInput{ltjsclasses.dtx}
 \end{document}
 % これは,元々奥村晴彦先生により作成され,現在は日本語\TeX 開発コミュニティにより
 % 管理されている\texttt{jsclasses.dtx}をLua\LaTeX-ja用に改変したものです。
 % 次のドキュメントクラス(スタイルファイル)を生成します。
+%
+% [2017-02-13] forum:2121の議論を機に,ltjsreportクラスを新設しました。
+% 従来のltjsbookの |report| オプションと比べると,|abstract| 環境の使い方
+% および挙動がアスキーのjreportに近づきました。
+%
 % \begin{quote}
 %   \begin{tabular}{lll}
 %     $\langle$\textsf{article}$\rangle$ & \texttt{ltjsarticle.cls}  & 論文・レポート用 \\
 %     $\langle$\textsf{book}$\rangle$    & \texttt{ltjsbook.cls}     & 書籍用 \\
+%     $\langle$\textsf{report}$\rangle$  & \texttt{ltjsreport.cls}   & レポート用 \\
 %     $\langle$\textsf{jspf}$\rangle$    & \texttt{ltjspf.cls}       & 某学会誌用 \\
-%     $\langle$\textsf{kiyou}$\rangle$   & \texttt{ltjskiyou.cls}      & 某紀要用
+%     $\langle$\textsf{kiyou}$\rangle$   & \texttt{ltjskiyou.cls}    & 某紀要用
 %   \end{tabular}
 % \end{quote}
 %
 %    \begin{macrocode}
 %<article>\def\jsc@clsname{ltjsarticle}
 %<book>\def\jsc@clsname{ltjsbook}
+%<report>\def\jsc@clsname{ltjsreport}
 %<jspf>\def\jsc@clsname{ltjspf}
 %<kiyou>\def\jsc@clsname{ltjskiyou}
 %    \end{macrocode}
 %
 % \begin{macro}{\if@openright}
 %
-% |\chapter|,|\part| を奇数ページ起こしにするかどうかです。
-% 書籍では真が標準です。
+% |\chapter|,|\part| を右ページ起こしにするかどうかです。
+% 横組の書籍では真が標準で,要するに片起こし,奇数ページ起こしになります。
+%
+%    \begin{macrocode}
+%<book|report>\newif\if@openright
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@openleft}
+%
+% [2017-02-24] |\chapter|,|\part| を左ページ起こしにするかどうかです。
 %
 %    \begin{macrocode}
-%<book>\newif\if@openright
+%<book|report>\newif\if@openleft
 %    \end{macrocode}
 % \end{macro}
 %
 % 将来どうなるかわからないので\texttt{nomag}で無効化することができるようにしました。
 %
 % \texttt{noxreal},~\texttt{real}は旧来の互換性として今は残してありますが,2017年7月に削除する予定です。
+%
+% [2018-01-14] \texttt{noxreal},~\texttt{real} を削除しました.また,内部命令の名称を
+% \texttt{jsclasses}に合わせました.
+%
 %    \begin{macrocode}
-\newif\if@ltjs@mag@xreal
-\@ltjs@mag@xrealtrue
-\DeclareOption{nomag*}{\@ltjs@mag@xrealtrue}
-\DeclareOption{nomag}{\@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}
+\newif\ifjsc@mag@xreal
+\jsc@mag@xrealtrue
+\DeclareOption{nomag*}{\jsc@mag@xrealtrue}
+\DeclareOption{nomag}{\jsc@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}
-
-
+  \jsc@mag@xrealtrue}
 %    \end{macrocode}
 %
 %
 %
 % \paragraph{右左起こし}
 %
-% 書籍では章は通常は奇数ページ起こしになりますが,
+% 書籍では章は通常は奇数ページ起こしになりますが,横組ではこれを
+% \texttt{openright} と表すことにしてあります。
 % \texttt{openany} で偶数ページからでも始まるようになります。
 %
+% [2017-02-24] \texttt{openright} は横組では奇数ページ起こし,縦組では
+% 偶数ページ起こしを表します。ややこしいですが,これは\LaTeX の標準クラスが
+% 西欧の横組事情しか考慮せずに,奇数ページ起こしと右起こしを一緒にしてしまっ
+% たせいです。縦組での奇数ページ起こしと横組での偶数ページ起こしも表現したい
+% ので,ltjsclassesでは新たに \texttt{openleft} も追加しました。
+%
 %    \begin{macrocode}
-%<book>\DeclareOption{openright}{\@openrighttrue}
-%<book>\DeclareOption{openany}{\@openrightfalse}
+%<book|report>\DeclareOption{openright}{\@openrighttrue\@openleftfalse}
+%<book|report>\DeclareOption{openleft}{\@openlefttrue\@openrightfalse}
+%<book|report>\DeclareOption{openany}{\@openrightfalse\@openleftfalse}
 %    \end{macrocode}
 %
 % \paragraph{eqnarray環境と数式の位置}
 \DeclareOption{english}{\@englishtrue}
 %    \end{macrocode}
 %
-% \paragraph{ltjsreport相当}
+% \paragraph{ltjsbookをltjsreportもどきに}
 %
 % オプション \texttt{report} を新設しました。
 %
+% [2017-02-13] 従来は「ltjsreport相当」をltjsbookの \texttt{report} オプションで提供して
+% いましたが,新しくltjsreportクラスも作りました。どちらでもお好きな方を使ってください。
+%
 %    \begin{macrocode}
 %<*book>
 \newif\if@report
 %    \begin{macrocode}
 %<article>\ExecuteOptions{a4paper,oneside,onecolumn,notitlepage,final}
 %<book>\ExecuteOptions{a4paper,twoside,onecolumn,titlepage,openright,final}
+%<report>\ExecuteOptions{a4paper,oneside,onecolumn,titlepage,openany,final}
 %<jspf>\ExecuteOptions{a4paper,twoside,twocolumn,notitlepage,fleqn,final}
 %<kiyou>\ExecuteOptions{a4paper,twoside,twocolumn,notitlepage,final}
 \ProcessOptions
 % 基準となる行送りをポイント単位で表したものです。
 %
 %    \begin{macrocode}
-%<article|book>\if@slide\def\n@baseline{13}\else\def\n@baseline{16}\fi
+%<article|book|report>\if@slide\def\n@baseline{13}\else\def\n@baseline{16}\fi
 %<jspf>\def\n@baseline{14.554375}
 %<kiyou>\def\n@baseline{14.897}
 %    \end{macrocode}
 % (不要なので)パッチを当てないことにしました。
 %
 % [2016-04-04 LTJ] NFSSへのパッチを修正。
+%
+% [2017-01-23 LTJ] \LaTeXe\ 2017-01-01以降ではTUエンコーディングが標準なので,
+% \texttt{type1cm}パッケージは読み込まないようにしました.
+%
+% [2017-02-17 LTJ] |\directlua|中で出力される数字のカテゴリーコードが12になるようにしました.
+% この保証をしないと例えば\texttt{listings}パッケージで無限ループになります.
 %    \begin{macrocode}
-\if@ltjs@mag@xreal\RequirePackage{type1cm}
+\ifjsc@mag@xreal
 \ifdim\jsc@mpt=\p@\else
   \expandafter\let\csname OT1/cmr/m/n/10\endcsname\relax
+  \expandafter\let\csname TU/lmr/m/n/10\endcsname\relax
   \expandafter\let\csname OMX/cmex/m/n/10\endcsname\relax
   \newluafunction\ltjs@@magnify@font@calc
   \begingroup\catcode`\%=12\relax
     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@')))
+      tex.sprint(-2,math.floor(0.5+mpt*getdimen('dimen@')))
     end
     function luatexja.ltjs_unmagnify_fsize(a)
       local s = luatexja.print_scaled(math.floor(0.5+a/mpt*65536))
-      tex.sprint( (s:match('%.0$')) and s:sub(1,-3) or s )
+      tex.sprint(-2, (s:match('%.0$')) and s:sub(1,-3) or s )
     end
   }
   \endgroup
      \def\@tempa{#1}\def\@tempb{#2}%
      \ifx\@tempb\@empty
         \edef\@tempb{ scaled\directlua{%
-          tex.sprint(math.floor(0.5+\jsc@magscale*1000))
+          tex.sprint(-2,math.floor(0.5+\jsc@magscale*1000))
         }}%
      \else
         \dimen@\@tempb\relax
 %
 % [2014-07-26 LTJ] なお,現状のところ,縦組用JFMは\texttt{jfm-ujisv.lua}しか準備していません。
 %
-% [2016-03-21 LTJ] 拡大率の計算で1~ptを$1/72.27$インチでなく0.3514~mmと間違えて扱っていたのを修正。
+% [2016-03-21 LTJ] 拡大率の計算で1~ptを$1/72.27$インチでなく0.3514\,mmと間違えて扱っていたのを修正。
+%
+% [2017-12-31] 和文スケール($1\,\mathrm{zw} \div \hbox{要求サイズ}$)を
+% 表す実数値マクロ |\Cjascale| を定義しました。
+%
 %    \begin{macrocode}
-%<*!jspf>
-\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
-\ifmingoth
-  \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.924715] \ltj@stdmcfont:jfm=min}{}
-  \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.924715] \ltj@stdgtfont:jfm=min}{}
-\else
-  \ifptexjis
-    \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.924715] \ltj@stdmcfont:jfm=jis}{}
-    \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.924715] \ltj@stdgtfont:jfm=jis}{}
-  \else
-    \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.924715] \ltj@stdmcfont:jfm=ujis}{}
-    \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.924715] \ltj@stdgtfont:jfm=ujis}{}
-  \fi
-\fi
-\DeclareFontShape{JT3}{mc}{m}{n}{<-> s * [0.924715] \ltj@stdmcfont:jfm=ujisv}{}
-\DeclareFontShape{JT3}{gt}{m}{n}{<-> s * [0.924715] \ltj@stdgtfont:jfm=ujisv}{}
-%</!jspf>
+%<!jspf> \def\Cjascale{0.924715}
 %    \end{macrocode}
 %
 % これにより,公称10ポイントの和文フォントを0.924715倍したことにより,
 % $0.9*72.27/72 \simeq 0.903375$ 倍します。
 %
 %    \begin{macrocode}
-%<*jspf>
+%<jspf> \def\Cjascale{0.903375}
+%    \end{macrocode}
+%
+% 実際にフォントの再定義を行う部分です.
+%
+%    \begin{macrocode}
 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
 \ifmingoth
-  \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=min}{}
-  \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=min}{}
+  \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=min}{}
+  \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=min}{}
 \else
   \ifptexjis
-    \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=jis}{}
-    \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=jis}{}
+    \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=jis}{}
+    \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=jis}{}
   \else
-    \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=ujis}{}
-    \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=ujis}{}
+    \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=ujis}{}
+    \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=ujis}{}
   \fi
 \fi
-\DeclareFontShape{JT3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=ujisv}{}
-\DeclareFontShape{JT3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=ujisv}{}
-%</jspf>
+\DeclareFontShape{JT3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=ujisv}{}
+\DeclareFontShape{JT3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=ujisv}{}
 %    \end{macrocode}
 %
 % 和文でイタリック体,斜体,サンセリフ体,
 % \texttt{jsclasses}で行われていた |\textmc|, |\textgt| の再定義は不要のように思われます。
 %
 % \texttt{jsclasses.dtx}中で行われていた |\reDeclareMathAlphabet| の再定義は削除。
+% また,Yue ZHANGさん作の\texttt{fixjfm}パッケージ対応のコードもLua\TeX-jaでは削除しています.
 %
 %    \begin{macrocode}
 \AtBeginDocument{%
 % パラメータに実際の値を設定します。
 % たとえば |\Cwd| は |\normalfont| の全角幅(|1\zw|)です。
 %
+% [2017-08-31] 基準とする文字を「全角空白」(EUCコード\texttt{0xA1A1})から
+% 「漢」(JISコード\texttt{0x3441})へ変更しました。
+%
+% [2017-09-19] 内部的に使った |\box0| を空にします。
 %    \begin{macrocode}
-\setbox0\hbox{\char"3000}% 全角スペース
+\setbox0\hbox{漢}
 \setlength\Cht{\ht0}
 \setlength\Cdp{\dp0}
 \setlength\Cwd{\wd0}
 \setlength\Cvs{\baselineskip}
 \setlength\Chs{\wd0}
+\setbox0=\box\voidb@x
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
 % |\small| も |\normalsize| と同様に設定します。
 % 行送りは,|\normalsize| が16ポイントなら,
-% 割合からすれば $16 \times 0.9 = 14.4$ ポイントになりますが,
+% 割合からすれば$16 \times 0.9 = 14.4$ポイントになりますが,
 % |\small| の使われ方を考えて,ここでは和文13ポイント,
 % 欧文11ポイントとします。
-% また,|\topsep| と |\parsep| は,元はそれぞれ $4 \pm 2$,$2 \pm 1$
+% また,|\topsep| と |\parsep| は,元はそれぞれ$4 \pm 2$,$2 \pm 1$
 % ポイントでしたが,ここではゼロ(|\z@|)にしました。
 %
 %    \begin{macrocode}
 % 計算では |\headheight| ではなく |\topskip| を使う
 % ことにしました。
 %
-%
 % [2016-08-17] 圏点やルビが一行目に来た場合に下がるのを防ぐた
 % め,|\topskip| を10ptから1.38zwに増やしました。
 % |\headheight| は従来と同じ20ptのままとします。
   \setlength\footskip{\z@}
 \fi
 %</book>
+%<*report>
+\setlength\footskip{0.03367\paperheight}
+\ifdim\footskip<\baselineskip
+  \setlength\footskip{\baselineskip}
+\fi
+%</report>
 %    \end{macrocode}
 % \end{macro}
 %
   \addtolength\headsep{10\jsc@mpt}%% added (2016-10-08)
 \fi
 %</book>
+%<*report>
+\setlength\headsep{\footskip}
+\addtolength\headsep{-\topskip}
+%</report>
 %<*jspf>
 \setlength\headsep{9\jsc@mmm}
 \addtolength\headsep{-\topskip}
   \fi
 \fi
 %</book>
+%<*report>
+\setlength\fullwidth{0.76\paperwidth}
+\if@twocolumn \@tempdima=2\zw \else \@tempdima=1\zw \fi
+\divide\fullwidth\@tempdima \multiply\fullwidth\@tempdima
+\setlength\textwidth{\fullwidth}
+%</report>
 %<*jspf>
 \setlength\fullwidth{50\zw}
 \addtolength\fullwidth{8\jsc@mmm}
 % なので,さらに修正しました(2016-08-17での修正漏れ)。
 %
 %    \begin{macrocode}
-%<*article|book>
+%<*article|book|report>
 \if@slide
   \setlength{\textheight}{0.95\paperheight}
 \else
 \addtolength{\textheight}{-\topskip}
 \divide\textheight\baselineskip
 \multiply\textheight\baselineskip
-%</article|book>
+%</article|book|report>
 %<jspf>\setlength{\textheight}{51\baselineskip}
 %<kiyou>\setlength{\textheight}{47\baselineskip}
 \addtolength{\textheight}{\topskip}
 %
 %    \begin{macrocode}
 \def\flushbottom{%
-   \def\@textbottom{\vskip \z@ \@plus.1\jsc@mpt}%
-   \let\@texttop\relax}
+  \def\@textbottom{\vskip \z@ \@plus.1\jsc@mpt}%
+  \let\@texttop\relax}
 %    \end{macrocode}
 % \end{macro}
 %
 % |\topmargin| は従来の値から変わらないように調節しました。
 % …のつもりでしたが,|\textheight| を増やし忘れていたので
 % 変わってしまっていました(2016-08-26修正済み)。
+%
 %    \begin{macrocode}
 \setlength\topmargin{\paperheight}
 \addtolength\topmargin{-\textheight}
 %
 % フロート(図,表)関連のパラメータは\LaTeXe 本体で定義されていますが,
 % ここで設定変更します。本文ページ(本文とフロートが共存するページ)
-% ちなみに,カウンタは内部では |\c@| を名前に冠したマクロになっています。
 % とフロートだけのページで設定が異なります。
+% ちなみに,カウンタは内部では |\c@| を名前に冠したマクロになっています。
 %
 % \begin{macro}{\c@topnumber}
 %
 % \end{macro}
 % \end{macro}
 %
+% \section{改ページ(日本語\TeX{}開発コミュニティ版のみ)}\label{sec:cleardoublepage}
+%
+% \begin{macro}{\pltx@cleartorightpage}
+% \begin{macro}{\pltx@cleartoleftpage}
+% \begin{macro}{\pltx@cleartooddpage}
+% \begin{macro}{\pltx@cleartoevenpage}
+% [2017-02-24] コミュニティ版\pLaTeX の標準クラス2017/02/15に合わせて,
+% 同じ命令を追加しました。
+% \begin{enumerate}
+%   \item|\pltx@cleartorightpage|:右ページになるまでページを繰る命令
+%   \item|\pltx@cleartoleftpage|:左ページになるまでページを繰る命令
+%   \item|\pltx@cleartooddpage|:奇数ページになるまでページを繰る命令
+%   \item|\pltx@cleartoevenpage|:偶数ページになるまでページを繰る命令
+% \end{enumerate}
+% となっています。
+%
+%    \begin{macrocode}
+%<*article|book|report>
+\def\pltx@cleartorightpage{\clearpage\if@twoside
+  \unless\ifodd\numexpr\c@page+\ltjgetparameter{direction}\relax
+    \hbox{}\thispagestyle{empty}\newpage
+    \if@twocolumn\hbox{}\newpage\fi
+  \fi\fi}
+\def\pltx@cleartoleftpage{\clearpage\if@twoside
+  \ifodd\numexpr\c@page+\ltjgetparameter{direction}\relax
+    \hbox{}\thispagestyle{empty}\newpage
+    \if@twocolumn\hbox{}\newpage\fi
+  \fi\fi}
+\def\pltx@cleartooddpage{\clearpage\if@twoside
+  \ifodd\c@page\else
+    \hbox{}\thispagestyle{empty}\newpage
+    \if@twocolumn\hbox{}\newpage\fi
+  \fi\fi}
+\def\pltx@cleartoevenpage{\clearpage\if@twoside
+  \ifodd\c@page
+    \hbox{}\thispagestyle{empty}\newpage
+    \if@twocolumn\hbox{}\newpage\fi
+  \fi\fi}
+%</article|book|report>
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cleardoublepage}
+% [2017-02-24] コミュニティ版\pLaTeX の標準クラス2017/02/15に合わせて,
+% reportとbookクラスの場合に|\cleardoublepage|を再定義します。
+%    \begin{macrocode}
+%<*book|report>
+\if@openleft
+  \let\cleardoublepage\pltx@cleartoleftpage
+\else\if@openright
+  \let\cleardoublepage\pltx@cleartorightpage
+\fi\fi
+%</book|report>
+%    \end{macrocode}
+% \end{macro}
+%
 % \section{ページスタイル}\label{sec:pagestyle}
 %
 % ページスタイルとして,\LaTeXe (欧文版)の標準クラス
 %</article|kiyou>
 %    \end{macrocode}
 %
-% 次は book の場合です。
+% æ¬¡ã\81¯ book ã\81\8aã\82\88ã\81³ report ã\81®å ´å\90\88ã\81§ã\81\99ã\80\82
 % [2011-05-10] しっぽ愛好家さん [qa:6370] のパッチを取り込ませていただきました
 % (北見さん [qa:55896] のご指摘ありがとうございます)。
 %
 %    \begin{macrocode}
-%<*book>
+%<*book|report>
 \newif\if@omit@number
 \def\ps@headings{%
   \let\@oddfoot\@empty
   \let\@mkboth\markboth
   \def\chaptermark##1{\markboth{%
     \ifnum \c@secnumdepth >\m@ne
-      \if@mainmatter
+%<book>      \if@mainmatter
         \if@omit@number\else
           \@chapapp\thechapter\@chappos\hskip1\zw
         \fi
-      \fi
+%<book>      \fi
     \fi
     ##1}{}}%
   \def\sectionmark##1{\markright{%
     \ifnum \c@secnumdepth >\z@ \thesection \hskip1\zw\fi
     ##1}}}%
-%</book>
+%</book|report>
 %    \end{macrocode}
 %
 % 最後は学会誌の場合です。
   \def\@oddhead{%
     \hbox to \fullwidth{\rightmark\hfil\thepage}\hss}%
   \let\@mkboth\@gobbletwo
-%<book>  \let\chaptermark\@gobble
+%<book|report>  \let\chaptermark\@gobble
   \let\sectionmark\@gobble
-%<!book>  \let\subsectionmark\@gobble
+%<!book&!report>  \let\subsectionmark\@gobble
 }
 %    \end{macrocode}
 % \end{macro}
 % 和文のものでは |\Large| になっていましたが,ここでは |\large|
 % にしました。
 %
+% [2016-11-16] スペーシングを元の |jsclasses| に合わせるため,|\smallskip| を
+% |\jsc@smallskip| に置き換えました。|\smallskip| のままでは
+% \texttt{nomag(*)} の場合にスケールしなくなり,レイアウトが変わってしまいます。
+%
 %    \begin{macrocode}
-%<*article|book|kiyou>
+%<*article|book|report|kiyou>
 \if@titlepage
   \newcommand{\maketitle}{%
     \begin{titlepage}%
       {\large \@date}%
     \end{center}%
     \par\vskip 1.5em
-%<article|kiyou>    \ifvoid\@abstractbox\else\centerline{\box\@abstractbox}\vskip1.5em\fi
+%<article|report|kiyou>    \ifvoid\@abstractbox\else\centerline{\box\@abstractbox}\vskip1.5em\fi
   }
 \fi
-%</article|book|kiyou>
+%</article|book|report|kiyou>
 %<*jspf>
 \newcommand{\maketitle}{\par
   \begingroup
         \begingroup \@svsechd \endgroup
         \unskip
         \@tempskipa #1\relax
-        \hskip -\@tempskipa\@inhibitglue
+        \hskip -\@tempskipa\ltjfakeparbegin
       \else
         \clubpenalty \@clubpenalty
         \everypar{}%
   \if@slide
     {\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}
+     \vskip\if@twocolumn 4\jsc@mpt\else 7\jsc@mpt\fi\relax}%
   \fi
   \par  % 2000-12-18
   \ignorespaces}
 % 番号を付けるかを決めるカウンタです。
 %
 %    \begin{macrocode}
-%<!book>\setcounter{secnumdepth}{3}
-%<book>\setcounter{secnumdepth}{2}
+%<!book&!report>\setcounter{secnumdepth}{3}
+%<book|report>\setcounter{secnumdepth}{2}
 %    \end{macrocode}
 % \end{macro}
 %
 %
 %    \begin{macrocode}
 \newcounter{part}
-%<book>\newcounter{chapter}
-%<book>\newcounter{section}[chapter]
-%<!book>\newcounter{section}
+%<book|report>\newcounter{chapter}
+%<book|report>\newcounter{section}[chapter]
+%<!book&!report>\newcounter{section}
 \newcounter{subsection}[section]
 \newcounter{subsubsection}[subsection]
 \newcounter{paragraph}[subsubsection]
 %
 %    \begin{macrocode}
 \renewcommand{\thepart}{\@Roman\c@part}
-%<!book>% \renewcommand{\thesection}{\@arabic\c@section}
-%<!book>\renewcommand{\thesection}{\presectionname\@arabic\c@section\postsectionname}
-%<!book>\renewcommand{\thesubsection}{\@arabic\c@section.\@arabic\c@subsection}
-%<*book>
+%<!book&!report>% \renewcommand{\thesection}{\@arabic\c@section}
+%<!book&!report>\renewcommand{\thesection}{\presectionname\@arabic\c@section\postsectionname}
+%<!book&!report>\renewcommand{\thesubsection}{\@arabic\c@section.\@arabic\c@subsection}
+%<*book|report>
 \renewcommand{\thechapter}{\@arabic\c@chapter}
 \renewcommand{\thesection}{\thechapter.\@arabic\c@section}
 \renewcommand{\thesubsection}{\thesection.\@arabic\c@subsection}
-%</book>
+%</book|report>
 \renewcommand{\thesubsubsection}{%
    \thesubsection.\@arabic\c@subsubsection}
 \renewcommand{\theparagraph}{%
 % [2003-03-02] |\@secapp| は外しました。
 %
 %    \begin{macrocode}
-%<book>\newcommand{\@chapapp}{\prechaptername}
-%<book>\newcommand{\@chappos}{\postchaptername}
+%<book|report>\newcommand{\@chapapp}{\prechaptername}
+%<book|report>\newcommand{\@chappos}{\postchaptername}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
 % ページ番号をローマ数字にし,章番号を付けないようにします。
 %
+% [2017-03-05] |\frontmatter| と |\mainmatter| の2つの命令は,
+% 改丁または改ページした後で |\pagenumbering{...}| でノンブルを1に
+% リセットします。長い間 |\frontmatter| は \texttt{openany} のときに
+% 単なる改ページとしていましたが,これではノンブルをリセットする際に
+% 偶奇逆転が起こる場合がありました。\texttt{openany} かどうかに依らず
+% 奇数ページまで繰るように修正することで,問題を解消しました。
+% 実は,\LaTeX の標準クラスでは1998年に修正されていた問題です
+% (コミュニティ版\pLaTeX の標準クラス2017/03/05も参照)。
+%
 %    \begin{macrocode}
 %<*book>
 \newcommand\frontmatter{%
-  \if@openright
-    \cleardoublepage
-  \else
-    \clearpage
-  \fi
+  \pltx@cleartooddpage
   \@mainmatterfalse
   \pagenumbering{roman}}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \newcommand\mainmatter{%
-% \if@openright
-    \cleardoublepage
-% \else
-%   \clearpage
-% \fi
+  \pltx@cleartooddpage
   \@mainmattertrue
   \pagenumbering{arabic}}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \newcommand\backmatter{%
-  \if@openright
+  \if@openleft
+    \cleardoublepage
+  \else\if@openright
     \cleardoublepage
   \else
     \clearpage
-  \fi
+  \fi\fi
   \@mainmatterfalse}
 %</book>
 %    \end{macrocode}
 %   \def\CMDB    #1{....}     % \chapter*{...} の定義
 %\end{verbatim}
 %
-% まず |book| クラス以外です。
+% ã\81¾ã\81\9a |book| ã\81¨ |report| ã\81®ã\82¯ã\83©ã\82¹ä»¥å¤\96ã\81§ã\81\99ã\80\82
 %
 %    \begin{macrocode}
-%<*!book>
+%<*!book&!report>
 \newcommand\part{%
   \if@noskipsec \leavevmode \fi
   \par
   \addvspace{4ex}%
   \if@english \@afterindentfalse \else \@afterindenttrue \fi
   \secdef\@part\@spart}
-%</!book>
+%</!book&!report>
 %    \end{macrocode}
 %
-% |book| ã\82¹ã\82¿ã\82¤ã\83«の場合は,少し複雑です。
+% |book| ã\81\8aã\82\88ã\81³ |report| ã\82¯ã\83©ã\82¹の場合は,少し複雑です。
 %
 %    \begin{macrocode}
-%<*book>
+%<*book|report>
 \newcommand\part{%
-  \if@openright
+  \if@openleft
+    \cleardoublepage
+  \else\if@openright
     \cleardoublepage
   \else
     \clearpage
-  \fi
+  \fi\fi
   \thispagestyle{empty}% 欧文用標準スタイルでは plain
   \if@twocolumn
     \onecolumn
   \fi
   \null\vfil
   \secdef\@part\@spart}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 %
 % 部の見出しを出力します。
 % |\bfseries| を |\headfont| に変えました。
 %
-% |book| クラス以外では |secnumdepth| が $-1$ より大きいとき
+% |book| ã\81\8aã\82\88ã\81³ |report| ã\82¯ã\83©ã\82¹ä»¥å¤\96ã\81§ã\81¯ |secnumdepth| ã\81\8c $-1$ ã\82\88ã\82\8a大ã\81\8dã\81\84ã\81¨ã\81\8d
 % 部番号を付けます。
 %
 %    \begin{macrocode}
-%<*!book>
+%<*!book&!report>
 \def\@part[#1]#2{%
   \ifnum \c@secnumdepth >\m@ne
     \refstepcounter{part}%
   \nobreak
   \vskip 3ex
   \@afterheading}
-%</!book>
+%</!book&!report>
 %    \end{macrocode}
 %
-% |book| クラスでは |secnumdepth| が $-2$ より大きいとき部番号を付けます。
+% |book| ã\81\8aã\82\88ã\81³ |report| ã\82¯ã\83©ã\82¹ã\81§ã\81¯ |secnumdepth| ã\81\8c $-2$ ã\82\88ã\82\8a大ã\81\8dã\81\84ã\81¨ã\81\8dé\83¨ç\95ªå\8f·ã\82\92ä»\98ã\81\91ã\81¾ã\81\99ã\80\82
 %
 %    \begin{macrocode}
-%<*book>
+%<*book|report>
 \def\@part[#1]#2{%
   \ifnum \c@secnumdepth >-2\relax
     \refstepcounter{part}%
     \fi
     \Huge \headfont #2\par}%
   \@endpart}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 %
 % 番号を付けない部です。
 %
 %    \begin{macrocode}
-%<*!book>
+%<*!book&!report>
 \def\@spart#1{{%
     \parindent \z@ \raggedright
     \interlinepenalty \@M
   \nobreak
   \vskip 3ex
   \@afterheading}
-%</!book>
-%<*book>
+%</!book&!report>
+%<*book|report>
 \def\@spart#1{{%
     \centering
     \interlinepenalty \@M
     \normalfont
     \Huge \headfont #1\par}%
   \@endpart}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 %
 % で修正されています。
 %
 %    \begin{macrocode}
-%<*book>
+%<*book|report>
 \def\@endpart{\vfil\newpage
   \if@twoside
-   \if@openright %% added (2016/12/13)
-    \null
-    \thispagestyle{empty}%
-    \newpage
-   \fi %% added (2016/12/13)
+   \if@openleft %% added (2017/02/24)
+    \null\thispagestyle{empty}\newpage
+   \else\if@openright %% added (2016/12/13)
+    \null\thispagestyle{empty}\newpage
+   \fi\fi %% added (2016/12/13, 2017/02/24)
   \fi
   \if@restonecol
     \twocolumn
   \fi}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 %
 %    章見出しの上に図や表が来ないようにします。
 %
 %    \begin{macrocode}
-%<*book>
+%<*book|report>
 \newcommand{\chapter}{%
-  \if@openright\cleardoublepage\else\clearpage\fi
+  \if@openleft\cleardoublepage\else
+  \if@openright\cleardoublepage\else\clearpage\fi\fi
   \plainifnotempty % 元: \thispagestyle{plain}
   \global\@topnum\z@
   \if@english \@afterindentfalse \else \@afterindenttrue \fi
 %    \begin{macrocode}
 \def\@chapter[#1]#2{%
   \ifnum \c@secnumdepth >\m@ne
-    \if@mainmatter
+%<book>    \if@mainmatter
       \refstepcounter{chapter}%
       \typeout{\@chapapp\thechapter\@chappos}%
       \addcontentsline{toc}{chapter}%
         % {\if@english\thechapter\else\@chapapp\thechapter\@chappos\fi}%
         {\@chapapp\thechapter\@chappos}%
         #1}%
-    \else\addcontentsline{toc}{chapter}{#1}\fi
+%<book>    \else\addcontentsline{toc}{chapter}{#1}\fi
   \else
     \addcontentsline{toc}{chapter}{#1}%
   \fi
   \vspace*{2\Cvs}% 欧文は50pt
   {\parindent \z@ \raggedright \normalfont
     \ifnum \c@secnumdepth >\m@ne
-      \if@mainmatter
+%<book>      \if@mainmatter
         \huge\headfont \@chapapp\thechapter\@chappos
         \par\nobreak
         \vskip \Cvs % 欧文は20pt
-      \fi
+%<book>      \fi
     \fi
     \interlinepenalty\@M
     \Huge \headfont #1\par\nobreak
     \interlinepenalty\@M
     \Huge \headfont #1\par\nobreak
     \vskip 3\Cvs}} % 欧文は40pt
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 %
     \rightmargin=0pt
     \leftmargin=5\zw}\item[]}{\end{list}\vspace{\baselineskip}}
 %</book>
-%<*article|kiyou>
+%<*article|report|kiyou>
 \newbox\@abstractbox
 \if@titlepage
   \newenvironment{abstract}{%
       \endlist
     \fi}
 \fi
-%</article|kiyou>
+%</article|report|kiyou>
 %<*jspf>
 \newbox\@abstractbox
 \newenvironment{abstract}{%
 %
 % タイトルを独立のページに出力するのに使われます。
 %
+% [2017-02-24] コミュニティ版\pLaTeX の標準クラス2017/02/15に合わせて,
+% bookクラスでタイトルを必ず奇数ページに送るようにしました。といっても,
+% 横組クラスしかありませんでしたので,従来の挙動は何も変わっていません。
+% また,book以外の場合のページ番号のリセットもコミュニティ版\pLaTeX の
+% 標準クラス2017/02/15に合わせましたが,こちらも片面印刷あるいは
+% 独立のタイトルページを作らないクラスばかりでしたので,従来の挙動は
+% 何も変わらずに済みました。
+%
 %    \begin{macrocode}
 \newenvironment{titlepage}{%
-%<book>    \cleardoublepage
+%<book>    \pltx@cleartooddpage %% 2017-02-24
     \if@twocolumn
       \@restonecoltrue\onecolumn
     \else
       \@restonecolfalse\newpage
     \fi
     \thispagestyle{empty}%
-    \setcounter{page}\@ne
+    \ifodd\c@page\setcounter{page}\@ne\else\setcounter{page}\z@\fi
   }%
   {\if@restonecol\twocolumn \else \newpage \fi
     \if@twoside\else
 % 本文と付録を分離するコマンドです。
 %
 %    \begin{macrocode}
-%<*!book>
+%<*!book&!report>
 \newcommand{\appendix}{\par
   \setcounter{section}{0}%
   \setcounter{subsection}{0}%
 % \gdef\thesection{\@Alph\c@section}% [2003-03-02]
   \gdef\thesection{\presectionname\@Alph\c@section\postsectionname}%
   \gdef\thesubsection{\@Alph\c@section.\@arabic\c@subsection}}
-%</!book>
-%<*book>
+%</!book&!report>
+%<*book|report>
 \newcommand{\appendix}{\par
   \setcounter{chapter}{0}%
   \setcounter{section}{0}%
   \gdef\@chapapp{\appendixname}%
   \gdef\@chappos{}%
   \gdef\thechapter{\@Alph\c@chapter}}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 %
 % 数式番号を出力するコマンドです。
 %
 %    \begin{macrocode}
-%<!book>\renewcommand \theequation {\@arabic\c@equation}
-%<*book>
+%<!book&!report>\renewcommand \theequation {\@arabic\c@equation}
+%<*book|report>
 \@addtoreset{equation}{chapter}
 \renewcommand\theequation
   {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 %
 % 図番号を出力するコマンドです。
 %
 %    \begin{macrocode}
-%<*!book>
+%<*!book&!report>
 \newcounter{figure}
 \renewcommand \thefigure {\@arabic\c@figure}
-%</!book>
-%<*book>
+%</!book&!report>
+%<*book|report>
 \newcounter{figure}[chapter]
 \renewcommand \thefigure
      {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % ここではオリジナルのままにしています。
 %
 %    \begin{macrocode}
-%<*!book>
+%<*!book&!report>
 \newcounter{table}
 \renewcommand\thetable{\@arabic\c@table}
-%</!book>
-%<*book>
+%</!book&!report>
+%<*book|report>
 \newcounter{table}[chapter]
 \renewcommand \thetable
      {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 \newcommand\@pnumwidth{1.55em}
 \newcommand\@tocrmarg{2.55em}
 \newcommand\@dotsep{4.5}
-%<!book>\setcounter{tocdepth}{2}
-%<book>\setcounter{tocdepth}{1}
+%<!book&!report>\setcounter{tocdepth}{2}
+%<book|report>\setcounter{tocdepth}{1}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %    \begin{macrocode}
 \newdimen\jsc@tocl@width
 \newcommand{\tableofcontents}{%
-%<*book>
+%<*book|report>
   \settowidth\jsc@tocl@width{\headfont\prechaptername\postchaptername}%
   \settowidth\@tempdima{\headfont\appendixname}%
   \ifdim\jsc@tocl@width<\@tempdima \setlength\jsc@tocl@width{\@tempdima}\fi
   \fi
   \chapter*{\contentsname}%
   \@mkboth{\contentsname}{}%
-%</book>
-%<*!book>
+%</book|report>
+%<*!book&!report>
   \settowidth\jsc@tocl@width{\headfont\presectionname\postsectionname}%
   \settowidth\@tempdima{\headfont\appendixname}%
   \ifdim\jsc@tocl@width<\@tempdima\relax\setlength\jsc@tocl@width{\@tempdima}\fi
   \ifdim\jsc@tocl@width<2\zw \divide\jsc@tocl@width by 2 \advance\jsc@tocl@width 1\zw\fi
   \section*{\contentsname}%
   \@mkboth{\contentsname}{\contentsname}%
-%</!book>
+%</!book&!report>
   \@starttoc{toc}%
-%<book>  \if@restonecol\twocolumn\fi
+%<book|report>  \if@restonecol\twocolumn\fi
 }
 %    \end{macrocode}
 % \end{macro}\end{macro}
 %    \begin{macrocode}
 \newcommand*{\l@part}[2]{%
   \ifnum \c@tocdepth >-2\relax
-%<!book>    \addpenalty\@secpenalty
-%<book>    \addpenalty{-\@highpenalty}%
+%<!book&!report>    \addpenalty\@secpenalty
+%<book|report>    \addpenalty{-\@highpenalty}%
     \addvspace{2.25em \@plus\jsc@mpt}%
     \begingroup
       \parindent \z@
         \setlength\@lnumwidth{4\zw}%
         #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
       \nobreak
-%<book>    \global\@nobreaktrue
-%<book>    \everypar{\global\@nobreakfalse\everypar{}}%
+%<book|report>    \global\@nobreaktrue
+%<book|report>    \everypar{\global\@nobreakfalse\everypar{}}%
     \endgroup
   \fi}
 %    \end{macrocode}
 % 決めるようにしてみました。(by ts)
 %
 %    \begin{macrocode}
-%<*book>
+%<*book|report>
 \newcommand*{\l@chapter}[2]{%
   \ifnum \c@tocdepth >\m@ne
     \addpenalty{-\@highpenalty}%
       \penalty\@highpenalty
     \endgroup
   \fi}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 %
 % 節の目次です。
 %
 %    \begin{macrocode}
-%<*!book>
+%<*!book&!report>
 \newcommand*{\l@section}[2]{%
   \ifnum \c@tocdepth >\z@
     \addpenalty{\@secpenalty}%
       #1\nobreak\hfil\nobreak\hbox to\@pnumwidth{\hss#2}\par
     \endgroup
   \fi}
-%</!book>
+%</!book&!report>
 %    \end{macrocode}
 %
 % インデントと幅はそれぞれ1.5em,2.3emでしたが,
 % |1\zw|,|3.683\zw|に変えました。
 %
 %    \begin{macrocode}
-%<book> % \newcommand*{\l@section}{\@dottedtocline{1}{1\zw}{3.683\zw}}
+%<book|report> % \newcommand*{\l@section}{\@dottedtocline{1}{1\zw}{3.683\zw}}
 %    \end{macrocode}
 %
 % [2013-12-30] 上のインデントは |\jsc@tocl@width| から決めるように
 % してみました。(by ts)
 %
 %    \begin{macrocode}
-%<*!book>
+%<*!book&!report>
 % \newcommand*{\l@subsection}   {\@dottedtocline{2}{1.5em}{2.3em}}
 % \newcommand*{\l@subsubsection}{\@dottedtocline{3}{3.8em}{3.2em}}
 % \newcommand*{\l@paragraph}    {\@dottedtocline{4}{7.0em}{4.1em}}
 \newcommand*{\l@subparagraph}{%
           \@tempdima\jsc@tocl@width \advance\@tempdima 2\zw
           \@dottedtocline{5}{\@tempdima}{6\zw}}
-%</!book>
-%<*book>
+%</!book&!report>
+%<*book|report>
 % \newcommand*{\l@subsection}   {\@dottedtocline{2}{3.8em}{3.2em}}
 % \newcommand*{\l@subsubsection}{\@dottedtocline{3}{7.0em}{4.1em}}
 % \newcommand*{\l@paragraph}    {\@dottedtocline{4}{10em}{5em}}
 \newcommand*{\l@subparagraph}{%
           \@tempdima\jsc@tocl@width \advance\@tempdima 16.183\zw
           \@dottedtocline{5}{\@tempdima}{6.5\zw}}
-%</book>
+%</book|report>
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
 %    \begin{macrocode}
 \newcommand{\listoffigures}{%
-%<*book>
+%<*book|report>
   \if@twocolumn\@restonecoltrue\onecolumn
   \else\@restonecolfalse\fi
   \chapter*{\listfigurename}%
   \@mkboth{\listfigurename}{}%
-%</book>
-%<*!book>
+%</book|report>
+%<*!book&!report>
   \section*{\listfigurename}%
   \@mkboth{\listfigurename}{\listfigurename}%
-%</!book>
+%</!book&!report>
   \@starttoc{lof}%
-%<book>  \if@restonecol\twocolumn\fi
+%<book|report>  \if@restonecol\twocolumn\fi
 }
 %    \end{macrocode}
 % \end{macro}
 %
 %    \begin{macrocode}
 \newcommand{\listoftables}{%
-%<*book>
+%<*book|report>
   \if@twocolumn\@restonecoltrue\onecolumn
   \else\@restonecolfalse\fi
   \chapter*{\listtablename}%
   \@mkboth{\listtablename}{}%
-%</book>
-%<*!book>
+%</book|report>
+%<*!book&!report>
   \section*{\listtablename}%
   \@mkboth{\listtablename}{\listtablename}%
-%</!book>
+%</!book&!report>
   \@starttoc{lot}%
-%<book>  \if@restonecol\twocolumn\fi
+%<book|report>  \if@restonecol\twocolumn\fi
 }
 %    \end{macrocode}
 % \end{macro}
   \subsubsection*{\refname}\@mkboth{\refname}{\refname}%
   \vspace{0.5\baselineskip}
 %</kiyou>
-%<book>  \chapter*{\bibname}\@mkboth{\bibname}{}%
-%<book>  \addcontentsline{toc}{chapter}{\bibname}%
+%<book|report>  \chapter*{\bibname}\@mkboth{\bibname}{}%
+%<book|report>  \addcontentsline{toc}{chapter}{\bibname}%
    \list{\@biblabel{\@arabic\c@enumiv}}%
         {\settowidth\labelwidth{\@biblabel{#1}}%
          \leftmargin\labelwidth
     \fi
     \columnseprule.4pt \columnsep 2\zw
     \ifx\multicols\@undefined
-%<book>      \twocolumn[\@makeschapterhead{\indexname}%
-%<book>      \addcontentsline{toc}{chapter}{\indexname}]%
-%<!book>      \def\presectionname{}\def\postsectionname{}%
-%<!book>      \twocolumn[\section*{\indexname}]%
+%<book|report>      \twocolumn[\@makeschapterhead{\indexname}%
+%<book|report>      \addcontentsline{toc}{chapter}{\indexname}]%
+%<!book&!report>      \def\presectionname{}\def\postsectionname{}%
+%<!book&!report>      \twocolumn[\section*{\indexname}]%
     \else
       \ifdim\textwidth<\fullwidth
         \setlength{\evensidemargin}{\oddsidemargin}
         \setlength{\textwidth}{\fullwidth}
         \setlength{\linewidth}{\fullwidth}
-%<book>        \begin{multicols}{3}[\chapter*{\indexname}%
-%<book>        \addcontentsline{toc}{chapter}{\indexname}]%
-%<!book>        \def\presectionname{}\def\postsectionname{}%
-%<!book>        \begin{multicols}{3}[\section*{\indexname}]%
+%<book|report>        \begin{multicols}{3}[\chapter*{\indexname}%
+%<book|report>        \addcontentsline{toc}{chapter}{\indexname}]%
+%<!book&!report>        \def\presectionname{}\def\postsectionname{}%
+%<!book&!report>        \begin{multicols}{3}[\section*{\indexname}]%
       \else
-%<book>        \begin{multicols}{2}[\chapter*{\indexname}%
-%<book>        \addcontentsline{toc}{chapter}{\indexname}]%
-%<!book>        \def\presectionname{}\def\postsectionname{}%
-%<!book>        \begin{multicols}{2}[\section*{\indexname}]%
+%<book|report>        \begin{multicols}{2}[\chapter*{\indexname}%
+%<book|report>        \addcontentsline{toc}{chapter}{\indexname}]%
+%<!book&!report>        \def\presectionname{}\def\postsectionname{}%
+%<!book&!report>        \begin{multicols}{2}[\section*{\indexname}]%
       \fi
     \fi
-%<book>    \@mkboth{\indexname}{}%
-%<!book>    \@mkboth{\indexname}{\indexname}%
+%<book|report>    \@mkboth{\indexname}{}%
+%<!book&!report>    \@mkboth{\indexname}{\indexname}%
     \plainifnotempty % \thispagestyle{plain}
     \parindent\z@
     \parskip\z@ \@plus .3\jsc@mpt\relax
 % 「注1」の形式にするには次のようにしてください。
 %
 %    \begin{macrocode}
-% \def\thefootnote{\ifnum\c@footnote>\z@注\kern0.1\zw\@arabic\c@footnote\fi}
+% \def\thefootnote{\ifnum\c@footnote>\z@ 注\kern0.1\zw\@arabic\c@footnote\fi}
 %    \end{macrocode}
 %
 % \end{macro}
 %
 % 脚注番号は章ごとにリセットされます。
 %
+% [2018-03-11] |\next|などいくつかの内部命令を |\jsc@...| 付きの
+% ユニークな名前にしました。
 %    \begin{macrocode}
-%<book>\@addtoreset{footnote}{chapter}
+%<book|report>\@addtoreset{footnote}{chapter}
 %    \end{macrocode}
 % \end{macro}
 %
 % Jeremy Gibbons, \textit{\TeX\ and TUG NEWS},
 %  Vol.~2, No.~4 (1993), p.~9)
 %
+% [2018-03-11] |\next|などいくつかの内部命令を |\jsc@...| 付きの
+% ユニークな名前にしました。
 %    \begin{macrocode}
 \long\def\@footnotetext{%
   \insert\footins\bgroup
     \color@begingroup
       \@makefntext{%
         \rule\z@\footnotesep\ignorespaces}%
-      \futurelet\next\fo@t}
-\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
-                                \else \let\next\f@t\fi \next}
-\def\f@@t{\bgroup\aftergroup\@foot\let\next}
-\def\f@t#1{#1\@foot}
-\def\@foot{\@finalstrut\strutbox\color@endgroup\egroup}
+      \futurelet\jsc@next\jsc@fo@t}
+\def\jsc@fo@t{\ifcat\bgroup\noexpand\jsc@next \let\jsc@next\jsc@f@@t
+                                \else \let\jsc@next\jsc@f@t\fi \jsc@next}
+\def\jsc@f@@t{\bgroup\aftergroup\jsc@@foot\let\jsc@next}
+\def\jsc@f@t#1{#1\jsc@@foot}
+\def\jsc@@foot{\@finalstrut\strutbox\color@endgroup\egroup}
 %    \end{macrocode}
 % \end{macro}
 %
 % する機能がありますが,|\item| 直後ではラベル用のボックスが段落先頭になる
 % ため,うまく働きませんでした。形を変えて復活させます。
 %
+% [2017-04-03 LTJ] 従来クラスファイルで定義していた |\@inhibitglue| は,
+% Lua\TeX-jaのコアに |\ltjfakeparbegin| として正式に追加されたのでリネームします.
+%
 % |\item| 命令の直後です。
 %
 %    \begin{macrocode}
-\protected\def\@inhibitglue{\directlua{luatexja.jfmglue.create_beginpar_node()}}
+\let\@inhibitglue=\ltjfakeparbegin
 \def\@item[#1]{%
   \if@noparitem
     \@donoparitem
     \else
       \clubpenalty \@clubpenalty
       \everypar{}%
-    \fi\@inhibitglue}%
+    \fi\ltjfakeparbegin}%
   \if@noitemarg
     \@noitemargfalse
     \if@nmbrlist
 %
 % [2016-12-05 LTJ] 本家[2016-11-29],lltjcore.styでの変更に追従させます.
 %
+% [2017-02-18 LTJ] lltjcore.sty側で戻したのを忘れていました.
 %    \begin{macrocode}
 \def\@gnewline #1{%
   \ifvmode
     \@nolnerr
   \else
-%<article|book>    \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \hskip\z@
-%<jspf|kiyou>    \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
+    \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
     \inhibitglue \ignorespaces
   \fi}
 %    \end{macrocode}
 %
 % [2016-07-14] ロゴの定義は\texttt{jslogo}パッケージに移転しました。
 % 後方互換のため,\texttt{jsclasses}ではデフォルトでこれを読み込みます。
-%
 % \texttt{nojslogo}オプションが指定されている場合は読み込みません。
 %
 % [2016-07-21 LTJ] \texttt{jsclasses} とLua\TeX-jaの更新タイミングが一致しない可能性を考慮し,
 %    \begin{macrocode}
 \newcommand{\prepartname}{\if@english Part~\else 第\fi}
 \newcommand{\postpartname}{\if@english\else 部\fi}
-%<book>\newcommand{\prechaptername}{\if@english Chapter~\else 第\fi}
-%<book>\newcommand{\postchaptername}{\if@english\else 章\fi}
+%<book|report>\newcommand{\prechaptername}{\if@english Chapter~\else 第\fi}
+%<book|report>\newcommand{\postchaptername}{\if@english\else 章\fi}
 \newcommand{\presectionname}{}%  第
 \newcommand{\postsectionname}{}% 節
 %    \end{macrocode}
 % \paragraph{ページ設定}
 %
 % ページ設定の初期化です。
+% |stfloats|パッケージがシステムにインストールされている場合は、このパッケージを使って
+% \pLaTeX の標準時と同じようにボトムフロートの下に脚注が組まれるようにします。
 %
+% [2017-02-19] \pLaTeX とLua\TeX-jaの|\@makecol|が違うことを
+%   考慮していませんでした。
 %    \begin{macrocode}
-%<article|kiyou>\if@slide \pagestyle{empty} \else \pagestyle{plain} \fi
+%<article>\if@slide \pagestyle{empty} \else \pagestyle{plain} \fi
 %<book>\if@report \pagestyle{plain} \else \pagestyle{headings} \fi
+%<report|kiyou>\pagestyle{plain}
 %<jspf>\pagestyle{headings}
 \pagenumbering{arabic}
+\fnfixbottomtrue % 2017-02-19
+\IfFileExists{stfloats.sty}{\RequirePackage{stfloats}\fnbelowfloat}{}
 \if@twocolumn
   \twocolumn
   \sloppy