From d585ac5e31d316918ef296d56105b164c2e0b65b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 30 Sep 2020 21:25:54 +0000
Subject: platex (30sep20)

git-svn-id: svn://tug.org/texlive/trunk@56486 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/platex/base/platexrelease.sty   | 252 ++++++++++++++++-----
 1 file changed, 200 insertions(+), 52 deletions(-)

(limited to 'Master/texmf-dist/tex/platex/base/platexrelease.sty')

diff --git a/Master/texmf-dist/tex/platex/base/platexrelease.sty b/Master/texmf-dist/tex/platex/base/platexrelease.sty
index 4199b306e55..95f5ee2d122 100644
--- a/Master/texmf-dist/tex/platex/base/platexrelease.sty
+++ b/Master/texmf-dist/tex/platex/base/platexrelease.sty
@@ -6,19 +6,20 @@
 %%
 %% plvers.dtx  (with options: `platexrelease')
 %% platexrelease.dtx  (with options: `platexrelease')
+%% plexpl3.dtx  (with options: `platexrelease')
 %% plfonts.dtx  (with options: `platexrelease')
 %% plcore.dtx  (with options: `platexrelease')
 %% 
-%% Copyright (c) 2016-2018 Japanese TeX Development Community
+%% Copyright (c) 2016-2020 Japanese TeX Development Community
 %% 
 %% This file is part of the pLaTeX2e system (community edition).
 %% -------------------------------------------------------------
 %% 
 %% File: plvers.dtx
 \edef\p@known@latexreleaseversion
-   {2020-02-02}
+   {2020-10-01}
 \edef\platexreleaseversion
-   {2020-04-12}
+   {2020-10-01}
 \newif\if@plincludeinrelease
 \@plincludeinreleasefalse
 \def\plIncludeInRelease#1{%
@@ -202,6 +203,15 @@ of this package available from CTAN}
 \plIncludeInRelease{0000/00/00}{\PackageWarning}{pLaTeX Info}%
   % * <2006/11/10>
 \plEndIncludeInRelease
+%% File: plexpl3.dtx
+\plIncludeInRelease{2020/10/01}%
+                   {plexpl3}{Pre-load plexpl3}%
+\RequirePackage{plexpl3}
+\plEndIncludeInRelease
+\plIncludeInRelease{0000/00/00}%
+                   {plexpl3}{Not loading plexpl3}%
+% Nothing to do
+\plEndIncludeInRelease
 %% File: plfonts.dtx
 \plIncludeInRelease{2020/04/12}{\inlist@}
                    {Detokenize}%
@@ -1224,6 +1234,7 @@ of this package available from CTAN}
 \plEndIncludeInRelease
 \plIncludeInRelease{2020/04/12}{\normalfont}
                    {Use \@defaultfamilyhook}%
+\ifx\AddToHook\@undefined % --- for 2020-02-02 or older BEGIN
 \ifx\@defaultfamilyhook\@undefined  % old
 \DeclareRobustCommand\normalfont{%
     \kanjiencoding{\kanjiencodingdefault}%
@@ -1249,7 +1260,23 @@ of this package available from CTAN}
     \edef\k@series{\kanjiseriesdefault}%
     \edef\k@shape{\kanjishapedefault}%
 }
-\fi
+\fi                                 % done
+\else % --- for 2020-02-02 or older END & for 2020-10-01 BEGIN
+\DeclareRobustCommand\normalfont{%
+   \fontencoding\encodingdefault
+   \edef\f@family{\familydefault}%
+   \edef\f@series{\seriesdefault}%
+   \edef\f@shape{\shapedefault}%
+   \UseHook{normalfont}%
+   \@defaultfamilyhook        % hookname from 2020/02 will vanish
+   \selectfont}
+\AddToHook{normalfont}{%
+    \kanjiencoding{\kanjiencodingdefault}%
+    \edef\k@family{\kanjifamilydefault}%
+    \edef\k@series{\kanjiseriesdefault}%
+    \edef\k@shape{\kanjishapedefault}%
+}
+\fi % --- for 2020-10-01 END
 \adjustbaseline
 \let\reset@font\normalfont
 \plEndIncludeInRelease
@@ -1294,68 +1321,80 @@ of this package available from CTAN}
 \edef\mdseries@mc{\mddefault}% m
 \edef\mdseries@gt{\mddefault}% m
 \fi
-\ifx\expand@font@defaults\@undefined\else  % 2020-02-02
+\ifx\expand@font@defaults\@undefined\else %<*2020-02-02|2020-10-01>
+\ifx\AddToHook\@undefined % --- for 2020-02-02 BEGIN
 \g@addto@macro\expand@font@defaults{%
   \edef\mcdef@ult{\mcdefault}%
   \edef\gtdef@ult{\gtdefault}%
   \edef\kanjidef@ult{\kanjifamilydefault}%
 }
-\fi
-\ifx\bfseries@rm\@undefined  % old
-\let\pltx@fontseries@saved\@undefined
-\let\pltx@patch@bfseries\@undefined
-\let\pltx@patch@mdseries\@undefined
-\else                        % 2020-02-02
-\let\pltx@fontseries@saved\fontseries
-\def\pltx@patch@bfseries\not@math@alphabet#1#2#3\selectfont{%
- \long\expandafter\def\csname bfseries \endcsname{%
-  \not@math@alphabet#1#2% should be \bfseries\mathbf
-  % \fontseries of pLaTeX tries to change both Latin and Japanese;
-  % here we want only Latin, so use \romanseries
-  \let\fontseries\romanseries
-  #3% contains \fontseries and \@setbfseriesdefaultshook
-  \let\fontseries\pltx@fontseries@saved % recover
+\else % --- for 2020-02-02 END & for 2020-10-01 BEGIN
+\AddToHook{expand@font@defaults}{%
+  \edef\mcdef@ult{\mcdefault}%
+  \edef\gtdef@ult{\gtdefault}%
+ %\edef\kanjidef@ult{\kanjifamilydefault}% !! sync with 2020/04/13 v3.1n
+}
+\fi % --- for 2020-10-01 END
+\fi %</2020-02-02|2020-10-01>
+\ifx\bfseries@rm\@undefined\else %<*2020-02-02|2020-10-01>
+\ifx\AddToHook\@undefined % --- for 2020-02-02 BEGIN
+\DeclareRobustCommand\bfseries{%
+  \not@math@alphabet\bfseries\mathbf
+  \expand@font@defaults
+  % changed \fontseries -> \romanseries
+    \ifx\f@family\rmdef@ult      \romanseries\bfseries@rm
+    \else\ifx\f@family\sfdef@ult \romanseries\bfseries@sf
+    \else\ifx\f@family\ttdef@ult \romanseries\bfseries@tt
+    \else                        \romanseries\bfdefault
+    \fi\fi\fi
   % changed \fontseries -> \kanjiseries
     \ifx\k@family\mcdef@ult      \kanjiseries\bfseries@mc
     \else\ifx\k@family\gtdef@ult \kanjiseries\bfseries@gt
     \else                        \kanjiseries\bfdefault
     \fi\fi
   \selectfont
- }%
 }
-\ifx\@setbfseriesdefaultshook\@undefined\else
-\g@addto@macro\@setbfseriesdefaultshook{%
-    \let\bfseries@mc\bfdef@ult
-    \let\bfseries@gt\bfdef@ult
-}
-\fi
-\expandafter\expandafter\expandafter
-  \pltx@patch@bfseries\csname bfseries \endcsname
-\def\pltx@patch@mdseries\not@math@alphabet#1#2#3\selectfont{%
- \long\expandafter\def\csname mdseries \endcsname{%
-  \not@math@alphabet#1#2% should be \mdseries\relax
-  % \fontseries of pLaTeX tries to change both Latin and Japanese;
-  % here we want only Latin, so use \romanseries
-  \let\fontseries\romanseries
-  #3% contains \fontseries and \@setmdseriesdefaultshook
-  \let\fontseries\pltx@fontseries@saved % recover
+\DeclareRobustCommand\mdseries{%
+  \not@math@alphabet\mdseries\relax
+  \expand@font@defaults
+  % changed \fontseries -> \romanseries
+    \ifx\f@family\rmdef@ult      \romanseries\mdseries@rm
+    \else\ifx\f@family\sfdef@ult \romanseries\mdseries@sf
+    \else\ifx\f@family\ttdef@ult \romanseries\mdseries@tt
+    \else                        \romanseries\mddefault
+    \fi\fi\fi
   % changed \fontseries -> \kanjiseries
     \ifx\k@family\mcdef@ult      \kanjiseries\mdseries@mc
     \else\ifx\k@family\gtdef@ult \kanjiseries\mdseries@gt
     \else                        \kanjiseries\mddefault
     \fi\fi
   \selectfont
- }%
 }
-\ifx\@setmdseriesdefaultshook\@undefined\else
-\g@addto@macro\@setmdseriesdefaultshook{%
+\else % --- for 2020-02-02 END & for 2020-10-01 BEGIN
+\AddToHook{bfseries/defaults}{%
+    \let\bfseries@mc\bfdef@ult
+    \let\bfseries@gt\bfdef@ult
+}
+\AddToHook{bfseries}{%
+  % changed \fontseries -> \kanjiseries
+    \ifx\k@family\mcdef@ult      \kanjiseries\bfseries@mc
+    \else\ifx\k@family\gtdef@ult \kanjiseries\bfseries@gt
+    \else                        \kanjiseries\bfdefault
+    \fi\fi
+}
+\AddToHook{mdseries/defaults}{%
     \let\mdseries@mc\mddef@ult
     \let\mdseries@gt\mddef@ult
 }
-\fi
-\expandafter\expandafter\expandafter
-  \pltx@patch@mdseries\csname mdseries \endcsname
-\fi
+\AddToHook{mdseries}{%
+  % changed \fontseries -> \kanjiseries
+    \ifx\k@family\mcdef@ult      \kanjiseries\mdseries@mc
+    \else\ifx\k@family\gtdef@ult \kanjiseries\mdseries@gt
+    \else                        \kanjiseries\mddefault
+    \fi\fi
+}
+\fi % --- for 2020-10-01 END
+\fi %</2020-02-02|2020-10-01>
 \ifx\prepare@family@series@update\@undefined  % old
 \let\prepare@family@series@update@kanji\@undefined
 \let\@meta@family@list@kanji\@undefined
@@ -1435,13 +1474,32 @@ of this package available from CTAN}
   \fi
 }
 \fi
-\expandafter\ifx\csname init@series@setup\endcsname\relax\else  % 2020-02-02
+\expandafter\ifx\csname init@series@setup\endcsname\relax
+\else   %<*2020-02-02|2020-10-01>
+\ifx\AddToHook\@undefined % --- for 2020-02-02 BEGIN
 \g@addto@macro\init@series@setup{%
   \ifx\kanjidef@ult\mcdef@ult      \mcfamily
   \else\ifx\kanjidef@ult\gtdef@ult \gtfamily
   \fi\fi
 }%
-\fi
+\else % --- for 2020-02-02 END & for 2020-10-01 BEGIN
+\g@addto@macro\init@series@setup{%
+  % !! sync with 2020/04/13 v3.1n BEGIN
+  \ifx\kanjiseriesdefault\kanjiseriesdefault@kernel
+    \mdseries
+    \let\kanjiseriesdefault\k@series
+  \fi
+  % !! sync with 2020/04/13 v3.1n END
+}%
+\fi % --- for 2020-10-01 END
+\fi     %</2020-02-02|2020-10-01>
+\ifx\AddToHook\@undefined
+\else % --- for LaTeX2e 2020-10-01 or later BEGIN
+\def\code@after@pldefs{%
+\expandafter\def\expandafter\kanjiseriesdefault
+  \expandafter{\kanjiseriesdefault\@empty}
+\let\kanjiseriesdefault@kernel\kanjiseriesdefault}
+\fi   % --- for LaTeX2e 2020-10-01 or later END
 \ifx\prepare@family@series@update@kanji\@undefined  % old
 \DeclareRobustCommand\mcfamily
         {\not@math@alphabet\mcfamily\mathmc
@@ -2231,6 +2289,36 @@ of this package available from CTAN}
    \global \maxdepth \@maxdepth
 }
 \plEndIncludeInRelease
+\plIncludeInRelease{2020/10/01}{\@vtryfc}
+                               {Empty float}%
+\def\@vtryfc #1{%
+  \global\setbox\@outputbox\vbox{\ifydir\else\hskip\z@\fi}%
+  \let\@elt\@wtryfc
+  \@flsucceed
+  \global\setbox\@outputbox \vbox to\@colht{%
+    \vskip \@fptop
+    \vskip -\@fpsep
+    \unvbox \@outputbox
+    \vskip \@fpbot}%
+  \let\@elt\relax
+  \xdef #1{\@failedlist\@flfail}%
+  \xdef\@freelist{\@freelist\@flsucceed}}
+\plEndIncludeInRelease
+\plIncludeInRelease{0000/00/00}{\@vtryfc}
+                               {LaTeX2e original}%
+\def\@vtryfc #1{%
+  \global\setbox\@outputbox\vbox{}%
+  \let\@elt\@wtryfc
+  \@flsucceed
+  \global\setbox\@outputbox \vbox to\@colht{%
+    \vskip \@fptop
+    \vskip -\@fpsep
+    \unvbox \@outputbox
+    \vskip \@fpbot}%
+  \let\@elt\relax
+  \xdef #1{\@failedlist\@flfail}%
+  \xdef\@freelist{\@freelist\@flsucceed}}
+\plEndIncludeInRelease
 \plIncludeInRelease{2018/05/20}{\@tombowbleed}{Macro added}%
 \def\@tombowbleed{3mm}
 \plEndIncludeInRelease
@@ -2627,29 +2715,89 @@ of this package available from CTAN}
   \let\firstmark\botmark
 }
 \plEndIncludeInRelease
+\plIncludeInRelease{2020/10/01}{\AtBeginDvi}
+                   {Adapt to new shipout code}%
+\chardef\pltx@AtBeginDvi@untouched\z@
+\ifdefined\ExplSyntaxOn %--- expl3 available BEGIN
+\ExplSyntaxOn
+\if_cs_exist:N \__shipout_add_firstpage_material:Nn
+  \chardef\pltx@AtBeginDvi@untouched\@ne
+\DeclareRobustCommand \AtBeginDvi
+  {\__shipout_add_firstpage_material:Nn \AtBeginDvi}
+\fi:
+\ExplSyntaxOff
+\fi                     %--- expl3 available END
+\ifnum\pltx@AtBeginDvi@untouched>\z@\else
+\DeclareRobustCommand \AtBeginDvi [1]{%
+  \global \setbox \@begindvibox
+    \vbox{\yoko \unvbox \@begindvibox #1}}%
+\fi
+\let\pltx@AtBeginDvi@untouched\@undefined
+\plEndIncludeInRelease
 \plIncludeInRelease{2019/10/01}{\AtBeginDvi}
                    {Make robust}%
 \DeclareRobustCommand \AtBeginDvi [1]{%
   \global \setbox \@begindvibox
-    \vbox{\yoko \unvbox \@begindvibox #1}%
-}
+    \vbox{\yoko \unvbox \@begindvibox #1}}
 \plEndIncludeInRelease
 \plIncludeInRelease{2016/07/01}{\AtBeginDvi}
                    {Fix for incompatible direction}%
 \def \AtBeginDvi #1{%
   \global \setbox \@begindvibox
-    \vbox{\yoko \unvbox \@begindvibox #1}%
-}
+    \vbox{\yoko \unvbox \@begindvibox #1}}
 \expandafter \let \csname AtBeginDvi \endcsname \@undefined
 \plEndIncludeInRelease
 \plIncludeInRelease{0000/00/00}{\AtBeginDvi}
                    {LaTeX2e original}%
 \def \AtBeginDvi #1{%
   \global \setbox \@begindvibox
-    \vbox{\unvbox \@begindvibox #1}%
-}
+    \vbox{\unvbox \@begindvibox #1}}
 \expandafter \let \csname AtBeginDvi \endcsname \@undefined
 \plEndIncludeInRelease
+\plIncludeInRelease{2020/10/01}{\__shipout_execute_cont:}
+                   {Adapt to new shipout code}%
+\ifdefined\ExplSyntaxOn %--- expl3 available BEGIN
+\ExplSyntaxOn
+\if_cs_exist:N \__shipout_execute_cont:
+\cs_new_eq:NN \__platex_original_shipout_execute_cont: \__shipout_execute_cont:
+\box_new:N \l__platex_shipout_dummy_box
+\cs_set:Npn \__shipout_execute_cont:
+  {
+    % if \l_shipout_box is not a \yoko-box (= horizontal writing),
+    % then make it a \yoko-box behorehand.
+    \platex_if_box_yoko:NF \l_shipout_box {
+      \vbox_set:Nn \l_shipout_box
+        {
+            \platex_direction_yoko:
+            \box_use:N \l_shipout_box
+        }
+    }
+    % if the current direction is not \yoko,
+    % then enclose \__shipout_execute_cont: with
+    % a dummy \yoko-box named \l__platex_shipout_dummy_box.
+    \platex_if_direction_yoko:TF {
+      \__platex_original_shipout_execute_cont:
+    }{
+      \vbox_set:Nn \l__platex_shipout_dummy_box
+        {
+          \platex_direction_yoko:
+          \__platex_original_shipout_execute_cont:
+        }
+      % [Limitation] the code above may discard some contents,
+      % so we'd like to put it back by \box\l__platex_shipout_dummy_box.
+      % however, an infinite loop occurs if we uncomment the line below
+      % so we can't.
+      %\box_use:N \l__platex_shipout_dummy_box
+    }
+  }
+\fi:
+\ExplSyntaxOff
+\fi                     %--- expl3 available END
+\plEndIncludeInRelease
+\plIncludeInRelease{0000/00/00}{\__shipout_execute_cont:}
+                   {LaTeX2e original}%
+% do nothing
+\plEndIncludeInRelease
 \plIncludeInRelease{2016/04/17}{\@makefnmark}
                    {Remove extra \xkanjiskip}%
 \renewcommand\@makefnmark{%
-- 
cgit v1.2.3

