X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltjsclasses.dtx;h=b816ad579ceb88c26a7b38f1dd7bb7b976dad12e;hb=f078ac2f7998a102c7ec765e725f2269eed9f872;hp=5e57c11029f00989881ebd02ac097bf45c107f1a;hpb=cbf24f6e7335927b0d4a804dfeba4e2dd4c2a9a5;p=luatex-ja%2Fluatexja.git diff --git a/src/ltjsclasses.dtx b/src/ltjsclasses.dtx index 5e57c11..b816ad5 100644 --- a/src/ltjsclasses.dtx +++ b/src/ltjsclasses.dtx @@ -44,10 +44,10 @@ %<*driver> \ProvidesFile{ltjsclasses.dtx} % - [2018/06/09 ltjsclasses ] + [2019/04/06 ltjsclasses ] %<*driver> \IfFileExists{luatex85.sty}{\RequirePackage{luatex85}}{} -\documentclass{ltjsarticle} +\documentclass[disablejfam]{ltjsarticle} \usepackage{hypdoc} \hypersetup{unicode=true} \begingroup @@ -117,7 +117,8 @@ % \item 標準では\texttt{jfm-ujis.lua}(Lua\TeX-ja標準のメトリック,OTFパッケージのものがベース)を使用します。 % \item \texttt{uplatex}オプション,\texttt{autodetect-engine}オプションを % 削除してあります(前者ではエラーを出すようにしています)。 -% \item \texttt{disablejfam}オプションが無効になっています。もし +% \item \texttt{disablejfam}オプションはクラス側では何もしません(ただLua\TeX-ja本体に +% 渡されるだけです).もし % \begin{quotation} % |! LaTeX Error: Too many math alphabets used in version ****.| % \end{quotation} @@ -188,8 +189,10 @@ % % \section{Lua\TeX-jaの読み込み} % -% まず,Lua\TeX-jaを読み込みます。 +% 和文スケール値を設定した後に,Lua\TeX-jaを読み込みます。 % \begin{macrocode} +%\def\Cjascale{0.924715} +%\def\Cjascale{0.903375} \RequirePackage{luatexja} % \end{macrocode} % @@ -594,10 +597,8 @@ % 実際に使用可能な数式ファミリの数を増やすためには\texttt{lualatex-math}パッケージを % 読み込む必要があることに注意が必要です。 % -% \begin{macrocode} -\DeclareOption{disablejfam}{% - \ClassWarningNoLine{\jsc@clsname}{The class option 'disablejfam' is obsolete}} -% \end{macrocode} +% [2018-10-08 LTJ] Lua\TeX-ja本体が\texttt{disablejfam}オプションをサポートしたので, +% クラスファイルからは削除します. % % \paragraph{ドラフト} % @@ -623,6 +624,8 @@ % % [2016-11-24 LTJ] \texttt{autodetect-engine} はLua\TeX-jaでは意味がないので警告を表示させます. % +% [2018-07-30 LTJ] \texttt{uplatex} 指定時のエラーが正しく表示されなかったので修正しました. +% % \begin{macrocode} \newif\ifmingoth \mingothfalse @@ -631,11 +634,11 @@ \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} @@ -790,9 +793,13 @@ % % [2017-02-17 LTJ] |\directlua|中で出力される数字のカテゴリーコードが12になるようにしました. % この保証をしないと例えば\texttt{listings}パッケージで無限ループになります. +% +% [2018-07-02 LTJ] 10ptオプションが指定されており, +% 実際にはオプティカルサイズの補正が不要なときは「|xreal|オプションは指定されなかった」という +% 扱いにしておきます. % \begin{macrocode} \ifjsc@mag@xreal -\ifdim\jsc@mpt=\p@\else +\ifdim\jsc@mpt=\p@\jsc@mag@xrealfalse\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 @@ -948,9 +955,6 @@ % [2017-12-31] 和文スケール($1\,\mathrm{zw} \div \hbox{要求サイズ}$)を % 表す実数値マクロ |\Cjascale| を定義しました。 % -% \begin{macrocode} -% \def\Cjascale{0.924715} -% \end{macrocode} % % これにより,公称10ポイントの和文フォントを0.924715倍したことにより, % 約9.25ポイント, @@ -961,12 +965,16 @@ % 和文フォントをPostScriptの9ポイントにするために, % $0.9*72.27/72 \simeq 0.903375$ 倍します。 % -% \begin{macrocode} -% \def\Cjascale{0.903375} -% \end{macrocode} +% [2018-09-23 LTJ] 実際の|\Cjascale|の定義はLua\TeX-jaの読み込み前に移動しました. +% こうすることによって「0.962216倍された和文フォント」という実際には使われない和文フォントを +% 読み込む必要がなくなります. +% % % 実際にフォントの再定義を行う部分です. % +% [2018-09-23 LTJ] |\Cjascale|の設定を前倒ししたことに伴い,実際の再定義は +% \texttt{mingoth}, \texttt{ptexjis}のときしか必要なくなりました. +% % \begin{macrocode} \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax \ifmingoth @@ -976,13 +984,8 @@ \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}{} % \end{macrocode} % % 和文でイタリック体,斜体,サンセリフ体, @@ -1049,8 +1052,11 @@ % % \begin{macrocode} \AtBeginDocument{% - \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc} - \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}}% + \unless\ifltj@disablejfam + \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc} + \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt} + \fi +}% % \end{macrocode} % % \begin{macro}{\textsterling} @@ -3397,6 +3403,7 @@ % \end{macro} % % \begin{macro}{\paragraph} +% \begin{macro}{\jsParagraphMark} % % 見出しの後ろで改行されません。 % @@ -3425,6 +3432,7 @@ \fi % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\subparagraph} % @@ -4710,11 +4718,24 @@ % \end{macro} % % \begin{macro}{\@dottedtocline} +% \begin{macro}{\jsTocLine} % % \LaTeX 本体(\texttt{ltsect.dtx} 参照)での定義と同じですが, % |\@tempdima| を |\@lnumwidth| に変えています。 % +% [2018-06-23] デフォルトでは\jsTocLine のようにベースラインになります。\par +% これを変更可能にするため,|\jsTocLine| というマクロに切り出しました。 +% 例えば,仮想ボディの中央 +% {\renewcommand{\jsTocLine}{\leaders \hbox {\hss ・\hss}\hfill}\jsTocLine} +% に変更したい場合は +%\begin{verbatim} +% \renewcommand{\jsTocLine}{\leaders \hbox {\hss ・\hss}\hfill} +%\end{verbatim} +% とします。 +% % \begin{macrocode} +\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 @@ -4724,11 +4745,11 @@ \@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} % \end{macrocode} % \end{macro} +% \end{macro} % % \paragraph{図目次と表目次} % @@ -5579,8 +5600,13 @@ % \paragraph{今日の日付} % % \LaTeX で処理した日付を出力します。 -% |ltjarticle| などと違って,標準を西暦にし,余分な空白が入らないように改良しました。 +% ^^A |jarticle| などと違って,標準を西暦にし, +% ^^A 余分な空白が入らないように改良しました。 +% ^^A -- 2018年7月以降は |jarticle| なども標準が西暦, +% ^^A -- 2019年4月以降は余分な空白が入らなくなっています。 % 和暦にするには |\和暦| と書いてください。 +% ちなみにこの文章の作成日は西暦では{\西暦\today}で, +% 和暦では{\和暦\today}です。 % % \begin{macro}{\today} % \begin{macrocode} @@ -5588,23 +5614,42 @@ \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} % \end{macrocode} % \end{macro} %