summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-09-30 21:28:23 +0000
committerKarl Berry <karl@freefriends.org>2020-09-30 21:28:23 +0000
commitacc0e369555df911c4c094eb7d39c1936b3ea4fd (patch)
treed86761edd60e66a00625431fb56458fa4bff7b7b /Master/texmf-dist/tex/latex
parent3d72ca06ea45a25c546b1753f93ab5021e988326 (diff)
bxpapersize (30sep20)
git-svn-id: svn://tug.org/texlive/trunk@56491 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty33
1 files changed, 30 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty b/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty
index 4fe8782cfc6..b91e56384c7 100644
--- a/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty
+++ b/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty
@@ -1,7 +1,7 @@
%%
%% This is file 'bxpapersize.sty'.
-%%
-%% Copyright (c) 2019 Takayuki YATO (aka. "ZR")
+%%
+%% Copyright (c) 2016-2020 Takayuki YATO (aka. "ZR")
%% GitHub: https://github.com/zr-tex8r
%% Twitter: @zr_tex8r
%%
@@ -10,7 +10,7 @@
%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxpapersize}[2019/10/05 v0.4]
+\ProvidesPackage{bxpapersize}[2020/10/01 v0.5]
%% preparation
\def\bxpr@pkgname{bxpapersize}
@@ -63,6 +63,15 @@
%% unique tokens
\def\bxpr@end{\bxpr@end@}
+%% switch 'bxpr@new@hook@system'
+% Whether the new hook management system is present.
+\newif\ifbxpr@new@hook@system
+\ifx\AddToHook\@undefined\else
+ \PackageInfo\bxpr@pkgname
+ {Detected the new LaTeX kernel (2020-10-01)\@gobble}
+ \bxpr@new@hook@systemtrue
+\fi
+
%% \bxpr@pagewidth / \bxpr@pageheight
%% \bxpr@horigin / \bxpr@vorigin
\ifluatex % LuaTeX
@@ -280,6 +289,15 @@
% if priority is not middle...
\ifnum\bxpr@priority=\bxpr@priority@@default\else
+\ifbxpr@new@hook@system %----
+ \PackageWarningNoLine\bxpr@pkgname
+ {!!!!!!!!!! WARNING !!!!!!!!!!\MessageBreak
+ You use the new LaTeX kernel (2020-10-01)!\MessageBreak
+ Unfortunately, priority setting is not yet\MessageBreak
+ available on the new kernel, and thus\MessageBreak
+ will be ignored}
+ \let\bxpr@priority\bxpr@priority@@default
+\else %----
\ifcase\bxpr@mode % dvi
\ifptex
\RequirePackage{pxatbegshi}[]
@@ -288,6 +306,7 @@
\PackageWarningNoLine\bxpr@pkgname
{The priority setting will be ignored in PDF mdoe}
\fi
+\fi %----
\fi
%--------------------------------------- page hook
@@ -296,19 +315,27 @@
% Placed at the head of the begin-docuemnt hook.
\@onlypreamble\bxpr@begindoc@first@hook
\let\bxpr@begindoc@first@hook\@empty
+\ifbxpr@new@hook@system %----
+\AddToHook{begindocument/before}{\bxpr@begindoc@first@hook}
+\else %----
\begingroup
\toks@\expandafter{\@begindocumenthook}
\xdef\@begindocumenthook{%
\noexpand\bxpr@begindoc@first@hook
\the\toks@}
\endgroup
+\fi %----
%% \bxpr@begindoc@last@hook
% Placed after the begin-docuemnt hook.
\def\bxpr@begindoc@last@hook{%
\let\bxpr@begindoc@last@hook\@undefined}
+\ifbxpr@new@hook@system %----
+\AddToHook{begindocument/end}{\bxpr@begindoc@last@hook}
+\else %----
\g@addto@macro\document{%
\bxpr@begindoc@last@hook}
+\fi %----
%% add hook for every page
\g@addto@macro\bxpr@begindoc@first@hook{%