summaryrefslogtreecommitdiff
path: root/language/japanese/platex-tools/pxatbegshi.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-02-14 03:00:50 +0000
committerNorbert Preining <norbert@preining.info>2021-02-14 03:00:50 +0000
commit8c6ca435b3bc584eb3efe8e52417fb989e677789 (patch)
tree08bae5450fe9e553e2b28cb984cae56e8d9e0990 /language/japanese/platex-tools/pxatbegshi.sty
parent3d0d4d2ed250339f704c23ea8f24670c70d5981f (diff)
CTAN sync 202102140300
Diffstat (limited to 'language/japanese/platex-tools/pxatbegshi.sty')
-rw-r--r--language/japanese/platex-tools/pxatbegshi.sty39
1 files changed, 26 insertions, 13 deletions
diff --git a/language/japanese/platex-tools/pxatbegshi.sty b/language/japanese/platex-tools/pxatbegshi.sty
index 3c8a830415..856b95eb44 100644
--- a/language/japanese/platex-tools/pxatbegshi.sty
+++ b/language/japanese/platex-tools/pxatbegshi.sty
@@ -30,29 +30,42 @@
%% package declaration
\NeedsTeXFormat{pLaTeX2e}
\ProvidesPackage{pxatbegshi}
- [2020/09/25 v0.7 Patch to atbegshi for (u)pLaTeX]
-
-%% preparations
-\def\pxabgs@pkgname{pxatbegshi}
-\def\pxabgs@warn{\PackageWarningNoLine\pxabgs@pkgname}
-
-%% load it
-\RequirePackage{atbegshi}
+ [2021/02/13 v0.7b Patch to atbegshi for (u)pLaTeX]
%% Since LaTeX2e 2020-10-01, atbegshi.sty is merely
%% an emulation by atbegshi-ltx.sty from ltshipout.dtx.
-%% The new code does NOT define \AtBegShi@Output,
-%% so we can detect it!
-\ifx\AtBegShi@Output\@undefined
- %% pLaTeX2e 2020-10-01 natively supports the situation
- \PackageInfo{pxatbegshi}{This package is no longer needed}
+\chardef\pxabgs@status=\z@
+\ifx\IfHookExistsTF\@undefined\else % >= LaTeX2e 2020-10-01
+ \IfHookExistsTF{shipout/before}{% % >= LaTeX2e 2020-10-01
+ \chardef\pxabgs@status=\@ne
+ }{}
+\fi
+\ifnum\pxabgs@status=\@ne
+ % if LaTeX2e and pLaTeX2e are inconsistent, raise an error!
+ \@ifl@t@r\pfmtversion{2020/10/01}{%
+ \PackageInfo{pxatbegshi}{This package is no longer needed}%
+ }{%
+ \PackageError{pxatbegshi}{Inconsistent LaTeX2e/pLaTeX2e combination}\@ehc
+ }%
+ \RequirePackage{atbegshi}% input anyway
\expandafter\endinput
\fi
%% The rest of this package is meant for
%% LaTeX2e 2020-02-02 PL5 or older.
+\RequirePackage{atbegshi}
+
+\ifx\AtBegShi@Output\@undefined
+ \PackageError{pxatbegshi}{This should not happen}\@ehc
+ \expandafter\endinput
+\fi
+
+%% preparations
+\def\pxabgs@pkgname{pxatbegshi}
+\def\pxabgs@warn{\PackageWarningNoLine\pxabgs@pkgname}
+
%% internal macros are locally effective
\begingroup