summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty154
1 files changed, 69 insertions, 85 deletions
diff --git a/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty b/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
index 8d5330de8e9..e38807064ef 100644
--- a/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
+++ b/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
@@ -9,16 +9,11 @@
%% This is a generated file.
%%
%% Project: pagecolor
-%% Version: 2022-11-20 v1.1a
+%% Version: 2022-11-27 v1.2a
%%
%% Copyright (C) 2011 - 2022 by
%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
%%
-%% The usual disclaimer applies:
-%% If it does not work right that is your problem.
-%% (Nevertheless, send an e-mail to the maintainer
-%% when you find an error in this package.)
-%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
@@ -45,10 +40,11 @@
%% Hans-Klaus Muench + 2014-08-24
%%
\NeedsTeXFormat{LaTeX2e}[2021-11-15]
-\ProvidesPackage{pagecolor}[2022-11-20 1.1a
+\ProvidesPackage{pagecolor}[2022-11-27 1.2a
Provides thepagecolor (HMM)]
%% Provides the \thepagecolor, \thepagecolornone, \newpagecolor{...},
-%% and \restorepagecolor commands and a replacement for the
+%% \restorepagecolor, \backgroundpagecolor, \newbackgroundpagecolor{...},
+%% and \restorebackgroundpagecolor commands and a replacement for the
%% \nopagecolor command, if this is not available.
\RequirePackage{hardwrap}[2011/02/12]% v0.2
\GenerateLogMacros{package}{pagecolor}
@@ -147,46 +143,26 @@
\gdef\pagecolor@cl{0}
\IfPackageLoadedTF{crop}{% crop loaded
\gdef\pagecolor@cl{1}
- \IfPackageAtLeastTF{crop}{2017/11/20}{
- % later than 2017/11/19 v1.10 might be OK
- \pagecolor@warning@noline{%
- \string\nopagecolor\ did not work with package \\%
- crop 2017/11/19 v1.10. A newer version is used, %
- which the pagecolor package does not know how to handle. %
- Please contact the maintainer of the pagecolor package!%
- }%
- % Let us just hope everything got fixed:
- \renewcommand{\nopagecolor}{%
- \xdef\thepagecolor{white}%
- \xdef\thepagecolornone{none}%
- \orignopagecolor%
- % That will not have any effect except when things got fixed!
- }%
- }{% else: older package version
- \pagecolor@warning@noline{%
- \string\nopagecolor\ does not work with %
- the used crop package. Using \\%
- \pagecolor@nopagecolor\ \\%
- as nopagecolor now.%
- }
- \def\pagecolortmpb{none}
- \edef\pagecolortmpa{\pagecolor@nopagecolor}
- \ifx\pagecolortmpa\pagecolortmpb\relax
- \pagecolor@warning@noline{%
- Option nopagecolor=none requested %
- but this does not work with the crop package. %
- By option nopagecolor the "color" to be used with %
- \string\nopagecolor\ %
- is set. The current value is "none" (maybe by default), %
- but the crop package broke \string\nopagecolor . %
- Therefore the color cannot be "none". %
- Please change the option accordingly! %
- As first aid nopagecolor is now set to white.%
- }
- \setkeys{pagecolor}{nopagecolor=white}
- \fi
- \renewcommand{\nopagecolor}{\pagecolor{\pagecolor@nopagecolor}}
+ \pagecolor@info{\string\nopagecolor\space did not work with the crop package %
+ 2017/11/19 v1.10. Using \\%
+ \pagecolor@nopagecolor\ \\%
+ as nopagecolor now.%
+ }
+ \def\pagecolortmpb{none}
+ \edef\pagecolortmpa{\pagecolor@nopagecolor}
+ \ifx\pagecolortmpa\pagecolortmpb\relax
+ \pagecolor@warning@noline{%
+ Option nopagecolor=none requested but this does not work with the %
+ crop package. By option nopagecolor the "color" to be used with %
+ \string\nopagecolor\ is set. The current value is "none" (maybe by %
+ default), but the crop package broke \string\nopagecolor . %
+ Therefore the color cannot be "none". %
+ Please change the option accordingly! %
+ As first aid nopagecolor is now set to white.%
}
+ \setkeys{pagecolor}{nopagecolor=white}
+ \fi
+ \renewcommand{\nopagecolor}{\pagecolor{\pagecolor@nopagecolor}}
}{% crop not loaded
\ifdefined\nopagecolor\relax
\gdef\pagecolortmpa{none}
@@ -211,51 +187,59 @@
\gdef\pagecolortmpc{\thepagecolor}
+\newcommand{\backgroundpagecolor}[1]{%
+ \IfPackageLoadedTF{crop}{%
+ \xdef\pagecolortmpd{\thepagecolor}%
+ \pagecolor{#1}%
+ \xdef\pagecolortmpe{\CROP@pagecolor}%
+ \pagecolor{\pagecolortmpd}%
+ \xdef\CROP@stockcolor{\pagecolortmpe}%
+ }{\pagecolor@info{\string\backgroundpagecolor\ does not do %
+ anything when the crop package has not been loaded.}%
+ }%
+ }
+
+\newcommand{\newbackgroundpagecolor}[1]{%
+ \IfPackageLoadedTF{crop}{%
+ \xdef\pagecolortmpf{\CROP@stockcolor}%
+ \backgroundpagecolor{#1}%
+ }{\pagecolor@info{\string\newbackgroundpagecolor\ does not do %
+ anything when the crop package has not been loaded.}%
+ }%
+ }
+
+\newcommand{\restorebackgroundpagecolor}{%
+ \IfPackageLoadedTF{crop}{\xdef\CROP@stockcolor{\pagecolortmpf}}{%
+ \pagecolor@info{\string\newbackgroundpagecolor\ does not do %
+ anything when the crop package has not been loaded.}}%
+ }
+
\AddToHook{begindocument/end}{%
\def\pagecolortmpb{0}%
\ifx\pagecolor@cl\pagecolortmpb\relax%
% crop not loaded before pagecolor, but maybe afterwards:
\IfPackageLoadedTF{crop}{% crop indeed loaded afterwards.
\gdef\pagecolor@cl{1}%
- \IfPackageAtLeastTF{crop}{2017/11/20}{%
- % later than 2017/11/19 v1.10 might be OK
- \pagecolor@warning{%
- \string\nopagecolor\ did not work with package \\%
- crop 2017/11/19 v1.10. A newer version is used, %
- which the pagecolor package does not know how to handle. %
- Please contact the maintainer of the pagecolor package!%
- }%
- % Let us just hope everything got fixed:
- \renewcommand{\nopagecolor}{%
- \xdef\thepagecolor{white}%
- \xdef\thepagecolornone{none}%
- \orignopagecolor%
- % That will not have any effect except when things got fixed!
- }%
- }{% else: older package version
- \pagecolor@warning{pagecolor}{%
- \string\nopagecolor\space does not work with %
- the used crop package. Using \\%
- \pagecolor@nopagecolor\ \\%
- as nopagecolor now.%
- }%
- \def\pagecolortmpb{none}%
- \edef\pagecolortmpa{\pagecolor@nopagecolor}%
- \ifx\pagecolortmpa\pagecolortmpb%
- \pagecolor@warning{%
- Option nopagecolor=none requested %
- but this does not work with the crop package. %
- By option nopagecolor the "color" to be used with %
- \string\nopagecolor\ is set. The current value is "none" %
- (maybe by default), but the crop package broke %
- \string\nopagecolor . Therefore the color cannot be "none". %
- Please change the option accordingly! \\%
- As first aid nopagecolor is now set to white.%
- }%
- \setkeys{pagecolor}{nopagecolor=white}%
- \fi%
- \renewcommand{\nopagecolor}{\pagecolor{\pagecolor@nopagecolor}}%
+ \pagecolor@info{\string\nopagecolor\space did not work with the crop package %
+ 2017/11/19 v1.10. Using \\%
+ \pagecolor@nopagecolor\ \\%
+ as nopagecolor now.%
+ }%
+ \def\pagecolortmpb{none}%
+ \edef\pagecolortmpa{\pagecolor@nopagecolor}%
+ \ifx\pagecolortmpa\pagecolortmpb\relax%
+ \pagecolor@warning@noline{%
+ Option nopagecolor=none requested but this does not work with %
+ the crop package. By option nopagecolor the "color" to be used %
+ with \string\nopagecolor\ is set. The current value is "none" %
+ (maybe by default), but the crop package broke %
+ \string\nopagecolor . Therefore the color cannot be "none". %
+ Please change the option accordingly! %
+ As first aid nopagecolor is now set to white.%
}%
+ \setkeys{pagecolor}{nopagecolor=white}%
+ \fi%
+ \renewcommand{\nopagecolor}{\pagecolor{\pagecolor@nopagecolor}}%
}{% crop neither loaded afterwards.
}%
\fi%