OSDN Git Service

ltj-rmlgbm.lua: updated CMap version
[luatex-ja/luatexja.git] / src / ltjarticle.cls
index efd6259..236b2a1 100644 (file)
@@ -23,7 +23,7 @@
 %% File: ltjclasses.dtx
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjarticle}
-  [2018/02/04 v1.7h-ltj-15
+  [2018/10/08 v1.8-ltj-16
  Standard LuaLaTeX-ja class]
 \RequirePackage{luatexja}
 \newcounter{@paper}
 \if@compatibility
   \@mathrmmctrue
 \else
-  \DeclareOption{disablejfam}{%
-    \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
   \DeclareOption{mathrmmc}{\@mathrmmctrue}
 \fi
 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
 \setlength\fboxsep{3\p@}
 \setlength\fboxrule{.4\p@}
 \renewcommand{\theequation}{\@arabic\c@equation}
+\unless\ifltj@disablejfam
 \if@compatibility\else
   \DeclareSymbolFont{mincho}{JY3}{mc}{m}{n}
   \DeclareSymbolFontAlphabet{\mathmc}{mincho}
   \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}
 }%
 \fi
+\fi
 \DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc}
 \DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt}
 \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
      \hb@xt@\@pnumwidth{\hss\normalfont \normalcolor #5}%
      \par}%
   \fi}
+\providecommand*\protected@file@percent{}
 \def\addcontentsline#1#2#3{%
   \protected@write\@auxout
     {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble
 \@temptokena{\thepage}}%
     {\string\@writefile{#1}%
-       {\protect\contentsline{#2}{#3}{\the\@temptokena}}}%
+       {\protect\contentsline{#2}{#3}{\the\@temptokena}%
+\protected@file@percent}}%
 }
 \newcommand{\tableofcontents}{%
   \section*{\contentsname
   \kern2.6\p@}
 \newcommand\@makefntext[1]{\parindent 1em
   \noindent\hb@xt@ 1.8em{\hss\@makefnmark}#1}
-\newif\if西暦 \西暦false
+\newif\if西暦 \西暦true
 \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西暦
+    \ifnum\ltjgetparameter{direction}=3 \kansuji\year
+\else\number\year\nobreak\fi 年
+  \else
+\pltx@today@year
+  \fi
   \ifnum\ltjgetparameter{direction}=3
-    \if西暦
-      \kansuji\year 年
-      \kansuji\month 月
-      \kansuji\day 日
-    \else
-      平成\ifnum\heisei=1 元年\else\kansuji\heisei 年\fi
-      \kansuji\month 月
-      \kansuji\day 日
-    \fi
+\kansuji\month 月
+    \kansuji\day 日
   \else
-    \if西暦
-      \number\year~年
-      \number\month~月
-      \number\day~日
-    \else
-      平成\ifnum\heisei=1 元年\else\number\heisei~年\fi
-      \number\month~月
-      \number\day~日
-    \fi
+    \number\month\nobreak 月
+    \number\day\nobreak 日
   \fi}}
 \newcommand{\prepartname}{第}
 \newcommand{\postpartname}{部}