From a0c455ad4ee2ad076e931dc80d3a96f6b289008d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 27 Nov 2022 20:50:48 +0000 Subject: pagecolor (27nov22) git-svn-id: svn://tug.org/texlive/trunk@65120 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/pagecolor/README | 25 +- .../doc/latex/pagecolor/pagecolor-example.pdf | Bin 81832 -> 92870 bytes .../doc/latex/pagecolor/pagecolor-example.tex | 26 +- .../texmf-dist/doc/latex/pagecolor/pagecolor.pdf | Bin 339411 -> 342986 bytes .../source/latex/pagecolor/pagecolor.drv | 9 +- .../source/latex/pagecolor/pagecolor.dtx | 328 ++++++++++++--------- .../source/latex/pagecolor/pagecolor.ins | 16 +- .../texmf-dist/tex/latex/pagecolor/pagecolor.sty | 154 +++++----- 8 files changed, 296 insertions(+), 262 deletions(-) diff --git a/Master/texmf-dist/doc/latex/pagecolor/README b/Master/texmf-dist/doc/latex/pagecolor/README index 0bae5caeb6f..be71d8d8c8c 100644 --- a/Master/texmf-dist/doc/latex/pagecolor/README +++ b/Master/texmf-dist/doc/latex/pagecolor/README @@ -1,4 +1,4 @@ -README for pagecolor package, 2022-11-20, v1.1a +README for pagecolor package, 2022-11-27, v1.2a TABLE OF CONTENTS @@ -27,6 +27,9 @@ When \nopagecolor is unknown or broken (crop package), this package provides a replacement. Similar to \newgeometry and \restoregeometry of the geometry package \newpagecolor{...} and \restorepagecolor are provided. +For use with the crop package \backgroundpagecolor{...} +as well as \newbackgroundpagecolor{...} and +\restorebackgroundpagecolor are provided. This material is published under the LPPL 1.3c: This work may be distributed and/or modified under the conditions of the LaTeX Project @@ -36,13 +39,13 @@ https://www.latex-project.org/lppl/lppl-1-3c.txt and the latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version -2008-05-04 or later. +2005-12-01 or later. 2 DOWNLOAD ========== -`pagecolor' is available on CTAN: +"pagecolor" is available on CTAN: https://www.ctan.org/pkg/pagecolor Also a ZIP file is provided that contains the files: @@ -60,7 +63,7 @@ https://mirrors.ctan.org/install/macros/latex/contrib/pagecolor.tds.zip Installation with ZIP file in TDS format ---------------------------------------- -The ZIP file `pagecolor.tds.zip' contains the files +The ZIP file "pagecolor.tds.zip" contains the files sorted in a TDS tree. Thus you can directly unpack the ZIP file inside a TDS tree. See https://www.ctan.org/TDS-guidelines for an explanation @@ -79,9 +82,9 @@ a) Download the pagecolor files from CTAN. If necessary, unpack them. b) Generate the package and driver files: tex pagecolor.dtx -c) Install the file `pagecolor.sty' in your TDS tree: +c) Install the file "pagecolor.sty" in your TDS tree: cp pagecolor.sty TDS:tex/latex/pagecolor/ - Replace `TDS:' by the prefix of your TDS tree + Replace "TDS:" by the prefix of your TDS tree (texmf directory). d) Create the documentation, if necessary, e.g. pdflatex pagecolor.dtx @@ -105,8 +108,8 @@ g) Copy the documentation files to ===================== pagecolor loads other packages: -kvoptions and -xcolor, if the color package has not been loaded before pagecolor +- kvoptions and +- xcolor, if the color package has not been loaded before pagecolor which again load other packages (see the result of the \listfiles command in the log-file of the example). @@ -115,7 +118,7 @@ which again load other packages 5 PACKAGE COMPATIBILITY ======================= -pagecolor should be loaded quite early, i. e. before +pagecolor should be loaded quite early, i.e. before \pagecolor{...} is used by some other package (but can be loaded later using the pagecolor={...} option with accordingly chosen value), but must be loaded after @@ -138,8 +141,8 @@ A bug report should contain: warning messages. * \errorcontextlines=\maxdimen can be added in the TeX code to get more information in TeX error messages. -* Minimal test file that shows the problem, but does not - contain any unnecessary packages and code. +* Minimal test file that shows the problem, + but does not contain any unnecessary packages and code. * Used drivers/programs. * Version information about used packages and programs. * If you are using LaTeX, then add "\listfiles" to the document. diff --git a/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdf b/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdf index ae63e8048c5..2f542a31844 100644 Binary files a/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdf and b/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdf differ diff --git a/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex b/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex index 937d23eb980..44261a2d69e 100644 --- a/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex +++ b/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex @@ -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 %% -%% 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 @@ -64,8 +59,10 @@ % The xcolor package would not be needed for just using the base colors. % The color package would be sufficient for that. + % \usepackage[cam,center,a3]{crop}[2017/11/19]% 1.10 + \usepackage[pagecolor={LightGoldenrod1},% - nopagecolor={none}]{pagecolor}[2022-11-20]% v1.1a + nopagecolor={none}]{pagecolor}[2022-11-27]% v1.2a \usepackage{afterpage}[2014/10/28]% v1.08 % The afterpage package is generally not needed, @@ -82,7 +79,7 @@ \section*{Example for pagecolor} This example demonstrates the use of package\newline -\textsf{pagecolor}, v1.1a as of 2022-11-20 (HMM).\newline +\textsf{pagecolor}, v1.2a as of 2022-11-27 (HMM).\newline The used options were\newline \verb|pagecolor={LightGoldenrod1}|\newline (\verb|pagecolor={none}| would be the default), and\newline @@ -155,6 +152,19 @@ here (i.\,e. green).} The page color was changed back at the end of the page -- in mid-sentence! +\pagebreak + +\backgroundpagecolor{pink} + +When activating the loading of the crop package in the preamble of this +document, \verb|\backgroundpagecolor{<|\textit{some color}\verb|>}| +changes the color of the background/outer/physical page. + +Analogous to \verb|\newpagecolor{...}| and \verb|\restorepagecolor|, +for the background/outer/physical page +\verb|\newbackgroundpagecolor{<|\textit{some color}\verb|>}| and\linebreak +\verb|\restorebackgroundpagecolor| are provided (but not demonstrated +here). \end{document} \endinput %% diff --git a/Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdf b/Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdf index 08642c75e5a..edbc7cbde2e 100644 Binary files a/Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdf and b/Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdf differ diff --git a/Master/texmf-dist/source/latex/pagecolor/pagecolor.drv b/Master/texmf-dist/source/latex/pagecolor/pagecolor.drv index fb5c29f1927..173cf51f3ae 100644 --- a/Master/texmf-dist/source/latex/pagecolor/pagecolor.drv +++ b/Master/texmf-dist/source/latex/pagecolor/pagecolor.drv @@ -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 %% -%% 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 @@ -46,7 +41,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2021-11-15] \ProvidesFile{pagecolor.drv}% - [2022-11-20 v1.1a Provides thepagecolor (HMM)] + [2022-11-27 v1.2a Provides thepagecolor (HMM)] \documentclass{ltxdoc}[2020/12/05]% v2.1b \usepackage{xcolor}[2021/10/31]% v2.13 \usepackage{holtxdoc}[2019/12/09]% v0.30 diff --git a/Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx b/Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx index c23d9c4b865..3c57dacf550 100644 --- a/Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx +++ b/Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx @@ -1,7 +1,8 @@ % \iffalse meta-comment % % File: pagecolor.dtx -% Version: 2022-11-20 v1.1a +% Version: 2022-11-27 v1.2a +% Info: Provides thepagecolor % % Copyright (C) 2011 - 2022 by % H.-Martin Muench @@ -10,9 +11,9 @@ % 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. % @@ -26,7 +27,7 @@ % pagecolor.ins, pagecolor.drv, % pagecolor-example.tex, pagecolor-example.pdf. % -% 'pagecolor' is available on CTAN: +% "pagecolor" is available on CTAN: % https://www.ctan.org/pkg/pagecolor % % Also a TDS.ZIP file is provided that contains all the files @@ -48,7 +49,7 @@ \input docstrip.tex \Msg{******************************************************************} \Msg{* Installation *} -\Msg{* Package: pagecolor 2022-11-20 v1.1a Provides thepagecolor (HMM)*} +\Msg{* Package: pagecolor 2022-11-27 v1.2a Provides thepagecolor (HMM)*} \Msg{******************************************************************} \keepsilent @@ -60,16 +61,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 -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 @@ -150,7 +146,7 @@ In memoriam %<*driver> \NeedsTeXFormat{LaTeX2e}[2021-11-15] \ProvidesFile{pagecolor.drv}% - [2022-11-20 v1.1a Provides thepagecolor (HMM)] + [2022-11-27 v1.2a Provides thepagecolor (HMM)] \documentclass{ltxdoc}[2020/12/05]% v2.1b \usepackage{xcolor}[2021/10/31]% v2.13 \usepackage{holtxdoc}[2019/12/09]% v0.30 @@ -178,7 +174,6 @@ In memoriam \end{document} % % \end{macrocode} -% % \fi % % \GetFileInfo{pagecolor.drv} @@ -200,14 +195,14 @@ In memoriam % % \DoNotIndex{\,,\@bsphack,\@esphack,\\} % \DoNotIndex{\documentclass,\usepackage,\begin,\end,\pagenumbering,\bigskip,\smallskip} -% \DoNotIndex{\space,\newline,\noindent,\pagebreak,\section,\textbf,\textsf,\color,\gdef} +% \DoNotIndex{\space,\newline,\noindent,\linebreak,\pagebreak,\section,\textbf,\textsf,\textit} % \DoNotIndex{\GenerateLogMacros,\holtxdoc,\Oberdiek,\hyperref,\kvoptions,\options,\OCG} -% \DoNotIndex{\lipsum,\ifdefined,\IfPackageAtLeastTF,\IfPackageLoadedTF,\ifx,\listfiles} -% \DoNotIndex{\M\"{u}nch,\Alternatives,\transparent,\newcommand,\verb} -% \DoNotIndex{\pagecolor@info@noline,\pagecolor@warning,\pagecolor@warning@noline} +% \DoNotIndex{\color,\gdef,\lipsum,\ifdefined,\IfPackageAtLeastTF,\IfPackageLoadedTF,\ifx} +% \DoNotIndex{\M\"{u}nch,\Alternatives,\transparent,\newcommand,\verb,\listfiles} +% \DoNotIndex{\pagecolor@info,\pagecolor@info@noline,\pagecolor@warning,\pagecolor@warning@noline} % % \title{The \xpackage{pagecolor} package} -% \date{2022-11-20 v1.1a} +% \date{2022-11-27 v1.2a} % \author{H.-Martin Münch\\\xemail{Martin.Muench at Uni-Bonn.de}} % % \maketitle @@ -224,7 +219,10 @@ In memoriam % broken, this package provides a replacement.\\ % Similar to |\newgeometry| and |\restoregeometry| of the \xpackage{geometry} % package |\newpagecolor{<|\textit{some color}|>}| and |\restorepagecolor| -% are provided. +% are provided.\\ +% For use with the \xpackage{crop} package |\backgroundpagecolor{<|\textit{some color}|>}| +% as well as |\newbackgroundpagecolor{<|\textit{some color}|>}| and \newline +% |\restorebackgroundpagecolor| are provided. % \end{abstract} % % \bigskip @@ -242,7 +240,7 @@ In memoriam % \section{Introduction} % \indent This \LaTeX{} package provides the command |\thepagecolor|, % which gives the current page (background) color, -% \hbox{i.\,e. the} argument used with the most recent call of |\pagecolor{...}|. +% \hbox{i.\,e. the} argument used with the most recent call of |\pagecolor{...}|. % (\verb|\pagecolor| needs to be defined before by the \xpackage{xcolor} or % \xpackage{color} package.) The \xpackage{pagecolor} package should be loaded % before any package sets a page (background) color, but obviously after @@ -255,11 +253,14 @@ In memoriam % |\nopagecolor| command). In that case |\thepagecolor| is |white| and % |\thepagecolornone| is |none|. % When |\nopagecolor| is unknown or in case of the \xpackage{crop} package -% broken, this package provides a replacement depending on option |nopagecolor|. -% Similar to |\newgeometry| and |\restoregeometry| of the \xpackage{geometry} -% package\linebreak -% |\newpagecolor{<|\textit{some color}|>}| and |\restorepagecolor| -% are provided. +% broken, this package provides a replacement depending on option |nopagecolor|. +% Commands to change the background/outer/physical page color when using +% \xpackage{crop} are provided. Similar to |\newgeometry| and |\restoregeometry| +% of the \xpackage{geometry} package |\newpagecolor{<|\textit{some color}|>}| +% and |\restorepagecolor| are provided.\\ +% For use with the \xpackage{crop} package |\backgroundpagecolor{<|\textit{some color}|>}| +% as well as |\newbackgroundpagecolor{<|\textit{some color}|>}| and +% |\restorebackgroundpagecolor| are provided. % % \section{Usage} % @@ -283,13 +284,18 @@ In memoriam % just one page and do not want to (or cannot) manually determine where that page ends,\\ % |\newpagecolor{<|\textit{some color}|>}\afterpage{\restorepagecolor}|\\ % does the trick (and requires a |\usepackage{afterpage}| in the document's -% preamble), or for short\\ -% |\newcommand{\onepagecolor}[1]{%|\\ -% | \newpagecolor{#1}\afterpage{\restorepagecolor}}|\\ -% in the preamble and\\ -% |\onepagecolor{<|\textit{some color}|>}| in the document. +% preamble), or for short % -% \pagebreak +% \newpage +% +% \noindent|\newcommand{\onepagecolor}[1]{%|\\ +% | \newpagecolor{#1}\afterpage{\restorepagecolor}}|\\ +% in the preamble and |\onepagecolor{<|\textit{some color}|>}| in the document.\\ +% When the \xpackage{crop} package is used, |\backgroundpagecolor{<|\textit{some color}|>}| +% can be used to change the background/outer/physical page color and\\ +% |\newbackgroundpagecolor{<|\textit{some color}|>}%|\\ +% |\afterpage{\restorebackgroundpagecolor}%|\\ +% for changing just one background/outer/physical page color. % % \subsection{Options} % \DescribeMacro{options} @@ -368,8 +374,10 @@ In memoriam % The xcolor package would not be needed for just using the base colors. % The color package would be sufficient for that. + % \usepackage[cam,center,a3]{crop}[2017/11/19]% 1.10 + \usepackage[pagecolor={LightGoldenrod1},% - nopagecolor={none}]{pagecolor}[2022-11-20]% v1.1a + nopagecolor={none}]{pagecolor}[2022-11-27]% v1.2a \usepackage{afterpage}[2014/10/28]% v1.08 % The afterpage package is generally not needed, @@ -386,7 +394,7 @@ In memoriam \section*{Example for pagecolor} This example demonstrates the use of package\newline -\textsf{pagecolor}, v1.1a as of 2022-11-20 (HMM).\newline +\textsf{pagecolor}, v1.2a as of 2022-11-27 (HMM).\newline The used options were\newline \verb|pagecolor={LightGoldenrod1}|\newline (\verb|pagecolor={none}| would be the default), and\newline @@ -459,14 +467,26 @@ here (i.\,e. green).} The page color was changed back at the end of the page -- in mid-sentence! +\pagebreak + +\backgroundpagecolor{pink} + +When activating the loading of the crop package in the preamble of this +document, \verb|\backgroundpagecolor{<|\textit{some color}\verb|>}| +changes the color of the background/outer/physical page. + + +Analogous to \verb|\newpagecolor{...}| and \verb|\restorepagecolor|, +for the background/outer/physical page +\verb|\newbackgroundpagecolor{<|\textit{some color}\verb|>}| and\linebreak +\verb|\restorebackgroundpagecolor| are provided (but not demonstrated +here). \end{document} % % \end{macrocode} % % \StopEventually{} % -% \newpage -% % \section{The implementation} % % We start off by checking that we are loading into \LaTeXe{} and @@ -478,7 +498,7 @@ in mid-sentence! % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[2021-11-15] -\ProvidesPackage{pagecolor}[2022-11-20 1.1a +\ProvidesPackage{pagecolor}[2022-11-27 1.2a Provides thepagecolor (HMM)] % \end{macrocode} % @@ -486,7 +506,8 @@ in mid-sentence! % % \begin{macrocode} %% 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. % \end{macrocode} % @@ -549,9 +570,6 @@ in mid-sentence! \def\pagecolortmpb{none} \edef\pagecolortmpa{\pagecolor@nopagecolor} \ifx\pagecolortmpa\pagecolortmpb -% \end{macrocode} -% \pagebreak -% \begin{macrocode} \pagecolor@warning@noline{% Option nopagecolor=none requested but \string\nopagecolor\ % unknown: \\% @@ -592,8 +610,7 @@ in mid-sentence! % \end{macrocode} % % before we redefine it to include a definition of |\thepagecolor| -% and\linebreak -% |\thepagecolornone|: +% and \linebreak |\thepagecolornone|: % % \begin{macrocode} \renewcommand{\pagecolor}[1]{\@bsphack% @@ -638,46 +655,26 @@ in mid-sentence! \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} @@ -747,13 +744,85 @@ in mid-sentence! % \end{macrocode} % is just a precaution for |\restorecolor| being used when no |\newpagecolor{...}| -% was used before it.\\ +% was used before it. % % When you want to change the color for just one page and do not want to % (or cannot) manually determine where the page ends,\\ % |\newpagecolor{<|\textit{some color}|>}\afterpage{\restorepagecolor}|\\ % does the trick (and requires an additional |\usepackage{afterpage}| in the -% document's preamble).\\ +% document's preamble). +% +% \begin{macro}{\backgroundpagecolor} +% When the \xpackage{crop} package has been loaded, the background/outer/physical page color +% is determined by the last |\pagecolor{...}| in the preamble after \newline +% |\usepackage[...]{crop}| and cannot be changed in the document. When the |\pagecolor{...}| +% is given before |\usepackage[...]{crop}|, a |\nopagecolor| works at the +% background/outer/physical page and not at the inner/foreground/logic page. +% |\nopagecolor| is fixed above. To change the background/outer/physical page color +% during the document, |\backgroundpagecolor{<|\textit{some color}|>}| is provided: +% +% \begin{macrocode} +\newcommand{\backgroundpagecolor}[1]{% + \IfPackageLoadedTF{crop}{% +% \end{macrocode} +% Remember current inner/foreground/logic page color: +% \begin{macrocode} + \xdef\pagecolortmpd{\thepagecolor}% +% \end{macrocode} +% Set inner/foreground page color to color whished for background/\allowbreak outer/\allowbreak +% physical page color: +% \begin{macrocode} + \pagecolor{#1}% +% \end{macrocode} +% Get that color, for example, |\pagecolor{blue}| might result in |\CROP@pagecolor| +% to be |0 0 1 rg 0 0 1 RG|: +% \begin{macrocode} + \xdef\pagecolortmpe{\CROP@pagecolor}% +% \end{macrocode} +% Set the inner/foreground/logic page color back to the color before changing it: +% \begin{macrocode} + \pagecolor{\pagecolortmpd}% +% \end{macrocode} +% Set the background/outer/physical page color: +% \begin{macrocode} + \xdef\CROP@stockcolor{\pagecolortmpe}% + }{\pagecolor@info{\string\backgroundpagecolor\ does not do % + anything when the crop package has not been loaded.}% +% \end{macrocode} +% - except giving this information. +% \begin{macrocode} + }% + } + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newbackgroundpagecolor} +% Analogous to |\newpagecolor| and |\restorepagecolor|, +% for the background/\allowbreak outer/\allowbreak physical page we define: +% +% \begin{macrocode} +\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.}% + }% + } + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\newbackgroundpagecolor} +% \begin{macrocode} +\newcommand{\restorebackgroundpagecolor}{% + \IfPackageLoadedTF{crop}{\xdef\CROP@stockcolor{\pagecolortmpf}}{% + \pagecolor@info{\string\newbackgroundpagecolor\ does not do % + anything when the crop package has not been loaded.}}% + } + +% \end{macrocode} +% \end{macro} % % We checked whether the \xpackage{crop} package had been loaded before % the \xpackage{pagecolor} package, but maybe it has been loaded afterwards. @@ -766,48 +835,26 @@ in mid-sentence! % crop not loaded before pagecolor, but maybe afterwards: \IfPackageLoadedTF{crop}{% crop indeed loaded afterwards. \gdef\pagecolor@cl{1}% -% \end{macrocode} -% \pagebreak -% \begin{macrocode} - \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% @@ -819,8 +866,6 @@ in mid-sentence! % % \end{macrocode} % -% \newpage -% % \section{Installation} % \subsection{Downloads} % Everything is available at \url{https://www.ctan.org}, @@ -867,7 +912,7 @@ in mid-sentence! % The |pagecolor-example.tex| requires the same file as all % documents using the \xpackage{pagecolor} package, i.\,e. % \begin{description} -% \item[-] package \xpackage{pagecolor}, 2022-11-20, v1.1a, +% \item[-] package \xpackage{pagecolor}, 2022-11-27, v1.2a, % \url{https://www.ctan.org/pkg/pagecolor}\\ % (Well, it is the example file for this package, and because you are reading the % documentation for the \xpackage{pagecolor} package, it~can be assumed that you already @@ -893,6 +938,8 @@ in mid-sentence! % This package is only needed for some blind text. % \end{description} % +% \newpage +% % \DescribeMacro{Alternatives} % \DescribeMacro{transparent} % \DescribeMacro{OCG} @@ -1042,9 +1089,9 @@ in mid-sentence! % % \subsection{Refresh file name databases} % -% If your \TeX~distribution (\TeX{} Live, \mikTeX, \teTeX, \dots) relies on -% file name databases, you must refresh these. For example, \teTeX{} users run -% \verb|texhash| or \verb|mktexlsr|. +% If your \TeX~distribution (\TeX\,Live, \mikTeX, \dots) relies on +% file name databases, you must refresh these. For example, \TeX\,Live\ users +% run \verb|texhash| or \verb|mktexlsr|. % % \subsection{Some details for the interested} % @@ -1090,6 +1137,8 @@ in mid-sentence! % The example file, \textsf{pagecolor-example.tex}, can be compiled via\\ % |(pdf)latex pagecolor-example.tex|. % +% \newpage +% % \section{Acknowledgements} % % I would like to thank \textsc{Heiko Oberdiek} for providing a lot of @@ -1107,8 +1156,6 @@ in mid-sentence! % and to \textsc{Reuben Thomas} for suggestions for improvements % of this documentation. % -% \pagebreak -% % \phantomsection % \begin{History}\label{History} % \begin{Version}{2011/07/16 v1.0a} @@ -1147,8 +1194,6 @@ in mid-sentence! % but some of the related code must already be performed earlier. % Bug found by \textsc{Heiner Richter} and reported by % \textsc{Johannes B\"{o}ttcher}, thanks! -% \item This version has been archived at\\ -% \url{https://web.archive.org/web/20161114093809/https://mirror.ctan.org/install/macros/latex/contrib/pagecolor.tds.zip} % \end{Version} % \begin{Version}{2017/05/29 v1.0i} % \item Documentation update following suggestions for improvements by @@ -1157,13 +1202,18 @@ in mid-sentence! % \url{https://web.archive.org/web/20220120221237/https://mirror.ctan.org/install/macros/latex/contrib/pagecolor.tds.zip} % \end{Version} % \begin{Version}{2022-11-20 v1.1a} -% \item Conversion to UTF-8. -% \item Update to \LaTeX{} format 2021-11-15. +% \item Replaced all |colour| (with |u|) by |color| (without |u|). +% \item Converted to UTF-8. +% \item Updated to \LaTeX{} format 2021-11-15. % \item Corrected an error in the example. -% \item \XeLaTeX{} and others now do know \verb|\nopagecolor|. -% \item Package \xpackage{crop} has been updated, but \verb|\nopagecolor| +% \item \XeLaTeX{} and others now do know |\nopagecolor|. +% \item Package \xpackage{crop} has been updated, but |\nopagecolor| % still applies to the physical background sheet instead of the logical foreground area. % \item Now using the \xpackage{hardwrap} package. +% \end{Version} +% \begin{Version}{2022-11-27 v1.2a} +% \item Now also handling the background/outer/physical page color, +% when the \xpackage{crop} package is used. % \item Documentation updates. % \end{Version} % \end{History} @@ -1173,6 +1223,8 @@ in mid-sentence! % When you find a mistake or have a suggestion for an improvement of this package, % please send an e-mail to the maintainer, thanks! (Please see BUG REPORTS in the README.) % +% \newpage +% % \PrintIndex % % \Finale diff --git a/Master/texmf-dist/source/latex/pagecolor/pagecolor.ins b/Master/texmf-dist/source/latex/pagecolor/pagecolor.ins index 867923602f3..109f392da91 100644 --- a/Master/texmf-dist/source/latex/pagecolor/pagecolor.ins +++ b/Master/texmf-dist/source/latex/pagecolor/pagecolor.ins @@ -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 %% -%% 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 @@ -47,7 +42,7 @@ \input docstrip.tex \Msg{******************************************************************} \Msg{* Installation *} -\Msg{* Package: pagecolor 2022-11-20 v1.1a Provides thepagecolor (HMM)*} +\Msg{* Package: pagecolor 2022-11-27 v1.2a Provides thepagecolor (HMM)*} \Msg{******************************************************************} \keepsilent @@ -59,16 +54,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 -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 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 %% -%% 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% -- cgit v1.2.3