summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/platex-tools/pxeveryshi.sty
blob: 0b7144a53af16cd6b72ad24c7191bc5017707b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
%
% pxeveryshi.sty
% originally written by Takayuki Yato (ZR)
% and modified by Hironobu Yamashita
%
% This package is distributed as part of the platex-tools bundle
% maintained by Hironobu Yamashita
% by courtesy of the original author.
% https://github.com/aminophen/platex-tools
%
% --------------------------------------------------------------------
% [Note]
% Update: version 2020/09/25 v0.2 does nothing, since
% pLaTeX2e 2020-10-01 will support the situation natively.
% --------------------------------------------------------------------
%

%% package declaration
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pxeveryshi}
    [2021/02/13 v0.2b everyshi package for (u)pLaTeX]

%% Since LaTeX2e 2020-10-01, everyshi.sty is merely
%% an emulation by everyshi-ltx.sty from ltshipout.dtx.

\chardef\pxevsh@status=\z@
\ifx\IfHookExistsTF\@undefined\else  % >= LaTeX2e 2020-10-01
  \IfHookExistsTF{shipout/before}{%  % >= LaTeX2e 2020-10-01
    \chardef\pxevsh@status=\@ne
  }{}
\fi
\ifnum\pxevsh@status=\@ne
  % if LaTeX2e and pLaTeX2e are inconsistent, raise an error!
  \@ifl@t@r\pfmtversion{2020/10/01}{%
    \PackageInfo{pxeveryshi}{This package is no longer needed}%
  }{%
    \PackageError{pxeveryshi}{Inconsistent LaTeX2e/pLaTeX2e combination}\@ehc
  }%
  \RequirePackageWithOptions{everyshi}% input anyway
  \expandafter\endinput
\fi

%% The rest of this package is meant for
%% LaTeX2e 2020-02-02 PL5 or older.

\RequirePackageWithOptions{everyshi}

\ifx\@EveryShipout@Output\@undefined
  \PackageError{pxeveryshi}{This should not happen}\@ehc
  \expandafter\endinput
\fi

\def\@EveryShipout@Output{%
  \setbox8\vbox{%
    \yoko
    \@EveryShipout@Hook
    \@EveryShipout@AtNextHook
    \global\setbox\@cclv=\box\@cclv
  }%
  \gdef\@EveryShipout@AtNextHook{}%
  \@EveryShipout@Org@Shipout\box\@cclv
}

\endinput
%% EOF