diff options
Diffstat (limited to 'Master/texmf-dist/source/uplatex/base/uplvers.dtx')
-rw-r--r-- | Master/texmf-dist/source/uplatex/base/uplvers.dtx | 131 |
1 files changed, 87 insertions, 44 deletions
diff --git a/Master/texmf-dist/source/uplatex/base/uplvers.dtx b/Master/texmf-dist/source/uplatex/base/uplvers.dtx index 42eb8dd2bcb..376ba57e83d 100644 --- a/Master/texmf-dist/source/uplatex/base/uplvers.dtx +++ b/Master/texmf-dist/source/uplatex/base/uplvers.dtx @@ -71,12 +71,19 @@ % \changes{v1.1c-u01}{2017/05/04}{p\LaTeX{}の変更に追随。} % \changes{v1.1d}{2017/09/24}{パッチレベルが負の数の場合をpre-release扱いへ} % \changes{v1.1d-u01}{2017/09/24}{p\LaTeX{}の変更に追随。} +% \changes{v1.1e}{2017/11/09}{\file{latexrelease}と +% \cs{platexrelease}のエミュレート内部処理を分離} +% \changes{v1.1f}{2017/11/11}{\LaTeX{}のバナーを保存するコードを +% \file{platex.ltx}から\file{plcore.ltx}へ移動} +% \changes{v1.1g}{2017/12/04}{\pLaTeX{}のバナーの定義時に +% \cs{pfmtname}, \cs{pfmtversion}, \cs{ppatch@level}を展開しないように} +% \changes{v1.1g-u01}{2017/12/04}{p\LaTeX{}の変更に追随。} % \fi % % \iffalse %<*driver> % \fi -\ProvidesFile{uplvers.dtx}[2017/09/24 v1.1d-u01 upLaTeX Kernel (Version Info)] +\ProvidesFile{uplvers.dtx}[2017/12/04 v1.1g-u01 upLaTeX Kernel (Version Info)] % \iffalse \documentclass{jltxdoc} \GetFileInfo{uplvers.dtx} @@ -90,10 +97,9 @@ %</driver> % \fi % -% \section{バージョンの設定} +% \section{up\LaTeXe{}のバージョンの設定} % まず、このディストリビューションでのup\LaTeXe{}の日付とバージョン番号 -% を定義します。また、up\LaTeXe{}が起動されたときに表示される文字列の -% 設定もします。 +% を定義します。 % % \changes{v1.0}{1995/05/16}{p\LaTeXe\ 用に\file{ltvers.dtx}を修正} % \changes{v1.0a}{1995/08/30}{\LaTeX\ \texttt{!<1995/06/01!>}版用に修正} @@ -145,13 +151,60 @@ {2017/10/28u01} %</plcore|platexrelease> %<*plcore> -\def\ppatch@level{2} +\def\ppatch@level{3} %</plcore> % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % +% \subsection{\LaTeXe{}のバージョンの取得} +% このファイルの直前で\LaTeXe{}の\file{latex.ltx}が読み込まれているはず +% なので、その起動時のバナーを保存します。 +% +% 2016/05/07の実装では、\file{platex.ltx}のなかで +%\begin{verbatim} +% \edef\platexBANNER{\the\everyjob} +%\end{verbatim} +% としてバナーを保存し、この内容が +%\begin{verbatim} +% \typeout{LaTeX2e version}\typeout{Babel version} +%\end{verbatim} +% という4つのトークンから成ると仮定して、\file{plcore.ltx}のなかで +%\begin{verbatim} +% \def\parse@@BANNER#1#2#3#4{#2} +%\end{verbatim} +% のようにパースしていました。ところが、この「4つのトークンから成る」と +% いう仮定はBabel由来の\file{hyphen.cfg}を使用した場合のみ成り立ち、 +% それ以外の特別な\file{hyphen.cfg}や\file{hyphen.ltx}を使用した場合に +% エラーになってしまいます。 +% そこで、新たに2016/09/14の実装では、\file{platex.ltx}のなかで +%\begin{verbatim} +% \edef\platexBANNER{\the\everyjob\noexpand\typeout{}\relax} +%\end{verbatim} +% としてダミーを追加します(|\relax|はただの区切りトークンの役割)。 +% こうすると、|\platexBANNER|の内容は、Babelの\file{hyphen.cfg}のとき +%\begin{verbatim} +% \typeout{LaTeX2e version}\typeout{Babel version}\typeout{}\relax +%\end{verbatim} +% となり、それ以外のとき +%\begin{verbatim} +% \typeout{LaTeX2e version}\typeout{}\relax +%\end{verbatim} +% となるはずです。このように、少なくとも|\typeout|が2回含まれています +% ので、\file{plcore.ltx}のなかで +%\begin{verbatim} +% \def\parse@@BANNER\typeout#1\typeout#2#3\relax{#1} +%\end{verbatim} +% とパースすることができるようになります。 +% \changes{v1.1f}{2017/11/11}{\LaTeX{}のバナーを保存するコードを +% \file{platex.ltx}から\file{plcore.ltx}へ移動} +% \begin{macrocode} +%<*plcore> +\edef\platexBANNER{\the\everyjob\noexpand\typeout{}\relax}% save LaTeX banner +%</plcore> +% \end{macrocode} +% % \subsection{\LaTeX~2.09互換モードの抑制} % % \begin{macro}{\documentstyle} @@ -173,6 +226,7 @@ New documents should use Standard LaTeX conventions, and start\MessageBreak with the \noexpand\documentclass command.}% \documentclass} +%</plfinal> % \end{macrocode} % \end{macro} % @@ -184,6 +238,7 @@ % パッチファイルをロードするコードはコメントアウトしました。 % \changes{v1.0v}{2016/05/07}{パッチファイルをロードするのをやめた。} % \begin{macrocode} +%<*plfinal> %\IfFileExists{uplpatch.ltx} % {\typeout{************************************^^J% % * Appliying patch file uplpatch.ltx *^^J% @@ -221,18 +276,16 @@ % \subsection{起動時に表示するバナー} % % \begin{macro}{\everyjob} -% 起動時に表示される文字列です。 -% \LaTeX{}にパッチがあてられている場合は、それも表示します。 -% -%\iffalse -% この実装については\file{uplatex.dtx}のコメントを参照。(2016/09/14) -%\fi +% up\LaTeXe{}が起動されたときに表示される文字列です。 +% \LaTeXe{}のバージョンも併せて表示します。 % % \changes{v1.0v}{2016/05/07}{起動時の文字列を最新の\LaTeX{}に合わせた。} % \changes{v1.0w}{2016/05/12}{起動時の文字列に入れる\LaTeX{}のバージョンを % 元の\LaTeX{}のバナーから引き継ぐように改良} % \changes{v1.1}{2016/09/14}{起動時のバナーを取得するコードを改良} % \changes{v1.1d}{2017/09/24}{パッチレベルが負の数の場合をpre-release扱いへ} +% \changes{v1.1g}{2017/12/04}{\pLaTeX{}のバナーの定義時に +% \cs{pfmtname}, \cs{pfmtversion}, \cs{ppatch@level}を展開しないように} % \begin{macrocode} \ifx\patch@level\@undefined % fallback if undefined in LaTeX \def\patch@level{0}\fi @@ -240,23 +293,19 @@ \def\ppatch@level{0}\fi \begingroup \def\parse@@BANNER\typeout#1\typeout#2#3\relax{#1} - \edef\platexTMP{% - \ifnum\ppatch@level=0 - \everyjob{\noexpand\typeout{% - \pfmtname\space<\pfmtversion>\space - (based on \expandafter\parse@@BANNER\platexBANNER)}}% - \else\ifnum\ppatch@level>0 - \everyjob{\noexpand\typeout{% - \pfmtname\space<\pfmtversion>+\ppatch@level\space - (based on \expandafter\parse@@BANNER\platexBANNER)}}% - \else - \everyjob{\noexpand\typeout{% - \pfmtname\space<\pfmtversion>-pre\ppatch@level\space - (based on \expandafter\parse@@BANNER\platexBANNER)}}% - \fi\fi - } -\expandafter -\endgroup \platexTMP + \toks0=\expandafter\expandafter\expandafter{% + \expandafter\parse@@BANNER\platexBANNER} + \ifnum\ppatch@level=0 + \toks2={\pfmtname\space<\pfmtversion>\space}% + \else\ifnum\ppatch@level>0 + \toks2={\pfmtname\space<\pfmtversion>+\ppatch@level\space}% + \else + \toks2={\pfmtname\space<\pfmtversion>-pre\ppatch@level\space}% + \fi\fi + \edef\platexBANNER{\the\toks2 (based on \the\toks0)} + \global\everyjob\expandafter{% + \expandafter\typeout\expandafter{\platexBANNER}}% +\endgroup % \end{macrocode} % % p\LaTeX{}やup\LaTeX{}は、独自のハイフネーション・パターンを定義していません。 @@ -265,25 +314,17 @@ % \file{hyphen.cfg}のバージョンを反映します(Babelパッケージの % \file{hyphen.cfg}でない場合は、何も表示されず空行になるはずです)。 % -%\iffalse -% この実装については\file{uplatex.dtx}のコメントを参照。(2016/09/14) -%\fi -% % \changes{v1.0w-u00}{2016/05/12}{起動時の文字列に入れるBabelのバージョンを % 元の\LaTeX{}のバナーから取得するコードを\file{uplatex.ini}から取り入れた} % \begin{macrocode} \begingroup \def\parse@@BANNER\typeout#1\typeout#2#3\relax{#2} - \edef\platexTMP{% - \the\everyjob\noexpand\typeout{\expandafter\parse@@BANNER\platexBANNER}% - } - \everyjob=\expandafter{\platexTMP}% - \edef\platexTMP{% - \noexpand\let\noexpand\platexBANNER=\noexpand\@undefined - \noexpand\everyjob={\the\everyjob}% - } - \expandafter -\endgroup \platexTMP + \toks0=\expandafter\expandafter\expandafter{% + \expandafter\parse@@BANNER\platexBANNER} + \edef\platexBANNER{\the\everyjob \noexpand\typeout{\the\toks0}} + \global\everyjob\expandafter{\platexBANNER}% +\endgroup +\let\platexBANNER=\@undefined %</plfinal> % \end{macrocode} % \end{macro} @@ -334,6 +375,8 @@ % \begin{macro}{\plIncludeInRelease} % \changes{v1.0t}{2016/02/03}{\cs{plIncludeInRelease}と % \cs{plEndIncludeInRelease}を新設。} +% \changes{v1.1e}{2017/11/09}{\file{latexrelease}と +% \cs{platexrelease}のエミュレート内部処理を分離} % \begin{macrocode} %<*plcore|platexrelease> \def\plIncludeInRelease#1{\kernel@ifnextchar[% @@ -348,14 +391,14 @@ % \begin{macrocode} \def\@plIncludeInRele@se#1#2#3{% \toks@{[#1] #3}% - \expandafter\ifx\csname\string#2+\@currname+IIR\endcsname\relax + \expandafter\ifx\csname\string#2+\@currname+plIIR\endcsname\relax \ifnum\expandafter\@parse@version#1//00\@nil >\expandafter\@parse@version\pfmtversion//00\@nil \GenericInfo{}{Skipping: \the\toks@}% \expandafter\expandafter\expandafter\@gobble@plIncludeInRelease \else \GenericInfo{}{Applying: \the\toks@}% - \expandafter\let\csname\string#2+\@currname+IIR\endcsname\@empty + \expandafter\let\csname\string#2+\@currname+plIIR\endcsname\@empty \fi \else \GenericInfo{}{Already applied: \the\toks@}% |