OSDN Git Service

sync with jclasses.dtx v1.1e (pLaTeX 9bf8efa1)
[luatex-ja/luatexja.git] / src / ltjclasses.dtx
index 3112fd1..9da4e2b 100644 (file)
@@ -5,7 +5,7 @@
 %
 %  Copyright 1995-2001 ASCII Corporation.
 %  Copyright (c) 2010 ASCII MEDIA WORKS
-%  Copyright (c) 2016-2018 Japanese TeX Development Community
+%  Copyright (c) 2016-2020 Japanese TeX Development Community
 %
 %  This file is part of the pLaTeX2e system (community edition).
 %  -------------------------------------------------------------
 %    (sync with ltsect.dtx 2018/09/26 v1.1c)}
 % \changes{v1.8b}{2019/04/02}{新元号対応}
 % \changes{v1.8b-ltj-17}{2019/08/12}{disablejfamの``Unused global option(s)''警告を出さないようにした}
-
+% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに
+%    (sync with classes.dtx 2019/08/27 v1.4j)}
+% \changes{v1.8d}{2019/10/25}{Don't use \cs{MakeRobust} if
+%    in rollback prior to 2015
+%    (sync with classes.dtx 2019/10/25 v1.4k)}
+% \changes{v1.8e}{2020/01/03}{Normalize label fonts
+%    (sync with classes.dtx 2019/12/20 v1.4l)}
 % \fi
 %
 % \iffalse
 %<11pt&bk>\ProvidesFile{ltjtbk11.clo}
 %<12pt&bk>\ProvidesFile{ltjtbk12.clo}
 %</tate>
-  [2019/08/12 v1.8b-ltj-17
+  [2020/01/13 v1.8e-ltj-17
 %<article|report|book> Standard LuaLaTeX-ja class]
 %<10pt|11pt|12pt>  Standard LuaLaTeX-ja file (size option)]
 %<*driver>
 \begingroup
  \suppressfontnotfounderror=1
  \global\font\testfont=file:KozMinPr6N-Regular.otf
+ \global\font\testfonta=file:HaranoAjiMincho-Regular.otf
 \endgroup
-\ifx\testfont\nullfont
+\ifx\testfonta\nullfont\ifx\testfont\nullfont
   \usepackage[ipaex,nfssonly]{luatexja-preset}
 \else
   \usepackage[kozuka-pr6n,nfssonly]{luatexja-preset}
+\fi\else
+  \usepackage[haranoaji,nfssonly]{luatexja-preset}
 \fi
+\let\testfont\undefined\let\testfonta\undefined
+\usepackage{unicode-math}
+\setmathfont{Latin Modern Math}
 \def\pLaTeX{p\kern-.05em\LaTeX}
 \usepackage[unicode]{hyperref}
 \title{Lua\LaTeX-ja用\texttt{jclasses}互換クラス}
 %<tate>\kanjiencoding{\kanjiencodingdefault}%
 \normalsize
 %    \end{macrocode}
+%
+% |\normalsize|をrobustにします。
+% すぐ上で|\DeclareRobustCommand|とせずに、
+% カーネルの定義を|\renewcommand|した後に|\MakeRobust|を使っている理由は、
+% ログに |LaTeX Info: Redefining \normalsize on input line ...| という
+% メッセージを出したくないからです。
+% ただし、\textsf{latexrelease}パッケージで2015/01/01より
+% 昔の日付に巻き戻っている場合は|\MakeRobust|が定義されていません。
+% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに
+%    (sync with classes.dtx 2019/08/27 v1.4j)}
+% \changes{v1.8d}{2019/10/25}{Don't use \cs{MakeRobust} if
+%    in rollback prior to 2015
+%    (sync with classes.dtx 2019/10/25 v1.4k)}
+%    \begin{macrocode}
+\ifx\MakeRobust\@undefined \else
+  \MakeRobust\normalsize
+\fi
+%    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
 %
 % \begin{macro}{\small}
 % |\small|コマンドの定義は、|\normalsize|に似ています。
+% こちらはカーネルで未定義なので、直接|\DeclareRobustCommand|で定義します。
+% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに
+%    (sync with classes.dtx 2019/08/27 v1.4j)}
 %    \begin{macrocode}
-\newcommand{\small}{%
+\DeclareRobustCommand{\small}{%
 %<*10pt>
   \@setfontsize\small\@ixpt{11}%
   \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
 %
 % \begin{macro}{\footnotesize}
 % |\footnotesize|コマンドの定義は、|\normalsize|に似ています。
+% こちらも直接|\DeclareRobustCommand|で定義します。
+% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに
+%    (sync with classes.dtx 2019/08/27 v1.4j)}
 %    \begin{macrocode}
-\newcommand{\footnotesize}{%
+\DeclareRobustCommand{\footnotesize}{%
 %<*10pt>
   \@setfontsize\footnotesize\@viiipt{9.5}%
   \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
 % \begin{macro}{\Huge}
 % これらは先ほどのマクロよりも簡単です。これらはフォントサイズを変更する
 % だけで、リスト環境とディスプレイ数式のパラメータは変更しません。
+% \changes{v1.8c}{2019/10/17}{フォントサイズ変更命令をrobustに
+%    (sync with classes.dtx 2019/08/27 v1.4j)}
 %    \begin{macrocode}
 %<*10pt>
-\newcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt}
-\newcommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt}
-\newcommand{\large}{\@setfontsize\large\@xiipt{17}}
-\newcommand{\Large}{\@setfontsize\Large\@xivpt{21}}
-\newcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{25}}
-\newcommand{\huge}{\@setfontsize\huge\@xxpt{28}}
-\newcommand{\Huge}{\@setfontsize\Huge\@xxvpt{33}}
+\DeclareRobustCommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt}
+\DeclareRobustCommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt}
+\DeclareRobustCommand{\large}{\@setfontsize\large\@xiipt{17}}
+\DeclareRobustCommand{\Large}{\@setfontsize\Large\@xivpt{21}}
+\DeclareRobustCommand{\LARGE}{\@setfontsize\LARGE\@xviipt{25}}
+\DeclareRobustCommand{\huge}{\@setfontsize\huge\@xxpt{28}}
+\DeclareRobustCommand{\Huge}{\@setfontsize\Huge\@xxvpt{33}}
 %</10pt>
 %<*11pt>
-\newcommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}}
-\newcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
-\newcommand{\large}{\@setfontsize\large\@xiipt{17}}
-\newcommand{\Large}{\@setfontsize\Large\@xivpt{21}}
-\newcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{25}}
-\newcommand{\huge}{\@setfontsize\huge\@xxpt{28}}
-\newcommand{\Huge}{\@setfontsize\Huge\@xxvpt{33}}
+\DeclareRobustCommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}}
+\DeclareRobustCommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
+\DeclareRobustCommand{\large}{\@setfontsize\large\@xiipt{17}}
+\DeclareRobustCommand{\Large}{\@setfontsize\Large\@xivpt{21}}
+\DeclareRobustCommand{\LARGE}{\@setfontsize\LARGE\@xviipt{25}}
+\DeclareRobustCommand{\huge}{\@setfontsize\huge\@xxpt{28}}
+\DeclareRobustCommand{\Huge}{\@setfontsize\Huge\@xxvpt{33}}
 %</11pt>
 %<*12pt>
-\newcommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}}
-\newcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
-\newcommand{\large}{\@setfontsize\large\@xivpt{21}}
-\newcommand{\Large}{\@setfontsize\Large\@xviipt{25}}
-\newcommand{\LARGE}{\@setfontsize\LARGE\@xxpt{28}}
-\newcommand{\huge}{\@setfontsize\huge\@xxvpt{33}}
+\DeclareRobustCommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}}
+\DeclareRobustCommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
+\DeclareRobustCommand{\large}{\@setfontsize\large\@xivpt{21}}
+\DeclareRobustCommand{\Large}{\@setfontsize\Large\@xviipt{25}}
+\DeclareRobustCommand{\LARGE}{\@setfontsize\LARGE\@xxpt{28}}
+\DeclareRobustCommand{\huge}{\@setfontsize\huge\@xxvpt{33}}
 \let\Huge=\huge
 %</12pt>
 %</10pt|11pt|12pt>
 % これらの3つのコマンドは\file{ltsect.dtx}で提供されています。
 % これらのコマンドは次のように定義されています。
 %    \begin{macrocode}
-%\newcommand*{\title}[1]{\gdef\@title{#1}}
-%\newcommand*{\author}[1]{\gdef\@author{#1}}
-%\newcommand*{\date}[1]{\gdef\@date{#1}}
+%\DeclareRobustCommand*{\title}[1]{\gdef\@title{#1}}
+%\DeclareRobustCommand*{\author}[1]{\gdef\@author{#1}}
+%\DeclareRobustCommand*{\date}[1]{\gdef\@date{#1}}
 %    \end{macrocode}
 % |\date|マクロのデフォルトは、今日の日付です。
 %    \begin{macrocode}
 % itemize環境のそれぞれの項目のラベルは、
 % |\labelenumi| \ldots\ |\labelenumiv|で生成されます。
 % \changes{v1.1a}{1997/01/28}{Bug fix: \cs{labelitemii}.}
+% \changes{v1.8e}{2020/01/03}{Normalize label fonts
+%    (sync with classes.dtx 2019/12/20 v1.4l)}
 %    \begin{macrocode}
-\newcommand{\labelitemi}{\textbullet}
+\newcommand{\labelitemi}{\labelitemfont \textbullet}
 \newcommand{\labelitemii}{%
   \ifnum\ltjgetparameter{direction}=3
-     {\textcircled{~}}
+     {\labelitemfont \textcircled{~}}
   \else
-     {\normalfont\bfseries\textendash}
+     {\labelitemfont \bfseries\textendash}
   \fi
 }
-\newcommand{\labelitemiii}{\textasteriskcentered}
-\newcommand{\labelitemiv}{\textperiodcentered}
+\newcommand{\labelitemiii}{\labelitemfont \textasteriskcentered}
+\newcommand{\labelitemiv}{\labelitemfont \textperiodcentered}
+\newcommand\labelitemfont{\normalfont}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}