summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-02-04 00:54:24 +0000
committerKarl Berry <karl@freefriends.org>2012-02-04 00:54:24 +0000
commit370b075ef6c7f53a7303af7b3d1e40fd7bfe5e20 (patch)
tree4ef115a842be13c52313ec0d00d63faa413183be
parente5ef52124ad078285133094925a787ff19172c5e (diff)
pagecolor (1feb12)
git-svn-id: svn://tug.org/texlive/trunk@25284 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/pagecolor/README58
-rw-r--r--Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdfbin57923 -> 85390 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex93
-rw-r--r--Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdfbin291452 -> 304734 bytes
-rw-r--r--Master/texmf-dist/source/latex/pagecolor/pagecolor.drv23
-rw-r--r--Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx452
-rw-r--r--Master/texmf-dist/source/latex/pagecolor/pagecolor.ins36
-rw-r--r--Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty96
8 files changed, 504 insertions, 254 deletions
diff --git a/Master/texmf-dist/doc/latex/pagecolor/README b/Master/texmf-dist/doc/latex/pagecolor/README
index df751cfc9c7..5d9bb71b6b6 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, 2011/08/08, v1.0c
+README for pagecolor package, 2012/02/01, v1.0d
TABLE OF CONTENTS
@@ -23,6 +23,8 @@ the most recent call of \pagecolor{...}.
The command \thepagecolornone gives the same colour as
\thepagecolor, except when the page background colour is "none".
In that case \thepagecolor is white and \thepagecolornone is none.
+Similar to \newgeometry and \restoregeometry of the geometry
+package \newpagecolor{...} and \restorepagecolor are provided.
This material is subject to the LaTeX Project Public License
(LPPL). See http://www.ctan.org/tex-archive/help/Catalogue/
licenses.lppl.html for the details of that license.
@@ -34,7 +36,15 @@ licenses.lppl.html for the details of that license.
`pagecolor' is available on CTAN:
CTAN:macros/latex/contrib/pagecolor/
-Also a ZIP file is provided that contains the files, already
+Running
+tex pagecolor.dtx
+generates the files
+pagecolor.ins, pagecolor.drv, pagecolor.sty,
+and pagecolor-example.tex.
+
+Also a ZIP file is provided that contains these files,
+the manual (pagecolor.pdf), the compiled example
+(pagecolor-example.pdf), and this README, already
sorted in a TDS tree:
CTAN:install/macros/latex/contrib/pagecolor.tds.zip
@@ -54,9 +64,9 @@ corresponds to
Installation with ZIP file in TDS format
----------------------------------------
-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.
+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 CTAN:tds.zip for an explanation of TDS.)
Example:
cd /...somewhere.../texmf
@@ -68,20 +78,30 @@ Example:
Manual installation
-------------------
-a) Download the pagecolor files from CTAN or the TUG server.
+a) Download the pagecolor files from CTAN.
If necessary, unpack them.
b) Generate the package and driver files:
- tex pagecolor.ins
+ tex pagecolor.dtx
c) Install the file `*.sty' in your TDS tree:
cp *.sty TDS:tex/latex/pagecolor/
Replace `TDS:' by the prefix of your TDS tree
(texmf directory).
-d) Copy the documentation files to
+d) Create the documentation (if necessary), e.g.
+ pdflatex pagecolor.dtx
+ makeindex -s gind.ist pagecolor.idx
+ pdflatex pagecolor.dtx
+ makeindex -s gind.ist pagecolor.idx
+ pdflatex pagecolor.dtx
+e) Update the databases if necessary, e.g. for teTeX:
+ mktexlsr .../texmf
+f) Create the pagecolor-example.pdf (if necessary), e.g.
+ pdflatex pagecolor-example.tex
+ pdflatex pagecolor-example.tex
+ pdflatex pagecolor-example.tex
+g) Copy the documentation files to
"TDS:doc/latex/pagecolor/":
README, pagecolor.pdf, pagecolor-example.tex,
pagecolor-example.pdf.
-e) Update the databases if necessary, e.g. for teTeX:
- mktexlsr .../texmf
4 ADDITIONAL PACKAGES
@@ -101,7 +121,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
@@ -112,7 +132,7 @@ at all).
6 AUTHOR/MAINTAINER
=====================
-* H.-Martin Münch
+* H.-Martin Münch
7 BUG REPORTS
@@ -121,15 +141,15 @@ at all).
A bug report should contain:
* Comprehensive problem description. This includes error or
warning messages.
- * \errorcontextlines=\maxdimen can be added in the
- TeX code to get more information in TeX error 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.
* Used drivers/programs.
* Version information about used packages and programs.
- * If you are using LaTeX, then add "\listfiles". Then
- a list of version information is printed at the end
- of the LaTeX run.
+* If you are using LaTeX, then add "\listfiles". Then
+ a list of version information is printed at the end
+ of the LaTeX run.
* Please no other files than the minimal test file.
The other files .log, .dvi, .ps, .pdf are seldom
necessary, so send them only on request.
@@ -138,11 +158,11 @@ A bug report should contain:
Bug address
-----------
Bug reports can be send to the maintainer:
- H.-Martin Münch
+ H.-Martin Münch
<Martin [dot] Muench [at] Uni-Bonn [dot] de>
8 KNOWN PROBLEMS
=================
-* as yet: none... \ No newline at end of file
+* as yet: none. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdf b/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdf
index 11e8a4abaae..0fbe9179eb4 100644
--- a/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdf
+++ b/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex b/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex
index aa095260c5d..0ed479b3d22 100644
--- a/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex
+++ b/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex
@@ -9,12 +9,12 @@
%% This is a generated file.
%%
%% Project: pagecolor
-%% Version: 2011/08/08 v1.0c
+%% Version: 2012/02/01 v1.0d
%%
-%% Copyright (C) 2011 by
+%% Copyright (C) 2011 - 2012 by
%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
%%
-%% The usual disclaimer applys:
+%% The usual disclaimer applies:
%% If it doesn't work right that's your problem.
%% (Nevertheless, send an e-mail to the maintainer
%% when you find an error in this package.)
@@ -33,30 +33,42 @@
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
-%% This work consists of the main source file pagecolor.dtx
-%% and the derived files
-%% pagecolor.sty, pagecolor.pdf, pagecolor.ins, pagecolor.drv,
-%% pagecolor-example.tex.
+%% This work consists of the main source file pagecolor.dtx,
+%% the README, and the derived files
+%% pagecolor.sty, pagecolor.pdf,
+%% pagecolor.ins, pagecolor.drv,
+%% pagecolor-example.tex, pagecolor-example.pdf.
%%
\documentclass[british]{article}[2007/10/19]% v1.4h
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\usepackage{hyperref}[2011/04/17]% v6.82g
-\hypersetup{extension=pdf,%
+\usepackage[%
+ extension=pdf,%
plainpages=false,%
pdfpagelabels=true,%
hyperindex=false,%
pdflang={en},%
pdftitle={pagecolor package example},%
- pdfauthor={Hans-Martin Muench},%
+ pdfauthor={H.-Martin Muench},%
pdfsubject={Example for the pagecolor package},%
- pdfkeywords={LaTeX, pagecolor, thepagecolor, page colour, Hans-Martin Muench},%
+ pdfkeywords={LaTeX, pagecolor, thepagecolor, page colour,%
+ H.-Martin Muench},%
pdfview=Fit,pdfstartview=Fit,%
pdfpagelayout=SinglePage%
-}
+]{hyperref}[2011/12/04]% v6.82m
\usepackage[x11names]{xcolor}[2007/01/21]% v2.11
- % The xcolor package would not be needed for just using the base colours.
- % The color package would be sufficient for that.
-\usepackage[pagecolor={LightGoldenrod1}]{pagecolor}[2011/08/08]% v1.0c
+ % The xcolor package would not be needed for just using
+ % the base colours. The color package would be sufficient for that.
+\usepackage[pagecolor={LightGoldenrod1}]{pagecolor}[2012/02/01]% v1.0d
+
+\usepackage{afterpage}[1995/10/27]% v1.08
+ % The afterpage package is generally not needed,
+ % but the |\newpagecolor{somecolour}\afterpage{\restorepagecolor}|
+ % construct shall be demonstrated.
+
+\usepackage{lipsum}[2011/04/14]% v1.2
+ % The lipsum package is generally not needed,
+ % but some blind text is needed for the example.
+
\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
\listfiles
\begin{document}
@@ -64,7 +76,7 @@
\section*{Example for pagecolor}
This example demonstrates the use of package\newline
-\textsf{pagecolor}, v1.0c as of 2011/08/08 (HMM).\newline
+\textsf{pagecolor}, v1.0d as of 2012/02/01 (HMM).\newline
The used option was \verb|pagecolor={LightGoldenrod1}|.\newline
\verb|pagecolor={none}| would be the default.\newline
@@ -89,7 +101,54 @@ when the page colour would be \verb|none|).
{\color{\thepagecolor} And that makes this text practically invisible.
\newline}
-Which made the preceding line of text practically invisible.
+{\color{white} Which made the preceding line of text practically
+invisible.}
+
+\pagebreak
+\newpagecolor{red}
+
+This page uses \verb|\newpagecolor{red}|.
+
+\pagebreak
+\restorepagecolor
+
+{\color{white}And this page uses \verb|\restorepagecolor| to restore
+the page colour to the value it had before the red page.}
+
+\pagebreak
+\pagecolor{none}
+
+This page uses \verb|\pagecolor{none}|. If the \verb|\nopagecolor|
+command is known (pdf\TeX and Lua\TeX; not yet for dvips, dvipdfm(x)
+or Xe\TeX), the page colour is now \verb|none|, otherwise \verb|white|:
+\verb|\thepagecolor|\ =\ \thepagecolor\ and
+\verb|\thepagecolornone|\ =\ \thepagecolornone .
+
+\pagebreak
+\restorepagecolor
+
+{\color{white}\verb|\restorepagecolor| restored the page colour again.}
+
+\pagebreak
+\pagecolor{green}
+
+This page is green due to \verb|\pagecolor{green}|.
+
+\pagebreak
+\newpagecolor{blue}\afterpage{\restorepagecolor}
+
+{\color{white}\verb|\newpagecolor{blue}\afterpage{\restorepagecolor}|%
+\newline
+was used here, i.\,e.~this page is blue, and the next one will
+automatically have the same page colour before it was changed to blue
+here (i.\,e. green).}
+
+\smallskip
+{\color{red}\textbf{\lipsum[1-11]}}
+\bigskip
+
+The page colour was changed back at the end of the page -
+in mid-sentence!
\end{document}
\endinput
diff --git a/Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdf b/Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdf
index 03267664120..e320c292ba4 100644
--- a/Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdf
+++ b/Master/texmf-dist/doc/latex/pagecolor/pagecolor.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pagecolor/pagecolor.drv b/Master/texmf-dist/source/latex/pagecolor/pagecolor.drv
index 253ecae6d1d..14eed9f93fb 100644
--- a/Master/texmf-dist/source/latex/pagecolor/pagecolor.drv
+++ b/Master/texmf-dist/source/latex/pagecolor/pagecolor.drv
@@ -9,12 +9,12 @@
%% This is a generated file.
%%
%% Project: pagecolor
-%% Version: 2011/08/08 v1.0c
+%% Version: 2012/02/01 v1.0d
%%
-%% Copyright (C) 2011 by
+%% Copyright (C) 2011 - 2012 by
%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
%%
-%% The usual disclaimer applys:
+%% The usual disclaimer applies:
%% If it doesn't work right that's your problem.
%% (Nevertheless, send an e-mail to the maintainer
%% when you find an error in this package.)
@@ -33,14 +33,15 @@
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
-%% This work consists of the main source file pagecolor.dtx
-%% and the derived files
-%% pagecolor.sty, pagecolor.pdf, pagecolor.ins, pagecolor.drv,
-%% pagecolor-example.tex.
+%% This work consists of the main source file pagecolor.dtx,
+%% the README, and the derived files
+%% pagecolor.sty, pagecolor.pdf,
+%% pagecolor.ins, pagecolor.drv,
+%% pagecolor-example.tex, pagecolor-example.pdf.
%%
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesFile{pagecolor.drv}[2011/08/08 v1.0c
- Provides thepagecolor (HMM)]
+\NeedsTeXFormat{LaTeX2e}[2011/06/27]
+\ProvidesFile{pagecolor.drv}%
+ [2012/02/01 v1.0d Provides thepagecolor (HMM)]
\documentclass{ltxdoc}[2007/11/11]% v2.0u
\usepackage{holtxdoc}[2011/02/04]% v0.21
%% pagecolor may work with earlier versions of LaTeX2e and those
@@ -50,7 +51,7 @@
%% recent version).
\hypersetup{%
pdfsubject={Providing the thepagecolor command (HMM)},%
- pdfkeywords={LaTeX, pagecolor, thepagecolor, Hans-Martin Muench},%
+ pdfkeywords={LaTeX, pagecolor, thepagecolor, H.-Martin Muench},%
pdfencoding=auto,%
pdflang={en},%
breaklinks=true,%
diff --git a/Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx b/Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx
index 8394dca4a5e..e7c30e72342 100644
--- a/Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx
+++ b/Master/texmf-dist/source/latex/pagecolor/pagecolor.dtx
@@ -1,9 +1,9 @@
% \iffalse meta-comment
%
% File: pagecolor.dtx
-% Version: 2011/08/08 v1.0c
+% Version: 2012/02/01 v1.0d
%
-% Copyright (C) 2011 by
+% Copyright (C) 2011 - 2012 by
% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
%
% This work may be distributed and/or modified under the
@@ -20,16 +20,20 @@
%
% The Current Maintainer of this work is H.-Martin Muench.
%
-% This work consists of the main source file pagecolor.dtx
-% and the derived files
-% pagecolor.sty, pagecolor.pdf, pagecolor.ins, pagecolor.drv,
-% pagecolor-example.tex.
+% This work consists of the main source file pagecolor.dtx,
+% the README, and the derived files
+% pagecolor.sty, pagecolor.pdf,
+% pagecolor.ins, pagecolor.drv,
+% pagecolor-example.tex, pagecolor-example.pdf.
%
% Distribution:
% CTAN:macros/latex/contrib/pagecolor/pagecolor.dtx
% CTAN:macros/latex/contrib/pagecolor/pagecolor.pdf
% CTAN:install/macros/latex/contrib/pagecolor.tds.zip
%
+% Cf. http://ctan.org/pkg/pagecolor and
+% http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/pagecolor.html
+%
% Unpacking:
% (a) If pagecolor.ins is present:
% tex pagecolor.ins
@@ -62,7 +66,7 @@
% TDS:tex/latex/pagecolor/pagecolor.sty
% TDS:doc/latex/pagecolor/pagecolor.pdf
% TDS:doc/latex/pagecolor/pagecolor-example.tex
-% TDS:doc/latex/pagecolor/pagecolor-example.log
+% TDS:doc/latex/pagecolor/pagecolor-example.pdf
% TDS:source/latex/pagecolor/pagecolor.dtx
%
%<*ignore>
@@ -79,8 +83,8 @@
%<*install>
\input docstrip.tex
\Msg{*****************************************************************}
-\Msg{* Installation}
-\Msg{* Package: pagecolor 2011/08/08 v1.0c Provides thepagecolor (HMM)}
+\Msg{* Installation }
+\Msg{* Package: pagecolor 2012/02/01 v1.0d Provides thepagecolor (HMM)}
\Msg{*****************************************************************}
\keepsilent
@@ -92,12 +96,12 @@
This is a generated file.
Project: pagecolor
-Version: 2011/08/08 v1.0c
+Version: 2012/02/01 v1.0d
-Copyright (C) 2011 by
+Copyright (C) 2011 - 2012 by
H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
-The usual disclaimer applys:
+The usual disclaimer applies:
If it doesn't work right that's your problem.
(Nevertheless, send an e-mail to the maintainer
when you find an error in this package.)
@@ -116,10 +120,11 @@ This work has the LPPL maintenance status "maintained".
The Current Maintainer of this work is H.-Martin Muench.
-This work consists of the main source file pagecolor.dtx
-and the derived files
- pagecolor.sty, pagecolor.pdf, pagecolor.ins, pagecolor.drv,
- pagecolor-example.tex.
+This work consists of the main source file pagecolor.dtx,
+the README, and the derived files
+ pagecolor.sty, pagecolor.pdf,
+ pagecolor.ins, pagecolor.drv,
+ pagecolor-example.tex, pagecolor-example.pdf.
\endpreamble
\let\MetaPrefix\DoubleperCent
@@ -140,7 +145,7 @@ and the derived files
\Msg{* To finish the installation you have to move the following}
\Msg{* file into a directory searched by TeX:}
\Msg{*}
-\Msg{* pagecolor.sty*}
+\Msg{* pagecolor.sty}
\Msg{*}
\Msg{* To produce the documentation run the file `pagecolor.drv'}
\Msg{* through (pdf)LaTeX, e.g.}
@@ -168,15 +173,15 @@ and the derived files
% The next bit of code contains the documentation driver file for
% \TeX{}, i.\,e., the file that will produce the documentation you
% are currently reading. It will be extracted from this file by the
-% \texttt{docstrip} programme. That is, run \LaTeX\ on \texttt{docstrip}
+% \texttt{docstrip} programme. That is, run \LaTeX{} on \texttt{docstrip}
% and specify the \texttt{driver} option when \texttt{docstrip}
% asks for options.
%
% \begin{macrocode}
%<*driver>
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesFile{pagecolor.drv}[2011/08/08 v1.0c
- Provides thepagecolor (HMM)]
+\NeedsTeXFormat{LaTeX2e}[2011/06/27]
+\ProvidesFile{pagecolor.drv}%
+ [2012/02/01 v1.0d Provides thepagecolor (HMM)]
\documentclass{ltxdoc}[2007/11/11]% v2.0u
\usepackage{holtxdoc}[2011/02/04]% v0.21
%% pagecolor may work with earlier versions of LaTeX2e and those
@@ -186,7 +191,7 @@ and the derived files
%% recent version).
\hypersetup{%
pdfsubject={Providing the thepagecolor command (HMM)},%
- pdfkeywords={LaTeX, pagecolor, thepagecolor, Hans-Martin Muench},%
+ pdfkeywords={LaTeX, pagecolor, thepagecolor, H.-Martin Muench},%
pdfencoding=auto,%
pdflang={en},%
breaklinks=true,%
@@ -212,7 +217,7 @@ and the derived files
%
% \fi
%
-% \CheckSum{110}
+% \CheckSum{134}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -247,34 +252,39 @@ and the derived files
% }%^^A
% \expandafter\endgroup\x
%
-% \DoNotIndex{\\}
-% \DoNotIndex{\documentclass,\usepackage,\ProvidesPackage}
+% \DoNotIndex{\,,\\}
+% \DoNotIndex{\documentclass,\usepackage,\ProvidesPackage,\begin,\end}
+% \DoNotIndex{\MessageBreak}
% \DoNotIndex{\NeedsTeXFormat,\DoNotIndex,\verb}
% \DoNotIndex{\def,\edef,\gdef,\global}
-% \DoNotIndex{\kvoptions,\listfiles,\mathord,\mathrm}
-% \DoNotIndex{\SetupKeyvalOptions,\ProcessKeyvalOptions}
-% \DoNotIndex{\bigskip,\thinspace,\section}
-% \DoNotIndex{\ldots,\indent,\noindent,\newline,\pagebreak}
-% \DoNotIndex{\textbf,\textit,\textsf,\texttt}
+% \DoNotIndex{\ifx,\listfiles,\mathord,\mathrm}
+% \DoNotIndex{\kvoptions,\SetupKeyvalOptions,\ProcessKeyvalOptions}
+% \DoNotIndex{\bigskip,\space,\thinspace,\ldots}
+% \DoNotIndex{\indent,\noindent,\newline,\linebreak,\pagebreak,\newpage}
+% \DoNotIndex{\textbf,\textit,\textsf,\texttt,\textsc,\textquotedblleft,\textquotedblright}
% \DoNotIndex{\plainTeX,\TeX,\LaTeX,\pdfLaTeX}
-% \DoNotIndex{\begin,\end,\color,\pagenumbering}
+% \DoNotIndex{\section,\color,\pagenumbering,\smallskip}
% \DoNotIndex{\@ifundefined,\@ifpackageloaded}
-% \DoNotIndex{\DeclareStringOption,\ifx,\MessageBreak,\space}
+% \DoNotIndex{\DeclareStringOption}
%
% \title{The \xpackage{pagecolor} package}
-% \date{2011/08/08 v1.0c}
+% \date{2012/02/01 v1.0d}
% \author{H.-Martin M\"{u}nch\\\xemail{Martin.Muench at Uni-Bonn.de}}
%
% \maketitle
%
% \begin{abstract}
-% This \LaTeX\ package provides the command |\thepagecolor|,
+% This \LaTeX{} package provides the command |\thepagecolor|,
% which gives the current page (background) colour,
% i.\,e.~the argument used with the most recent call of |\pagecolor{...}|.
% The command |\thepagecolornone| gives the same colour as |\thepagecolor|,
% except when the page background colour is
% \textquotedblleft|none|\textquotedblright. In that case |\thepagecolor| is
-% |white| and |\thepagecolornone| is |none|.
+% |white| and |\thepagecolornone| is |none|.\\
+% Similar to |\newgeometry| and |\restoregeometry| of the \xpackage{geometry}
+% package\\
+% |\newpagecolor{<|\textit{some colour} |>}| and |\restorepagecolor|
+% are provided.
% \end{abstract}
%
% \bigskip
@@ -297,9 +307,9 @@ and the derived files
%
% \bigskip
%
-% \section{Introduction}
+% \section{Introduction\label{sec:Introduction}}
%
-% \indent This \LaTeX\ package provides the command |\thepagecolor|,
+% \indent This \LaTeX{} package provides the command |\thepagecolor|,
% which gives the current page (background) colour,
% i.\,e.~the argument used with the most recent call of |\pagecolor{...}|.
% The package should be loaded before any package sets a page (background)
@@ -309,9 +319,13 @@ and the derived files
% except when the page background colour is
% \textquotedblleft|none|\textquotedblright (e.\,g. result of using the
% |\nopagecolor| command). In that case |\thepagecolor| is |white| and\linebreak
-% |\thepagecolornone| is |none|.
+% |\thepagecolornone| is |none|.\\
+% Similar to |\newgeometry| and |\restoregeometry| of the \xpackage{geometry}
+% package\\
+% |\newpagecolor{<|\textit{some colour}|>}| and |\restorepagecolor|
+% are provided.
%
-% %\pagebreak
+% \pagebreak
%
% \section{Usage}
%
@@ -319,13 +333,29 @@ and the derived files
% \begin{quote}
% |\usepackage[<|\textit{option}|>]{pagecolor}|
% \end{quote}
-% \noindent in the preamble of your \LaTeXe\ source file.
+% \noindent in the preamble of your \LaTeXe{} source file.
% This should be done before another package uses |\pagecolor|,
% but after |\nopagecolor| is defined (if that is defined in the document
% at all).\\
% Afterwards |\pagecolor{...}| can be used to change the page (background)
% colour as usual. Then |\thepagecolor| gives the current page (background)
% colour (in the same format as given with |\pagecolor{...}|).\\
+% Similar to |\newgeometry| and |\restoregeometry| of the \xpackage{geometry}
+% package\\
+% |\newpagecolor{<|\textit{some colour} |>}| and |\restorepagecolor|
+% are provided:\\
+% |\newpagecolor{<|\textit{some colour} |>}| will execute
+% |\pagecolor{<|\textit{some colour} |>}| and remember the page colour used before.
+% |\restorecolor| (without argument) restores the page colour to the one used before
+% use of the |\newpagecolor{...}| command. When you want to change the colour for
+% just one page and do not want to (or cannot) manually determine where the page ends,\\
+% |\newpagecolor{<|\textit{some colour}|>}\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 colour}|>}| in the document.
%
% \subsection{Option}
% \DescribeMacro{option}
@@ -343,19 +373,20 @@ and the derived files
%
% As I neither know what exactly you want to accomplish
% when using this package (e.\,g.~hiding text), nor what resources you have
-% (e.\,g.~\pdfTeX\ version), here is a list of some possible alternatives:\\
+% (e.\,g.~\pdfTeX{} version), here is a list of some possible alternatives:\\
%
-% \DescribeMacro{transparent}
% \begin{description}
-% \item[-] \xpackage{transparent} package: With it some object can be made
+% \item[-]
+% \DescribeMacro{transparent}
+% \xpackage{transparent} package: With it some object can be made
% (fully or partially) transparent.
% \end{description}
%
-% \DescribeMacro{hrefhide}
% \begin{description}
-% \item[-] \xpackage{hrefhide} package: It allows to
-% \textquotedblleft hide\textquotedblright\ some (hyperlinked) text when printing
-% the document while keeping the layout.
+% \item[-]
+% \DescribeMacro{hrefhide}\xpackage{hrefhide} package: It allows to
+% \textquotedblleft hide\textquotedblright\ some (hyperlinked) text when
+% printing the document while keeping the layout.
% \end{description}
%
% \bigskip
@@ -368,7 +399,8 @@ and the derived files
%
% \smallskip
%
-% \noindent About how to get those packages, please see subsection~\ref{ss:Downloads}.
+% \noindent About how to get those packages, please see
+% subsection~\ref{ss:Downloads}.
%
% \newpage
%
@@ -378,23 +410,34 @@ and the derived files
%<*example>
\documentclass[british]{article}[2007/10/19]% v1.4h
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\usepackage{hyperref}[2011/04/17]% v6.82g
-\hypersetup{extension=pdf,%
+\usepackage[%
+ extension=pdf,%
plainpages=false,%
pdfpagelabels=true,%
hyperindex=false,%
pdflang={en},%
pdftitle={pagecolor package example},%
- pdfauthor={Hans-Martin Muench},%
+ pdfauthor={H.-Martin Muench},%
pdfsubject={Example for the pagecolor package},%
- pdfkeywords={LaTeX, pagecolor, thepagecolor, page colour, Hans-Martin Muench},%
+ pdfkeywords={LaTeX, pagecolor, thepagecolor, page colour,%
+ H.-Martin Muench},%
pdfview=Fit,pdfstartview=Fit,%
pdfpagelayout=SinglePage%
-}
+]{hyperref}[2011/12/04]% v6.82m
\usepackage[x11names]{xcolor}[2007/01/21]% v2.11
- % The xcolor package would not be needed for just using the base colours.
- % The color package would be sufficient for that.
-\usepackage[pagecolor={LightGoldenrod1}]{pagecolor}[2011/08/08]% v1.0c
+ % The xcolor package would not be needed for just using
+ % the base colours. The color package would be sufficient for that.
+\usepackage[pagecolor={LightGoldenrod1}]{pagecolor}[2012/02/01]% v1.0d
+
+\usepackage{afterpage}[1995/10/27]% v1.08
+ % The afterpage package is generally not needed,
+ % but the |\newpagecolor{somecolour}\afterpage{\restorepagecolor}|
+ % construct shall be demonstrated.
+
+\usepackage{lipsum}[2011/04/14]% v1.2
+ % The lipsum package is generally not needed,
+ % but some blind text is needed for the example.
+
\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
\listfiles
\begin{document}
@@ -402,7 +445,7 @@ and the derived files
\section*{Example for pagecolor}
This example demonstrates the use of package\newline
-\textsf{pagecolor}, v1.0c as of 2011/08/08 (HMM).\newline
+\textsf{pagecolor}, v1.0d as of 2012/02/01 (HMM).\newline
The used option was \verb|pagecolor={LightGoldenrod1}|.\newline
\verb|pagecolor={none}| would be the default.\newline
@@ -427,7 +470,54 @@ when the page colour would be \verb|none|).
{\color{\thepagecolor} And that makes this text practically invisible.
\newline}
-Which made the preceding line of text practically invisible.
+{\color{white} Which made the preceding line of text practically
+invisible.}
+
+\pagebreak
+\newpagecolor{red}
+
+This page uses \verb|\newpagecolor{red}|.
+
+\pagebreak
+\restorepagecolor
+
+{\color{white}And this page uses \verb|\restorepagecolor| to restore
+the page colour to the value it had before the red page.}
+
+\pagebreak
+\pagecolor{none}
+
+This page uses \verb|\pagecolor{none}|. If the \verb|\nopagecolor|
+command is known (pdf\TeX and Lua\TeX; not yet for dvips, dvipdfm(x)
+or Xe\TeX), the page colour is now \verb|none|, otherwise \verb|white|:
+\verb|\thepagecolor|\ =\ \thepagecolor\ and
+\verb|\thepagecolornone|\ =\ \thepagecolornone .
+
+\pagebreak
+\restorepagecolor
+
+{\color{white}\verb|\restorepagecolor| restored the page colour again.}
+
+\pagebreak
+\pagecolor{green}
+
+This page is green due to \verb|\pagecolor{green}|.
+
+\pagebreak
+\newpagecolor{blue}\afterpage{\restorepagecolor}
+
+{\color{white}\verb|\newpagecolor{blue}\afterpage{\restorepagecolor}|%
+\newline
+was used here, i.\,e.~this page is blue, and the next one will
+automatically have the same page colour before it was changed to blue
+here (i.\,e. green).}
+
+\smallskip
+{\color{red}\textbf{\lipsum[1-11]}}
+\bigskip
+
+The page colour was changed back at the end of the page -
+in mid-sentence!
\end{document}
%</example>
@@ -439,7 +529,7 @@ Which made the preceding line of text practically invisible.
%
% \section{The implementation}
%
-% We start off by checking that we are loading into \LaTeXe\ and
+% We start off by checking that we are loading into \LaTeXe{} and
% announcing the name and version of this package.
%
% \begin{macrocode}
@@ -447,15 +537,16 @@ Which made the preceding line of text practically invisible.
% \end{macrocode}
%
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesPackage{pagecolor}[2011/08/08 v1.0c
+\NeedsTeXFormat{LaTeX2e}[2011/06/27]
+\ProvidesPackage{pagecolor}[2012/02/01 v1.0d
Provides thepagecolor (HMM)]
% \end{macrocode}
%
% A short description of the \xpackage{pagecolor} package:
%
% \begin{macrocode}
-%% Provides the \thepagecolor and \thepagecolornone commands.
+%% Provides the \thepagecolor, \thepagecolornone, \newpagecolor{...},
+%% and \restorepagecolor commands.
% \end{macrocode}
%
% We need the \xpackage{kvoptions} package by \textsc{Heiko Oberdiek}:
@@ -470,23 +561,24 @@ Which made the preceding line of text practically invisible.
%% \RequirePackage{ either color or xcolor }:
\@ifpackageloaded{color}{%
\RequirePackage{color}[2005/11/14]% v1.0j
- }{% else
- \@ifpackageloaded{xcolor}{% ok
- }{% else
+ }{% \else
+ \@ifpackageloaded{xcolor}{% OK
+ }{% \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%
}
- }% fi
+ }% \fi
\RequirePackage{xcolor}[2007/01/21]% v2.11
- }% fi
+ }% \fi
% \end{macrocode}
%
-% Replacing \xpackage{color}, \xpackage{xcolor}, \xpackage{xcolor-patch},
-% and \xpackage{pagecolor} by one new package would be appreciated.\\
% A last information for the user:
%
% \begin{macrocode}
@@ -522,34 +614,42 @@ Which made the preceding line of text practically invisible.
% \pagebreak
%
% \begin{macrocode}
-\renewcommand{\pagecolor}[1]{%
- \edef\pagecolourtmpa{#1}
- \def\pagecolourtmpb{none}
+\renewcommand{\pagecolor}[1]{\@bsphack%
+ \edef\pagecolourtmpa{#1}%
+ \def\pagecolourtmpb{none}%
\ifx\pagecolourtmpa\pagecolourtmpb
\@ifundefined{nopagecolor}{%
\PackageError{pagecolor}{%
pagecolor=none requested but \string\nopagecolor\space unknown%
}{%
- \string\pagecolor{none} was used, but the command \string\nopagecolor\space%
- is undefined.\MessageBreak%
- Please use another colour. pagecolor=white will be used now.\MessageBreak%
- }
- \xdef\thepagecolor{white}
- \xdef\thepagecolornone{white}% although it should be "none"
- \origpagecolour{white}
+ \string\pagecolor{none} was used, but the command %
+ \string\nopagecolor\space is undefined.\MessageBreak%
+ Please use another colour. pagecolor=white will be used now.%
+ \MessageBreak%
+ }%
+ \gdef\thepagecolor{white}%
+ \gdef\thepagecolornone{white}% although it should be "none"
+ \origpagecolour{white}%
}{%
- \nopagecolor
- }
- \else
- \xdef\thepagecolor{#1}
- \xdef\thepagecolornone{#1}
- \origpagecolour{\thepagecolor}
- \fi
- }
+ \nopagecolor%
+ }%
+ \else%
+ \xdef\thepagecolor{#1}%
+ \xdef\thepagecolornone{#1}%
+ \origpagecolour{\thepagecolornone}%
+ \fi%
+ \@esphack%
+}
% \end{macrocode}
%
-% When |\pagecolor{none}| is used and |\nopagecolor| is defined,
+% |\nopagecolor| is only defined for \pdfTeX and \LuaTeX, but not yet for dvips,
+% dvipdfm(x) or \XeTeX. Maybe
+% \begin{verbatim}
+% \@ifundefined{nopagecolor}{\newcommand{\nopagecolor}{\pagecolor{white}}}{}
+% \end{verbatim}
+% could be an alternative.\\
+% When |\pagecolor{none}| is used and |\nopagecolor| is defined, then \\
% |\pagecolor{none}| is made into a synonym for |\nopagecolor|.\\
% If |\nopagecolor| has not been defined, nothing needs to be done.
% Otherwise we redefine |\nopagecolor|, thus that |\thepagecolor| is
@@ -567,12 +667,13 @@ Which made the preceding line of text practically invisible.
\@ifundefined{nopagecolor}{% no problem
}{%
\PackageError{pagecolor}{%
- \string\nopagecolor\space defined after loading package\MessageBreak%
+ \string\nopagecolor\space defined after loading package%
+ \MessageBreak%
pagecolor%
- }{\string\nopagecolor\space was defined after loading the pagecolor
- package.\MessageBreak%
- Either define \string\nopagecolor\space earlier or load the pagecolor
- package later.\MessageBreak%
+ }{\string\nopagecolor\space was defined after loading the %
+ pagecolor package.\MessageBreak%
+ Either define \string\nopagecolor\space earlier or load the %
+ pagecolor package later.\MessageBreak%
}
}%
}%
@@ -587,7 +688,7 @@ Which made the preceding line of text practically invisible.
% \end{macrocode}
%
-% If the pagecolour as given with option |pagecolor={...}| is |none|,
+% If the page colour as given with option |pagecolor={...}| is |none|,
% but |\nopagecolor| is not known, |\pagecolor@pagecolor| is set to
% |white| and a warning is given.
%
@@ -597,7 +698,8 @@ Which made the preceding line of text practically invisible.
\@ifundefined{nopagecolor}{%
\PackageWarning{pagecolor}{%
Option pagecolor=none (maybe by default) used,\MessageBreak%
- but \string\nopagecolor\space is unknown. Please use another\MessageBreak%
+ but \string\nopagecolor\space is unknown. Please use another%
+ \MessageBreak%
option value; white will be used now.\MessageBreak%
}
\setkeys{pagecolor}{pagecolor=white}%
@@ -614,78 +716,118 @@ Which made the preceding line of text practically invisible.
% \end{macrocode}
%
-% Now the page (background) colour and |\thepagecolor| and
+% Now the page (background) colour and |\thepagecolor| and \\
% |\thepagecolornone| are |\pagecolor@pagecolor| (or page (background) colour
% and |\thepagecolornone| are |none|=|\pagecolor@pagecolor| and
% |\thepagecolor| is |white|), and when the page (background) colour
% is changed, |\thepagecolor| and |\thepagecolornone| are changed
% accordingly.
%
+% \bigskip
+%
+% There have been requests (via e-mail and at
+% \url{http://tex.stackexchange.com/q/25137}) to change the colour of just one
+% (or two) page(s) only, similar to |\newgeometry| and |\restoregeometry| of the
+% \xpackage{geometry} package (\url{http://ctan.org/pkg/geometry}). Therefore
+% |\newpagecolor| and |\restorepagecolor| are introduced (as suggested by
+% \textsc{haoyun\_tex}):
+%
+% \begin{macrocode}
+\newcommand{\newpagecolor}[1]{%
+\xdef\pagecolourtmpc{\thepagecolornone}%
+\pagecolor{#1}%
+}
+
+% \end{macrocode}
+%
+% |\newpagecolor{<|\textit{some colour}|>}| will execute |\pagecolor{somecolour}|
+% and remember the page colour used before.
+%
+% \begin{macrocode}
+\newcommand{\restorepagecolor}{\pagecolor{\pagecolourtmpc}}
+
+% \end{macrocode}
+%
+% |\restorecolor| (without argument) restores the page colour to the one used before
+% use of the |\newpagecolor{...}| command.
+%
+% \pagebreak
+%
+% \begin{macrocode}
+\gdef\pagecolourtmpc{\thepagecolor}
+
+% \end{macrocode}
+% is just a precaution for |\restorecolor| being used when no |\newpagecolor{...}|
+% was used before it.\\
+%
+% When you want to change the colour for just one page and do not want to
+% (or cannot) manually determine where the page ends,\\
+% |\newpagecolor{<|\textit{some colour}|>}\afterpage{\restorepagecolor}|\\
+% does the trick (and requires an additional |\usepackage{afterpage}| in the
+% document's preamble).
% \begin{macrocode}
%</package>
% \end{macrocode}
%
-% \newpage
+% \bigskip
%
% \section{Installation}
%
% \subsection{Downloads\label{ss:Downloads}}
%
-% Everything is available at \CTAN{}, \url{http://www.ctan.org/tex-archive/},
+% Everything is available on \CTAN{}, \url{http://www.ctan.org/tex-archive/},
% but may need additional packages themselves.\\
%
% \DescribeMacro{pagecolor.dtx}
-% For unpacking the |pagecolor.dtx| file and constructing the documentation it is required:
+% For unpacking the |pagecolor.dtx| file and constructing the documentation
+% it is required:
% \begin{description}
-% \item[-] \TeX Format \LaTeXe{}: \url{http://www.CTAN.org/}
-%
-% \item[-] document class \xpackage{ltxdoc}, 2007/11/11, v2.0u,\\
-% \CTAN{macros/latex/base/ltxdoc.dtx}
+% \item[-] \TeX{} Format \LaTeXe{}, \url{http://www.CTAN.org/}
%
-% \item[-] package \xpackage{holtxdoc}, 2011/02/04, v0.21,\\
-% \CTAN{macros/latex/contrib/oberdiek/holtxdoc.dtx}
+% \item[-] document class \xpackage{ltxdoc}, 2007/11/11, v2.0u,
+% \url{http://ctan.org/pkg/ltxdoc}
%
-% \item[-] package \xpackage{hypdoc}, 2010/03/26, v1.9,\\
-% \CTAN{macros/latex/contrib/oberdiek/hypdoc.dtx}
+% \item[-] package \xpackage{holtxdoc}, 2011/02/04, v0.21,
+% \url{http://ctan.org/pkg/holtxdoc}
% \end{description}
%
% \DescribeMacro{pagecolor.sty}
-% The \texttt{pagecolor.sty} for \LaTeXe\ (i.\,e. each document using
+% The |pagecolor.sty| for \LaTeXe{} (i.\,e. each document using
% the \xpackage{pagecolor} package) requires:
% \begin{description}
-% \item[-] \TeX Format \LaTeXe{}, \url{http://www.CTAN.org/}
+% \item[-] \TeX{} Format \LaTeXe{}, \url{http://www.CTAN.org/}
%
-% \item[-] package \xpackage{kvoptions}, 2010/12/23, v3.10,\\
-% \CTAN{macros/latex/contrib/oberdiek/kvoptions.dtx}
+% \item[-] package \xpackage{kvoptions}, 2010/12/23, v3.10,
+% \url{http://ctan.org/pkg/kvoptions}
% \end{description}
% and either
% \begin{description}
-% \item[-] package \xpackage{color}, 2005/11/14, v1.0j,\\
-% \CTAN{macros/latex/required/graphics/color.dtx}
+% \item[-] package \xpackage{color}, 2005/11/14, v1.0j,
+% \url{http://ctan.org/pkg/color} (from the
+% \xpackage{graphics} package bundle)
% \end{description}
% or
% \begin{description}
-% \item[-] package \xpackage{xcolor}, 2007/01/21, v2.11,\\
-% \CTAN{macros/latex/contrib/xcolor/xcolor.dtx}
+% \item[-] package \xpackage{xcolor}, 2007/01/21, v2.11,
+% \url{http://ctan.org/pkg/xcolor}
% \end{description}
%
% \DescribeMacro{pagecolor-example.tex}
-% The \texttt{pagecolor-example.tex} requires the same files as all
-% documents using the \xpackage{pagecolor} package, i.\,e. the ones
-% named above and additionally:
+% The |pagecolor-example.tex| requires the same files as all
+% documents using the \xpackage{pagecolor} package and additionally:
% \begin{description}
% \item[-] class \xpackage{article}, 2007/10/19, v1.4h, from \xpackage{classes.dtx}:\\
% \CTAN{macros/latex/base/classes.dtx}
%
-% \item[-] package \xpackage{pagecolor}, 2011/08/08, v1.0c,\\
-% \CTAN{macros/latex/contrib/pagecolor/pagecolor.dtx}\\
+% \item[-] package \xpackage{pagecolor}, 2012/02/01, v1.0d,
+% \url{http://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 have some version of it --
% is it the current one?)
%
-% \item[-] package \xpackage{xcolor}, 2007/01/21, v2.11,\\
-% \CTAN{macros/latex/contrib/xcolor/xcolor.dtx}\\
+% \item[-] package \xpackage{xcolor}, 2007/01/21, v2.11,
+% \url{http://ctan.org/pkg/xcolor}\\
% This package would not be needed for the use of just base colours only,
% the \xpackage{color} package would be sufficient for that.
% \end{description}
@@ -695,18 +837,16 @@ Which made the preceding line of text practically invisible.
% As possible alternatives in section \ref{sec:Alternatives} there are listed
% \begin{description}
% \item[-] package \xpackage{transparent}, 2007/01/08, v1.0, \\
-% \CTAN{macros/latex/contrib/oberdiek/transparent.dtx}
+% \url{http://ctan.org/pkg/transparent}
%
% \item[-] package \xpackage{hrefhide}, 2011/04/29, v1.0f, \\
-% \CTAN{macros/latex/contrib/hrefhide/hrefhide.dtx}
+% \url{http://ctan.org/pkg/hrefhide}
% \end{description}
%
-% \pagebreak
-%
% \DescribeMacro{Oberdiek}
% \DescribeMacro{holtxdoc}
% \DescribeMacro{kvoptions}
-% All packages of \textsc{Heiko Oberdiek's} bundle `oberdiek'
+% All packages of \textsc{Heiko Oberdiek}'s bundle `oberdiek'
% (especially \xpackage{holtxdoc} and \xpackage{kvoptions})
% are also available in a TDS compliant ZIP archive:\\
% \CTAN{install/macros/latex/contrib/oberdiek.tds.zip}.\\
@@ -714,8 +854,8 @@ Which made the preceding line of text practically invisible.
% are quite probably both recent and compatible among themselves.\\
%
% \DescribeMacro{hyperref}
-% \noindent \xpackage{hyperref} is not included in that bundle and needs to be downloaded
-% separately,\\
+% \noindent \xpackage{hyperref} is not included in that bundle and needs to be
+% downloaded separately,\\
% \url{http://mirror.ctan.org/install/macros/latex/contrib/hyperref.tds.zip}.\\
%
% \DescribeMacro{M\"{u}nch}
@@ -723,7 +863,6 @@ Which made the preceding line of text practically invisible.
% \url{http://www.Uni-Bonn.de/~uzs5pv/LaTeX.html}.\\
%
% \subsection{Package, unpacking TDS}
-%
% \paragraph{Package.} This package is available on \CTAN{}
% \begin{description}
% \item[\CTAN{macros/latex/contrib/pagecolor/pagecolor.dtx}]\hspace*{0.1cm} \\
@@ -734,24 +873,27 @@ Which made the preceding line of text practically invisible.
% The compiled example file, as it should look like.
% \item[\CTAN{macros/latex/contrib/pagecolor/README}]\hspace*{0.1cm} \\
% The README file.
+% \end{description}
+% There is also an undolabl.tds.zip available:
+% \begin{description}
% \item[\CTAN{install/macros/latex/contrib/pagecolor.tds.zip}]\hspace*{0.1cm} \\
-% Everything in TDS compliant, compiled format.
+% Everything in \xfile{TDS} compliant, compiled format.
% \end{description}
% which additionally contains\\
% \begin{tabular}{ll}
% pagecolor.ins & The installation file.\\
% pagecolor.drv & The driver to generate the documentation.\\
% pagecolor.sty & The \xext{sty}le file.\\
-% pagecolor-example.tex & The example file.\\
+% pagecolor-example.tex & The example file.
% \end{tabular}
%
% \bigskip
%
-% \noindent For required other packages, see the preceding subsection.
+% \noindent For required other packages, please see the preceding subsection.
%
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
-% \docstrip\ archive. The files are extracted by running the
-% \xfile{.dtx} through \plainTeX:
+% \docstrip{} archive. The files are extracted by running the
+% \xext{.dtx} through \plainTeX{}:
% \begin{quote}
% \verb|tex pagecolor.dtx|
% \end{quote}
@@ -764,11 +906,11 @@ Which made the preceding line of text practically invisible.
% \begin{quote}
% \def\t{^^A
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
-% pagecolor.sty & tex/latex/pagecolor.sty\\
-% pagecolor.pdf & doc/latex/pagecolor.pdf\\
-% pagecolor-example.tex & doc/latex/pagecolor-example.tex\\
-% pagecolor-example.pdf & doc/latex/pagecolor-example.pdf\\
-% pagecolor.dtx & source/latex/pagecolor.dtx\\
+% pagecolor.sty & tex/latex/pagecolor/pagecolor.sty\\
+% pagecolor.pdf & doc/latex/pagecolor/pagecolor.pdf\\
+% pagecolor-example.tex & doc/latex/pagecolor/pagecolor-example.tex\\
+% pagecolor-example.pdf & doc/latex/pagecolor/pagecolor-example.pdf\\
+% pagecolor.dtx & source/latex/pagecolor/pagecolor.dtx\\
% \end{tabular}^^A
% }^^A
% \sbox0{\t}^^A
@@ -830,9 +972,9 @@ Which made the preceding line of text practically invisible.
% \usebox0
% \fi
% \end{quote}
-% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
-% TDS installing feature, then some files can already be in the right
-% place, see the documentation of \docstrip.
+% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip{}'s
+% \xfile{TDS} installing feature, then some files can already be in the right
+% place, see the documentation of \docstrip{}.
%
% \subsection{Refresh file name databases}
%
@@ -845,11 +987,11 @@ Which made the preceding line of text practically invisible.
% \paragraph{Unpacking with \LaTeX{}.}
% The \xfile{.dtx} chooses its action depending on the format:
% \begin{description}
-% \item[\plainTeX:] Run \docstrip\ and extract the files.
+% \item[\plainTeX:] Run \docstrip{} and extract the files.
% \item[\LaTeX:] Generate the documentation.
% \end{description}
-% If you insist on using \LaTeX\ for \docstrip\ (really,
-% \docstrip\ does not need \LaTeX{}), then inform the autodetect routine
+% If you insist on using \LaTeX{} for \docstrip{} (really,
+% \docstrip{} does not need \LaTeX{}), then inform the autodetect routine
% about your intention:
% \begin{quote}
% \verb|latex \let\install=y\input{pagecolor.dtx}|
@@ -860,8 +1002,8 @@ Which made the preceding line of text practically invisible.
% \paragraph{Generating the documentation.\label{GenDoc}}
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
% the documentation. The process can be configured by a
-% configuration file \xfile{ltxdoc.cfg}. For instance, put this
-% line into this file, if you want to have |A4| as paper format:
+% configuration file \xfile{ltxdoc.cfg}. For instance, put the following
+% line into this file, if you want to have A4 as paper format:
% \begin{quote}
% \verb|\PassOptionsToClass{a4paper}{article}|
% \end{quote}
@@ -893,9 +1035,12 @@ Which made the preceding line of text practically invisible.
% for their help in all things \TeX{}, especially all contributors to the
% discussion at
% \url{http://groups.google.com/group/comp.text.tex/browse_thread/thread/533576ebe44d60f6/e1654d70a19de63c?lnk=gst&q=Determination+of+the+current+page+colour#e1654d70a19de63c}
-% \ (\textsc{H.~Oberdiek} \& \textsc{Gouailles}).
+% \ (\textsc{H.~Oberdiek} \& \textsc{Gouailles}).\\
+% I thank \textsc{haoyun\_tex} for suggesting the |\newpagecolor|/|\restorepagecolor|
+% pair of commands and everyone at \url{http://tex.stackexchange.com/q/25137}
+% for their contributions there.
%
-% \pagebreak
+% \bigskip
%
% \phantomsection
% \begin{History}\label{History}
@@ -908,6 +1053,11 @@ Which made the preceding line of text practically invisible.
% \begin{Version}{2011/08/08 v1.0c}
% \item Fixed a |\setkeys|.
% \end{Version}
+% \begin{Version}{2012/02/01 v1.0d}
+% \item Bugfix: Obsolete installation path given in the documentation, updated.
+% \item New commands: |\newpagecolor{...}|, |\restorepagecolor|.
+% \item Update of documentation, README, and \xfile{dtx} internals.
+% \end{Version}
% \end{History}
%
% \bigskip
@@ -915,7 +1065,7 @@ Which made the preceding line of text practically invisible.
% 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.)
%
-% \bigskip
+% \newpage
%
% \PrintIndex
%
diff --git a/Master/texmf-dist/source/latex/pagecolor/pagecolor.ins b/Master/texmf-dist/source/latex/pagecolor/pagecolor.ins
index 2805aaf8fe6..e7e59424ba8 100644
--- a/Master/texmf-dist/source/latex/pagecolor/pagecolor.ins
+++ b/Master/texmf-dist/source/latex/pagecolor/pagecolor.ins
@@ -9,12 +9,12 @@
%% This is a generated file.
%%
%% Project: pagecolor
-%% Version: 2011/08/08 v1.0c
+%% Version: 2012/02/01 v1.0d
%%
-%% Copyright (C) 2011 by
+%% Copyright (C) 2011 - 2012 by
%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
%%
-%% The usual disclaimer applys:
+%% The usual disclaimer applies:
%% If it doesn't work right that's your problem.
%% (Nevertheless, send an e-mail to the maintainer
%% when you find an error in this package.)
@@ -33,15 +33,16 @@
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
-%% This work consists of the main source file pagecolor.dtx
-%% and the derived files
-%% pagecolor.sty, pagecolor.pdf, pagecolor.ins, pagecolor.drv,
-%% pagecolor-example.tex.
+%% This work consists of the main source file pagecolor.dtx,
+%% the README, and the derived files
+%% pagecolor.sty, pagecolor.pdf,
+%% pagecolor.ins, pagecolor.drv,
+%% pagecolor-example.tex, pagecolor-example.pdf.
%%
\input docstrip.tex
\Msg{*****************************************************************}
-\Msg{* Installation}
-\Msg{* Package: pagecolor 2011/08/08 v1.0c Provides thepagecolor (HMM)}
+\Msg{* Installation }
+\Msg{* Package: pagecolor 2012/02/01 v1.0d Provides thepagecolor (HMM)}
\Msg{*****************************************************************}
\keepsilent
@@ -53,12 +54,12 @@
This is a generated file.
Project: pagecolor
-Version: 2011/08/08 v1.0c
+Version: 2012/02/01 v1.0d
-Copyright (C) 2011 by
+Copyright (C) 2011 - 2012 by
H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
-The usual disclaimer applys:
+The usual disclaimer applies:
If it doesn't work right that's your problem.
(Nevertheless, send an e-mail to the maintainer
when you find an error in this package.)
@@ -77,10 +78,11 @@ This work has the LPPL maintenance status "maintained".
The Current Maintainer of this work is H.-Martin Muench.
-This work consists of the main source file pagecolor.dtx
-and the derived files
- pagecolor.sty, pagecolor.pdf, pagecolor.ins, pagecolor.drv,
- pagecolor-example.tex.
+This work consists of the main source file pagecolor.dtx,
+the README, and the derived files
+ pagecolor.sty, pagecolor.pdf,
+ pagecolor.ins, pagecolor.drv,
+ pagecolor-example.tex, pagecolor-example.pdf.
\endpreamble
\let\MetaPrefix\DoubleperCent
@@ -101,7 +103,7 @@ and the derived files
\Msg{* To finish the installation you have to move the following}
\Msg{* file into a directory searched by TeX:}
\Msg{*}
-\Msg{* pagecolor.sty*}
+\Msg{* pagecolor.sty}
\Msg{*}
\Msg{* To produce the documentation run the file `pagecolor.drv'}
\Msg{* through (pdf)LaTeX, e.g.}
diff --git a/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty b/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
index beea5bfb298..1e8b659687a 100644
--- a/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
+++ b/Master/texmf-dist/tex/latex/pagecolor/pagecolor.sty
@@ -9,12 +9,12 @@
%% This is a generated file.
%%
%% Project: pagecolor
-%% Version: 2011/08/08 v1.0c
+%% Version: 2012/02/01 v1.0d
%%
-%% Copyright (C) 2011 by
+%% Copyright (C) 2011 - 2012 by
%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
%%
-%% The usual disclaimer applys:
+%% The usual disclaimer applies:
%% If it doesn't work right that's your problem.
%% (Nevertheless, send an e-mail to the maintainer
%% when you find an error in this package.)
@@ -33,32 +33,37 @@
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
-%% This work consists of the main source file pagecolor.dtx
-%% and the derived files
-%% pagecolor.sty, pagecolor.pdf, pagecolor.ins, pagecolor.drv,
-%% pagecolor-example.tex.
+%% This work consists of the main source file pagecolor.dtx,
+%% the README, and the derived files
+%% pagecolor.sty, pagecolor.pdf,
+%% pagecolor.ins, pagecolor.drv,
+%% pagecolor-example.tex, pagecolor-example.pdf.
%%
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesPackage{pagecolor}[2011/08/08 v1.0c
+\NeedsTeXFormat{LaTeX2e}[2011/06/27]
+\ProvidesPackage{pagecolor}[2012/02/01 v1.0d
Provides thepagecolor (HMM)]
-%% Provides the \thepagecolor and \thepagecolornone commands.
+%% Provides the \thepagecolor, \thepagecolornone, \newpagecolor{...},
+%% and \restorepagecolor commands.
\RequirePackage{kvoptions}[2010/12/23]% v3.10
%% \RequirePackage{ either color or xcolor }:
\@ifpackageloaded{color}{%
\RequirePackage{color}[2005/11/14]% v1.0j
- }{% else
- \@ifpackageloaded{xcolor}{% ok
- }{% else
+ }{% \else
+ \@ifpackageloaded{xcolor}{% OK
+ }{% \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%
}
- }% fi
+ }% \fi
\RequirePackage{xcolor}[2007/01/21]% v2.11
- }% fi
+ }% \fi
%% 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
@@ -70,30 +75,32 @@
\let\origpagecolour\pagecolor
-\renewcommand{\pagecolor}[1]{%
- \edef\pagecolourtmpa{#1}
- \def\pagecolourtmpb{none}
+\renewcommand{\pagecolor}[1]{\@bsphack%
+ \edef\pagecolourtmpa{#1}%
+ \def\pagecolourtmpb{none}%
\ifx\pagecolourtmpa\pagecolourtmpb
\@ifundefined{nopagecolor}{%
\PackageError{pagecolor}{%
pagecolor=none requested but \string\nopagecolor\space unknown%
}{%
- \string\pagecolor{none} was used, but the command \string\nopagecolor\space%
- is undefined.\MessageBreak%
- Please use another colour. pagecolor=white will be used now.\MessageBreak%
- }
- \xdef\thepagecolor{white}
- \xdef\thepagecolornone{white}% although it should be "none"
- \origpagecolour{white}
+ \string\pagecolor{none} was used, but the command %
+ \string\nopagecolor\space is undefined.\MessageBreak%
+ Please use another colour. pagecolor=white will be used now.%
+ \MessageBreak%
+ }%
+ \gdef\thepagecolor{white}%
+ \gdef\thepagecolornone{white}% although it should be "none"
+ \origpagecolour{white}%
}{%
- \nopagecolor
- }
- \else
- \xdef\thepagecolor{#1}
- \xdef\thepagecolornone{#1}
- \origpagecolour{\thepagecolor}
- \fi
- }
+ \nopagecolor%
+ }%
+ \else%
+ \xdef\thepagecolor{#1}%
+ \xdef\thepagecolornone{#1}%
+ \origpagecolour{\thepagecolornone}%
+ \fi%
+ \@esphack%
+}
\@ifundefined{nopagecolor}{%
\PackageWarning{pagecolor}{%
@@ -105,12 +112,13 @@
\@ifundefined{nopagecolor}{% no problem
}{%
\PackageError{pagecolor}{%
- \string\nopagecolor\space defined after loading package\MessageBreak%
+ \string\nopagecolor\space defined after loading package%
+ \MessageBreak%
pagecolor%
- }{\string\nopagecolor\space was defined after loading the pagecolor
- package.\MessageBreak%
- Either define \string\nopagecolor\space earlier or load the pagecolor
- package later.\MessageBreak%
+ }{\string\nopagecolor\space was defined after loading the %
+ pagecolor package.\MessageBreak%
+ Either define \string\nopagecolor\space earlier or load the %
+ pagecolor package later.\MessageBreak%
}
}%
}%
@@ -128,7 +136,8 @@
\@ifundefined{nopagecolor}{%
\PackageWarning{pagecolor}{%
Option pagecolor=none (maybe by default) used,\MessageBreak%
- but \string\nopagecolor\space is unknown. Please use another\MessageBreak%
+ but \string\nopagecolor\space is unknown. Please use another%
+ \MessageBreak%
option value; white will be used now.\MessageBreak%
}
\setkeys{pagecolor}{pagecolor=white}%
@@ -138,6 +147,15 @@
\pagecolor{\pagecolor@pagecolor}
+\newcommand{\newpagecolor}[1]{%
+\xdef\pagecolourtmpc{\thepagecolornone}%
+\pagecolor{#1}%
+}
+
+\newcommand{\restorepagecolor}{\pagecolor{\pagecolourtmpc}}
+
+\gdef\pagecolourtmpc{\thepagecolor}
+
\endinput
%%
%% End of file `pagecolor.sty'.