summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pagecolor
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-11-22 22:27:41 +0000
committerKarl Berry <karl@freefriends.org>2022-11-22 22:27:41 +0000
commitae8f4fb50da58825a500031103ec009d82c4fa56 (patch)
tree30d63ab9d5163e55a9d97675022d418074475251 /Master/texmf-dist/tex/latex/pagecolor
parent383ade8f42bfc4c156b9739d28ae96d370178753 (diff)
pagecolor (21nov22)
git-svn-id: svn://tug.org/texlive/trunk@65086 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pagecolor')
-rw-r--r--Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty366
1 files changed, 166 insertions, 200 deletions
diff --git a/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty b/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
index 912187a91bc..8d5330de8e9 100644
--- a/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
+++ b/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
@@ -9,13 +9,13 @@
%% This is a generated file.
%%
%% Project: pagecolor
-%% Version: 2017/05/29 v1.0i
+%% Version: 2022-11-20 v1.1a
%%
-%% Copyright (C) 2011 - 2017 by
-%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
+%% Copyright (C) 2011 - 2022 by
+%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
%%
%% The usual disclaimer applies:
-%% If it doesn't work right that's your problem.
+%% 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.)
%%
@@ -23,11 +23,11 @@
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
-%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
+%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
-%% LaTeX version 2005/12/01 or later.
+%% LaTeX version 2005-12-01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
@@ -40,251 +40,217 @@
%% pagecolor-example.tex, pagecolor-example.pdf.
%%
%% In memoriam
-%% Claudia Simone Barth + 1996/01/30
-%% Tommy Muench + 2014/01/02
-%% Hans-Klaus Muench + 2014/08/24
+%% Claudia Simone Barth + 1996-01-30
+%% Tommy Muench + 2014-01-02
+%% Hans-Klaus Muench + 2014-08-24
%%
-\NeedsTeXFormat{LaTeX2e}[2014/05/01]
-\ProvidesPackage{pagecolor}[2017/05/29 v1.0i
+\NeedsTeXFormat{LaTeX2e}[2021-11-15]
+\ProvidesPackage{pagecolor}[2022-11-20 1.1a
Provides thepagecolor (HMM)]
%% Provides the \thepagecolor, \thepagecolornone, \newpagecolor{...},
-%% and \restorepagecolor commands and the a replacement for the
-%% \nopagecolor command, if it is not available.
-\RequirePackage{kvoptions}[2011/06/30]% v3.11
+%% and \restorepagecolor commands and a replacement for the
+%% \nopagecolor command, if this is not available.
+\RequirePackage{hardwrap}[2011/02/12]% v0.2
+\GenerateLogMacros{package}{pagecolor}
+
+\RequirePackage{kvoptions}[2020-10-07]% v3.14
%% \RequirePackage{ either color or xcolor }:
-\@ifpackageloaded{xcolor}{% xcolor loaded
- \@ifpackagelater{xcolor}{2007/01/21}{%
- % 2007/01/21, v2.11, or even more recent: OK
- }{% else: older package version
- \PackageWarning{pagecolor}{%
- It is requested version `2007/01/21' of package\MessageBreak%
- xcolor, but only an older version is available\MessageBreak%
- }%
- }%
+\IfPackageLoadedTF{xcolor}{% xcolor loaded
+ \RequirePackage{xcolor}[2021/10/31]% v2.13
}{% xcolor not loaded
- \@ifpackageloaded{color}{%
- \RequirePackage{color}[2014/10/28]% v1.1a
- }{% \else
- \PackageWarning{pagecolor}{%
- The pagecolor package must be loaded after either\MessageBreak%
- package color or after package xcolor (at your\MessageBreak%
- option). Neither package was loaded before package\MessageBreak%
- pagecolor. Loading of package xcolor will now be\MessageBreak%
- tried automatically.\MessageBreak%
- When the pagecolor package is used with option\MessageBreak%
- pagecolor using a colour requiring e. g. x11names\MessageBreak%
- option for xcolor package, this will not work!\MessageBreak%
+ \IfPackageLoadedTF{color}{%
+ \RequirePackage{color}[2021/12/07]% v1.3c
+ }{\pagecolor@warning@noline{%
+ The pagecolor package must be loaded after either %
+ package color or after package xcolor (at your %
+ option). Neither package was loaded before package %
+ pagecolor. Loading of package xcolor will now be %
+ tried automatically. \\%
+ When the pagecolor package is used with option %
+ pagecolor using a color requiring e.g. x11names %
+ option for xcolor package, this will not work!%
}
- }% \fi
- \RequirePackage{xcolor}[2007/01/21]% v2.11
- }% \fi
-\RequirePackage{ifpdf}[2011/01/30]% v2.3
-\RequirePackage{ifluatex}[2010/03/01]% v1.3
-%% pagecolor may work with earlier versions of LaTeX and the
-%% packages, but this was not tested. Please consider updating
-%% your LaTeX and packages to the most recent version
-%% (if they are not already the most recent version).
+ }
+ \RequirePackage{xcolor}[2021/10/31]% v2.13
+ }
\SetupKeyvalOptions{family=pagecolor,prefix=pagecolor@}
\DeclareStringOption[none]{pagecolor}% \pagecolor@pagecolor
\DeclareStringOption[none]{nopagecolor}% \pagecolor@nopagecolor
\ProcessKeyvalOptions*
-%% \nopagecolor is only available for pdf(La)TeX and Lua(La)TeX
-%% but not for dvips, dvipdfm(x), Xe(La)TeX,...
-\def\pagecolourtmpa{0}
-\ifluatex\def\pagecolourtmpa{1}\fi
-\ifpdf\def\pagecolourtmpa{1}\fi
-\def\pagecolourtmpb{1}
-\ifx\pagecolourtmpa\pagecolourtmpb\relax%
-\else%
- \PackageInfo{pagecolor}{\string\nopagecolor\space is undefined}%
- \def\pagecolourtmpb{none}%
- \edef\pagecolourtmpa{\pagecolor@nopagecolor}%
- \ifx\pagecolourtmpa\pagecolourtmpb%
- \PackageWarning{pagecolor}{%
- Option nopagecolor=none requested but \string\nopagecolor\space%
- unknown:\MessageBreak%
- By option nopagecolor the "colour" to be used with%
- \string\nopagecolor\MessageBreak%
- is set. The current value is "none" (maybe by default),%
- \MessageBreak%
- but command \string\nopagecolor\space is undefined.\MessageBreak%
- Therefore the colour cannot be "none".\MessageBreak%
- Please change the option accordingly!\MessageBreak%
- As first aid nopagecolor is now set to white\MessageBreak%
- }%
- \setkeys{pagecolor}{nopagecolor=white}%
- \fi%
- \edef\pagecolourtmpa{\pagecolor@pagecolor}%
- \ifx\pagecolourtmpa\pagecolourtmpb%
- \PackageWarning{pagecolor}{%
- Option pagecolor=none (maybe by default) used,\MessageBreak%
- but \string\nopagecolor\space is unknown.\MessageBreak%
- Please use anotheroption value;\MessageBreak%
- \pagecolor@nopagecolor\space\MessageBreak%
- will be used now\MessageBreak%
- }%
- \setkeys{pagecolor}{pagecolor={\pagecolor@nopagecolor}}%
- \fi%
- \@ifundefined{nopagecolor}{%
- \newcommand{\nopagecolor}{\pagecolor{\pagecolor@nopagecolor}}%
- }{\renewcommand{\nopagecolor}{\pagecolor{\pagecolor@nopagecolor}}%
- }%
-\fi%
+\ifdefined\nopagecolor\relax
+\else
+ \pagecolor@info@noline{\string\nopagecolor\ is undefined!}
+ \def\pagecolortmpb{none}
+ \edef\pagecolortmpa{\pagecolor@nopagecolor}
+ \ifx\pagecolortmpa\pagecolortmpb
+ \pagecolor@warning@noline{%
+ Option nopagecolor=none requested but \string\nopagecolor\ %
+ unknown: \\%
+ By option nopagecolor the "color" to be used with %
+ \string\nopagecolor\ %
+ is set. The current value is "none" (maybe by default), %
+ but command \string\nopagecolor\ is undefined. %
+ 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
+ \edef\pagecolortmpa{\pagecolor@pagecolor}
+ \ifx\pagecolortmpa\pagecolortmpb\relax
+ \pagecolor@warning@noline{%
+ Option pagecolor=none (maybe by default) used, %
+ but \string\nopagecolor\ is unknown. %
+ Please use another option value; %
+ \pagecolor@nopagecolor\ will be used now.%
+ }
+ \setkeys{pagecolor}{pagecolor={\pagecolor@nopagecolor}}
+ \fi
+ \newcommand{\nopagecolor}{\pagecolor{\pagecolor@nopagecolor}}
+\fi
-\let\origpagecolour\pagecolor
+\let\origpagecolor\pagecolor
\renewcommand{\pagecolor}[1]{\@bsphack%
- \edef\pagecolourtmpa{#1}%
- \def\pagecolourtmpb{none}%
- \ifx\pagecolourtmpa\pagecolourtmpb\relax%
- \@ifundefined{nopagecolor}{%
- \PackageWarning{pagecolor}{%
- pagecolor=none requested but \string\nopagecolor\space%
- unknown:\MessageBreak%
- \string\pagecolor{none} was used, but the command\MessageBreak%
- \string\nopagecolor\space is undefined.\MessageBreak%
- Please use another colour.\MessageBreak%
- pagecolor=\pagecolor@nopagecolor \MessageBreak%
- will be used now\MessageBreak%
+ \edef\pagecolortmpa{#1}%
+ \def\pagecolortmpb{none}%
+ \ifx\pagecolortmpa\pagecolortmpb\relax%
+ \ifdefined\nopagecolor\relax%
+ \nopagecolor%
+ \else%
+ \pagecolor@warning{%
+ pagecolor=none requested but \string\nopagecolor\ %
+ unknown: \\%
+ \string\pagecolor{none} was used, but the command %
+ \string\nopagecolor\ is undefined. %
+ Please use another color. \\%
+ pagecolor=\pagecolor@nopagecolor\ \\%
+ will be used now.%
}%
\xdef\thepagecolor{\pagecolor@nopagecolor}%
\xdef\thepagecolornone{\pagecolor@nopagecolor}%
- % although it should be "none"
- \origpagecolour{\pagecolor@nopagecolor}%
- }{\nopagecolor%
- }%
+ % although it should be "none"
+ \origpagecolor{\pagecolor@nopagecolor}%
+ \fi%
\else%
\xdef\thepagecolor{#1}%
\xdef\thepagecolornone{#1}%
- \origpagecolour{\thepagecolornone}%
+ \origpagecolor{\thepagecolornone}%
\fi%
\@esphack%
}
-\let\orignopagecolour\nopagecolor\relax%
+\let\orignopagecolor\nopagecolor\relax
-\gdef\pagecolor@cl{0}%
-\@ifpackageloaded{crop}{% crop loaded
- \gdef\pagecolor@cl{1}%
- \@ifpackagelater{crop}{2003/05/21}{%
- % later than 2003/05/20 v1.9 might be OK
- \PackageWarning{pagecolor}{%
- \string\nopagecolor\space did not work with package%
- \MessageBreak%
- crop 2003/05/20 v1.9. A newer version is used, \MessageBreak%
- which the pagecolor package does not know how to handle.%
- \MessageBreak%
+\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!%
- \MessageBreak%
}%
% Let us just hope everything got fixed:
\renewcommand{\nopagecolor}{%
\xdef\thepagecolor{white}%
\xdef\thepagecolornone{none}%
- \orignopagecolour%
+ \orignopagecolor%
% That will not have any effect except when things got fixed!
}%
}{% else: older package version
- \PackageWarning{pagecolor}{%
- \string\nopagecolor\space does not work with\MessageBreak%
- the used crop package. Using\MessageBreak%
- \pagecolor@nopagecolor\MessageBreak%
- as nopagecolor now\MessageBreak%
- }%
- \def\pagecolourtmpb{none}%
- \edef\pagecolourtmpa{\pagecolor@nopagecolor}%
- \ifx\pagecolourtmpa\pagecolourtmpb%
- \PackageWarning{pagecolor}{%
- Option nopagecolor=none requested \MessageBreak%
- but this does not work with the crop package.\MessageBreak%
- By option nopagecolor the "colour" to be used with %
- \string\nopagecolor\MessageBreak%
- is set. The current value is "none" (maybe by default),%
- \MessageBreak%
- but the crop package broke \string\nopagecolor .%
- \MessageBreak%
- Therefore the colour cannot be "none".\MessageBreak%
- Please change the option accordingly!\MessageBreak%
- As first aid nopagecolor is now set to white\MessageBreak%
- }%
- \setkeys{pagecolor}{nopagecolor=white}%
- \fi%
- \renewcommand{\nopagecolor}{\pagecolor{\pagecolor@nopagecolor}}%
- }%
+ \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}}
+ }
}{% crop not loaded
- \def\pagecolourtmpa{0}%
- \ifluatex\def\pagecolourtmpa{1}\fi%
- \ifpdf\def\pagecolourtmpa{1}\fi%
- \def\pagecolourtmpb{1}%
- \ifx\pagecolourtmpa\pagecolourtmpb\relax%
- \gdef\pagecolourtmpa{none}%
- \else%
- \gdef\pagecolourtmpa{\pagecolor@nopagecolor}%
- \fi%
+ \ifdefined\nopagecolor\relax
+ \gdef\pagecolortmpa{none}
+ \else
+ \gdef\pagecolortmpa{\pagecolor@nopagecolor}
+ \fi
\renewcommand{\nopagecolor}{%
\xdef\thepagecolor{white}%
- \xdef\thepagecolornone{\pagecolourtmpa}%
- \orignopagecolour%
- }%
+ \xdef\thepagecolornone{\pagecolortmpa}%
+ \orignopagecolor%
+ }
}
\pagecolor{\pagecolor@pagecolor}
\newcommand{\newpagecolor}[1]{%
-\xdef\pagecolourtmpc{\thepagecolornone}%
+\xdef\pagecolortmpc{\thepagecolornone}%
\pagecolor{#1}%
}
-\newcommand{\restorepagecolor}{\pagecolor{\pagecolourtmpc}}
+\newcommand{\restorepagecolor}{\pagecolor{\pagecolortmpc}}
-\gdef\pagecolourtmpc{\thepagecolor}
+\gdef\pagecolortmpc{\thepagecolor}
-\AtBeginDocument{%
- \def\pagecolourtmpb{0}%
- \ifx\pagecolor@cl\pagecolourtmpb\relax%
+\AddToHook{begindocument/end}{%
+ \def\pagecolortmpb{0}%
+ \ifx\pagecolor@cl\pagecolortmpb\relax%
% crop not loaded before pagecolor, but maybe afterwards:
- \@ifpackageloaded{crop}{% crop indeed loaded afterwards.
+ \IfPackageLoadedTF{crop}{% crop indeed loaded afterwards.
\gdef\pagecolor@cl{1}%
- \@ifpackagelater{crop}{2003/05/21}{%
- % later than 2003/05/20 v1.9 might be OK
- \PackageWarning{pagecolor}{%
- \string\nopagecolor\space did not work with package\MessageBreak%
- crop 2003/05/20 v1.9. A newer version is used, \MessageBreak%
- which the pagecolor package does not know how to handle.%
- \MessageBreak%
- Please contact the maintainer of the pagecolor package!%
- \MessageBreak%
- }%
- % Let us just hope everything got fixed:
- \renewcommand{\nopagecolor}{%
- \xdef\thepagecolor{white}%
- \xdef\thepagecolornone{none}%
- \orignopagecolour%
- % That will not have any effect except when things got fixed!
- }%
+ \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
- \PackageWarning{pagecolor}{%
- \string\nopagecolor\space does not work with\MessageBreak%
- the used crop package. Using\MessageBreak%
- \pagecolor@nopagecolor\MessageBreak%
- as nopagecolor now\MessageBreak%
+ \pagecolor@warning{pagecolor}{%
+ \string\nopagecolor\space does not work with %
+ the used crop package. Using \\%
+ \pagecolor@nopagecolor\ \\%
+ as nopagecolor now.%
}%
- \def\pagecolourtmpb{none}%
- \edef\pagecolourtmpa{\pagecolor@nopagecolor}%
- \ifx\pagecolourtmpa\pagecolourtmpb%
- \PackageWarning{pagecolor}{%
- Option nopagecolor=none requested \MessageBreak%
- but this does not work with the crop package.\MessageBreak%
- By option nopagecolor the "colour" to be used with %
- \string\nopagecolor\MessageBreak%
- is set. The current value is "none" (maybe by default),%
- \MessageBreak%
- but the crop package broke \string\nopagecolor .\MessageBreak%
- Therefore the colour cannot be "none".\MessageBreak%
- Please change the option accordingly!\MessageBreak%
- As first aid nopagecolor is now set to white\MessageBreak%
+ \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%