OSDN Git Service

bugfix
[luatex-ja/luatexja.git] / src / ltjspf.cls
index 043a47e..3e7b5d2 100644 (file)
@@ -38,8 +38,9 @@
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjspf}
-  [2018/07/02 ltjsclasses ]
+  [2019/04/06 ltjsclasses ]
 \def\jsc@clsname{ltjspf}
+\def\Cjascale{0.903375}
 \RequirePackage{luatexja}
 \newif\if@restonecol
 \newif\if@titlepage
@@ -192,8 +193,6 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
       &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
     \tabskip\z@skip\cr
     }}
-\DeclareOption{disablejfam}{%
-  \ClassWarningNoLine{\jsc@clsname}{The class option 'disablejfam' is obsolete}}
 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
 \DeclareOption{final}{\setlength\overfullrule{0pt}}
 \newif\ifmingoth
@@ -203,11 +202,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \newif\ifptexjis
 \ptexjisfalse
 \DeclareOption{winjis}{%
-  \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}}
+  \ClassWarningNoLine{\jsc@clsname}{this class does not support `winjis' option}}
 \DeclareOption{uplatex}{%
-  \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}}
+  \ClassError{\jsc@clsname}{this class does not support `uplatex' option}}
 \DeclareOption{autodetect-engine}{%
-  \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}}
+  \ClassWarningNoLine{\jsc@clsname}{this class does not support `autodetect-engine' option}}
 \DeclareOption{mingoth}{\mingothtrue}
 \DeclareOption{ptexjis}{\ptexjistrue}
 \DeclareOption{jis}{\jisfonttrue}
@@ -306,7 +305,6 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
     \setlength{\pageheight}{\paperheight}
   \fi
 \fi
- \def\Cjascale{0.903375}
 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
 \ifmingoth
   \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=min}{}
@@ -315,13 +313,8 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
   \ifptexjis
     \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 * [\Cjascale] \ltj@stdmcfont:jfm=ujis}{}
-    \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=ujis}{}
   \fi
 \fi
-\DeclareFontShape{JT3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=ujisv}{}
-\DeclareFontShape{JT3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=ujisv}{}
 \DeclareFontShape{JY3}{mc}{bx}{n}{<->ssub*gt/m/n}{}
 \DeclareFontShape{JY3}{gt}{bx}{n}{<->ssub*gt/m/n}{}
 \DeclareFontShape{JY3}{mc}{b}{n}{<->ssub*gt/m/n}{}
@@ -351,8 +344,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}%
 \renewcommand\jttdefault{\gtdefault}\@ltj@match@familytrue
 %%
 \AtBeginDocument{%
-  \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}
-  \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}}%
+  \unless\ifltj@disablejfam
+    \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}
+    \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}
+  \fi
+}%
 \ltjsetparameter{jaxspmode={`!,2}}
 \ltjsetparameter{jaxspmode={`〒,1}}
 \ltjsetparameter{alxspmode={`+,3}}
@@ -1136,6 +1132,8 @@ class has defined the old font commands like\MessageBreak
           \@dottedtocline{5}{\@tempdima}{6\zw}}
 \newdimen\@lnumwidth
 \def\numberline#1{\hb@xt@\@lnumwidth{#1\hfil}\hspace{0pt}}
+\def\jsTocLine{\leaders\hbox{%
+  $\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill}
 \def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else
   \vskip \z@ \@plus.2\jsc@mpt
   {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
@@ -1145,8 +1143,7 @@ class has defined the old font commands like\MessageBreak
    \@lnumwidth #3\relax
    \advance\leftskip \@lnumwidth \null\nobreak\hskip -\leftskip
     {#4}\nobreak
-    \leaders\hbox{$\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
-       mu$}\hfill \nobreak\hb@xt@\@pnumwidth{%
+    \jsTocLine \nobreak\hb@xt@\@pnumwidth{%
          \hfil\normalfont \normalcolor #5}\par}\fi}
 \newcommand{\listoffigures}{%
   \section*{\listfigurename}%
@@ -1487,23 +1484,42 @@ class has defined the old font commands like\MessageBreak
 \def\西暦{\西暦true}
 \def\和暦{\西暦false}
 \newcount\heisei \heisei\year \advance\heisei-1988\relax
+\def\pltx@today@year@#1{%
+  \ifnum\numexpr\year-#1=1 元\else
+    \ifnum\ltjgetparameter{direction}=3
+      \kansuji\numexpr\year-#1\relax
+    \else
+      \number\numexpr\year-#1\relax\nobreak
+    \fi
+  \fi 年
+}
+\def\pltx@today@year{%
+  \ifnum\numexpr\year*10000+\month*100+\day<19890108
+    昭和\pltx@today@year@{1925}%
+  \else\ifnum\numexpr\year*10000+\month*100+\day<20190501
+    平成\pltx@today@year@{1988}%
+  \else
+    令和\pltx@today@year@{2018}%
+  \fi\fi}
 \def\today{%
   \if@english
     \ifcase\month\or
       January\or February\or March\or April\or May\or June\or
       July\or August\or September\or October\or November\or December\fi
       \space\number\day, \number\year
+  \else\if西暦
+    \ifnum\ltjgetparameter{direction}=3 \kansuji\year
+    \else\number\year\nobreak\fi 年
   \else
-    \if西暦
-      \number\year 年
-      \number\month 月
-      \number\day 日
-    \else
-      平成\number\heisei 年
-      \number\month 月
-      \number\day 日
-    \fi
-  \fi}
+    \pltx@today@year
+  \fi
+  \ifnum\ltjgetparameter{direction}=3
+    \kansuji\month 月
+    \kansuji\day 日
+  \else
+    \number\month\nobreak 月
+    \number\day\nobreak 日
+  \fi\fi}
 \hyphenation{ado-be post-script ghost-script phe-nom-e-no-log-i-cal man-u-script}
 \pagestyle{headings}
 \pagenumbering{arabic}