| 1 |
%% |
| 2 |
%% This is file `pagecolor-example.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% pagecolor.dtx (with options: `example') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Project: pagecolor |
| 12 |
%% Version: 2025-01-28 v1.2d |
| 13 |
%% Info: Provides thepagecolor |
| 14 |
%% |
| 15 |
%% Copyright (C) 2011 - 2025 by |
| 16 |
%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de> |
| 17 |
%% |
| 18 |
%% This work may be distributed and/or modified under the |
| 19 |
%% conditions of the LaTeX Project Public License, either |
| 20 |
%% version 1.3c of this license or (at your option) any later |
| 21 |
%% version. This version of this license is in |
| 22 |
%% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 23 |
%% and the latest version of this license is in |
| 24 |
%% https://www.latex-project.org/lppl.txt |
| 25 |
%% and version 1.3c or later is part of all distributions of |
| 26 |
%% LaTeX version 2005-12-01 or later. |
| 27 |
%% |
| 28 |
%% This work has the LPPL maintenance status "maintained". |
| 29 |
%% |
| 30 |
%% The Current Maintainer of this work is H.-Martin Muench. |
| 31 |
%% |
| 32 |
%% This work consists of the main source file pagecolor.dtx, |
| 33 |
%% the README, and the derived files |
| 34 |
%% pagecolor.sty, pagecolor.pdf, |
| 35 |
%% pagecolor.ins, pagecolor.drv, |
| 36 |
%% pagecolor-example.tex, pagecolor-example.pdf. |
| 37 |
%% |
| 38 |
%% In memoriam |
| 39 |
%% Claudia Simone Barth + 1996-01-30 |
| 40 |
%% Tommy Muench + 2014-01-02 |
| 41 |
%% Hans-Klaus Muench + 2014-08-24 |
| 42 |
%% |
| 43 |
\NeedsTeXFormat{LaTeX2e}[2024-11-01] |
| 44 |
\documentclass[british]{article}[2024/06/29]% v1.4n Standard LaTeX document class |
| 45 |
\usepackage[extension=pdf,% |
| 46 |
plainpages=false,% |
| 47 |
pdfpagelabels=true,% |
| 48 |
hyperindex=false,% |
| 49 |
pdflang={en},% |
| 50 |
pdftitle={pagecolor package example},% |
| 51 |
pdfauthor={H.-Martin Muench},% |
| 52 |
pdfsubject={Example for the pagecolor package},% |
| 53 |
pdfkeywords={LaTeX, pagecolor, thepagecolor, page color, page colour},% |
| 54 |
pdfview=Fit,pdfstartview=Fit,% |
| 55 |
pdfpagelayout=SinglePage% |
| 56 |
]{hyperref}[2024-11-05]% v7.01l Hypertext links for LaTeX |
| 57 |
|
| 58 |
\usepackage[x11names]{xcolor}[2024/09/29]% v3.02 LaTeX color extensions (UK) |
| 59 |
% The xcolor package would not be needed for just using the base colors. |
| 60 |
% The color package would be sufficient for that. |
| 61 |
|
| 62 |
% \usepackage[cam,center,a3]{crop}[2017/11/19]% v1.10 |
| 63 |
|
| 64 |
\usepackage[pagecolor={LightGoldenrod1},% |
| 65 |
nopagecolor={none}]{pagecolor}[2025-01-28]% v1.2d Provides thepagecolor (HMM) |
| 66 |
|
| 67 |
\usepackage{afterpage}[2023/07/04]% v1.08 After-Page Package (DPC) |
| 68 |
% The afterpage package is generally not needed, |
| 69 |
% but the |\newpagecolor{somecolor}\afterpage{\restorepagecolor}| |
| 70 |
% construct shall be demonstrated. |
| 71 |
|
| 72 |
\usepackage{lipsum}[2021-09-20]% v2.7 150 paragraphs of Lorem Ipsum dummy text |
| 73 |
% The lipsum package is generally not needed, |
| 74 |
% but some blind text is needed for the example. |
| 75 |
|
| 76 |
\listfiles |
| 77 |
\begin{document} |
| 78 |
\pagenumbering{arabic} |
| 79 |
\section*{Example for pagecolor} |
| 80 |
|
| 81 |
This example demonstrates the use of package\newline |
| 82 |
\textsf{pagecolor}, v1.2d as of 2025-01-28 (HMM).\newline |
| 83 |
The used options were\newline |
| 84 |
\verb|pagecolor={LightGoldenrod1}|\newline |
| 85 |
(\verb|pagecolor={none}| would be the default), and\newline |
| 86 |
\verb|nopagecolor={none}| (which is the default). |
| 87 |
|
| 88 |
\noindent For more details please see the documentation! |
| 89 |
|
| 90 |
\noindent The current page (background) color is\newline |
| 91 |
\verb|\thepagecolor|\ =\ \thepagecolor \newline |
| 92 |
(and \verb|\thepagecolornone|\ =\ \thepagecolornone , |
| 93 |
which would only be different from \verb|\thepagecolor|, |
| 94 |
when the page color would be \verb|none|). |
| 95 |
|
| 96 |
\newpage |
| 97 |
\pagecolor{rgb:-green!40!yellow,3;green!40!yellow,2;red,1} |
| 98 |
|
| 99 |
{\color{white} The current page (background) color is\newline |
| 100 |
\verb|\thepagecolor|\ =\ \thepagecolor .} |
| 101 |
|
| 102 |
{\color{\thepagecolor} And that makes this text practically invisible.} |
| 103 |
|
| 104 |
{\color{white} Which made the preceding line of text practically |
| 105 |
invisible, but it can be copied and pasted.} |
| 106 |
|
| 107 |
\newpage |
| 108 |
\newpagecolor{red} |
| 109 |
|
| 110 |
This page uses \verb|\newpagecolor{red}|. |
| 111 |
|
| 112 |
\newpage |
| 113 |
\restorepagecolor |
| 114 |
|
| 115 |
{\color{white}And this page uses \verb|\restorepagecolor| to restore |
| 116 |
the page color to the value it had before the red page.} |
| 117 |
|
| 118 |
\newpage |
| 119 |
\pagecolor{none} |
| 120 |
|
| 121 |
This page uses \verb|\pagecolor{none}|. If the \verb|\nopagecolor| |
| 122 |
command is known, the page color is now |
| 123 |
\verb|none| (because option \verb|nopagecolor={none}|), otherwise |
| 124 |
\verb|white| (or the color given with option \verb|nopagecolor={...}|): |
| 125 |
\newline |
| 126 |
\verb|\thepagecolor|\ =\ \thepagecolor\ and |
| 127 |
\verb|\thepagecolornone|\ =\ \thepagecolornone . |
| 128 |
|
| 129 |
\newpage |
| 130 |
\restorepagecolor |
| 131 |
|
| 132 |
{\color{white}\verb|\restorepagecolor| restored the page color again.} |
| 133 |
|
| 134 |
\newpage |
| 135 |
\pagecolor{green} |
| 136 |
|
| 137 |
This page is green due to \verb|\pagecolor{green}|. |
| 138 |
|
| 139 |
\newpage |
| 140 |
\newpagecolor{blue}\afterpage{\restorepagecolor} |
| 141 |
|
| 142 |
{\color{white}\verb|\newpagecolor{blue}\afterpage{\restorepagecolor}|% |
| 143 |
\newline |
| 144 |
was used here, i.\,e.~this page is blue, and the next one will |
| 145 |
automatically have the same page color before it was changed to blue |
| 146 |
here (i.\,e. green).} |
| 147 |
|
| 148 |
\smallskip |
| 149 |
{\color{red}\textbf{\lipsum[1-11]}} |
| 150 |
\bigskip |
| 151 |
|
| 152 |
The page color was changed back at the end of the page -- |
| 153 |
in mid-sentence! |
| 154 |
|
| 155 |
\newpage |
| 156 |
\backgroundpagecolor{pink} |
| 157 |
|
| 158 |
When activating the loading of the crop package in the preamble of this |
| 159 |
document, \verb|\backgroundpagecolor{<|\textit{some color}\verb|>}| |
| 160 |
changes the color of the background/outer/physical page. |
| 161 |
|
| 162 |
\newpage |
| 163 |
\newbackgroundpagecolor{blue} |
| 164 |
|
| 165 |
Analogous to \verb|\newpagecolor{...}| and \verb|\restorepagecolor|, |
| 166 |
for the background/outer/physical page |
| 167 |
\verb|\newbackgroundpagecolor{<|\textit{some color}\verb|>}| and\linebreak |
| 168 |
\verb|\restorebackgroundpagecolor| are provided. |
| 169 |
|
| 170 |
Here \verb|\newbackgroundpagecolor{blue}| colored that |
| 171 |
background/outer/physical page in blue (if crop is used). |
| 172 |
|
| 173 |
\newpage |
| 174 |
\restorebackgroundpagecolor |
| 175 |
|
| 176 |
And here the pink color of the background/outer/physical page |
| 177 |
was restored by \verb|\restorebackgroundpagecolor| (if crop is used). |
| 178 |
|
| 179 |
\end{document} |
| 180 |
\endinput |
| 181 |
%% |
| 182 |
%% End of file `pagecolor-example.tex'. |