texjporg / platex

pLaTeX community edition
BSD 3-Clause "New" or "Revised" License
49 stars 8 forks source link

\everyjob and (u)platex-dev #100

Closed h-kitagawa closed 1 year ago

h-kitagawa commented 1 year ago

Karl さんからのメールによると,pLaTeX バナーを出力するための \everyjob ハックが latex-dev 2023-06-01 pre-release 1 からうまくいかなくなるようです:

I hope the LaTeX people have already sent you many more details, but the
latest latex-dev release breaks platex-dev (engine eptex) and
uplatex-dev (engine euptex). Thus I've had to disable them temporarily
so the TL build could go through.

Apparently you have to change something on your side. Frank said:

> platex is hooking in a very low-level way into the \everyjob to add its 
> own banner and that fails now.

Here's the error from the TL build:

$ euptex -ini   -jobname=uplatex-dev -progname=uplatex-dev *uplatex.ini
This is e-upTeX, Version 3.141592653-p4.0.0-u1.28-220214-2.6 (utf8.uptex) (TeX Live 2022) (INITEX)
.. many lines omitted ...
(/home/ftp/tlnet-trial-221204-6866/tlinst.try/2022/texmf-dist/tex/platex/base/p
lcore.ltx
! Argument of \platexNILa has an extra }.
<inserted text> 
                \par 
l.52 ...ter\expandafter\expandafter{\platexBANNER}
                                                  %
? 
! Emergency stop.
<inserted text> 
                \par 
l.52 ...ter\expandafter\expandafter{\platexBANNER}
                                                  %
h-kitagawa commented 1 year ago

LaTeX 2023-06-01 pre1 の \everyjob を見ると,起動時のバナーは \LaTeXReleaseInfo というトークンレジスタに

\show@release@info {\fmtname \space <\fmtversion > ... }

という形式で保存される(ltvers.dtx のコミット)なので,この内容を書き換える方針で作ってみました.

--- /opt/texlive/2022/texmf-dist/tex/platex/base/plcore.ltx 2021-12-12 06:17:48.000000000 +0900
+++ plcore.ltx  2022-12-05 08:10:37.264901737 +0900
@@ -36,9 +36,6 @@
 \def\pfmtversion
    {2021-11-15}
 \def\ppatch@level{0}
-\edef\platexBANNER{\noexpand\platexNILa
-                   \the\everyjob % LaTeX banner and delayed codes
-                   \noexpand\platexNILb}
 \begingroup
   \ifnum\ppatch@level=0
     \toks2={\pfmtname\space<\pfmtversion>\space}%
@@ -47,11 +44,20 @@
   \else
     \toks2={\pfmtname\space<\pfmtversion>-pre\ppatch@level\space}%
   \fi\fi
-  \edef\platexNILa#1\typeout#2#3\platexNILb{%
-    #1\noexpand\typeout{\the\toks2 (based on #2)}#3}
-  \global\everyjob\expandafter\expandafter\expandafter{\platexBANNER}%
+  \ifdefined\LaTeXReleaseInfo % 2023-06-01
+    \edef\platexNILa#1\show@release@info#2#3\platexNILb{%
+      #1\noexpand\show@release@info{\the\toks2 (based on #2)}#3}%
+    \global\LaTeXReleaseInfo\expandafter\expandafter\expandafter{%
+      \expandafter\platexNILa\the\LaTeXReleaseInfo\platexNILb}
+  \else % 2022-11-15
+    \edef\platexBANNER{\noexpand\platexNILa
+                       \the\everyjob % LaTeX banner and delayed codes
+                       \noexpand\platexNILb}
+    \edef\platexNILa#1\typeout#2#3\platexNILb{%
+      #1\noexpand\typeout{\the\toks2 (based on #2)}#3}
+    \global\everyjob\expandafter\expandafter\expandafter{\platexBANNER}%
+  \fi
 \endgroup
-\let\platexBANNER=\@undefined
 \chardef\pltx@newhook@avail=\z@
 \@ifl@t@r\fmtversion{2020/10/01}{\chardef\pltx@newhook@avail=\@ne}{}
 \newif\if@plincludeinrelease
FrankMittelbach commented 1 year ago

Would it not be simpler to avoid taking the LaTeX release info apart but simply add the banner in front into the \LaTeXReleaseInfo toks? e.g., coming out like

  platex-BANNER  
  based on
  original-LaTeXReleaseInfo

without the attempt to find something like \show@release@info which is an internal implementation detail and thus might change. The above could be done easily by augmenting the toks.

aminophen commented 1 year ago

@h-kitagawa ありがとうございます。反映して本日リリースします。plvers.dtx は v1.2a にしました。