summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pagecolor/pagecolor-example.tex
blob: 44261a2d69e4e5bd6476860001d2ee15c770a80c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
%%
%% This is file `pagecolor-example.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pagecolor.dtx  (with options: `example')
%% 
%% This is a generated file.
%% 
%% Project: pagecolor
%% Version: 2022-11-27 v1.2a
%% 
%% Copyright (C) 2011 - 2022 by
%%     H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
%% 
%% 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
%% version. This version of this license is in
%%    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 2005-12-01 or later.
%% 
%% 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,
%% the README, and the derived files
%%    pagecolor.sty, pagecolor.pdf,
%%    pagecolor.ins, pagecolor.drv,
%%    pagecolor-example.tex, pagecolor-example.pdf.
%% 
%% In memoriam
%%  Claudia Simone Barth + 1996-01-30
%%  Tommy Muench         + 2014-01-02
%%  Hans-Klaus Muench    + 2014-08-24
%% 
\NeedsTeXFormat{LaTeX2e}[2021-11-15]
\documentclass[british]{article}[2021/10/04]% v1.4n
\usepackage[%
 extension=pdf,%
 plainpages=false,%
 pdfpagelabels=true,%
 hyperindex=false,%
 pdflang={en},%
 pdftitle={pagecolor package example},%
 pdfauthor={H.-Martin Muench},%
 pdfsubject={Example for the pagecolor package},%
 pdfkeywords={LaTeX, pagecolor, thepagecolor, page color, page colour},%
 pdfview=Fit,pdfstartview=Fit,%
 pdfpagelayout=SinglePage%
]{hyperref}[2022-02-21]% v7.00n

\usepackage[x11names]{xcolor}[2021/10/31]% v2.13
 % 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-27]% v1.2a

\usepackage{afterpage}[2014/10/28]% v1.08
 % The afterpage package is generally not needed,
 % but the |\newpagecolor{somecolor}\afterpage{\restorepagecolor}|
 % construct shall be demonstrated.

\usepackage{lipsum}[2021-09-20]% v2.7
 % The lipsum package is generally not needed,
 % but some blind text is needed for the example.

\listfiles
\begin{document}
\pagenumbering{arabic}
\section*{Example for pagecolor}

This example demonstrates the use of package\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
\verb|nopagecolor={none}| (which is the default).

\noindent For more details please see the documentation!

\noindent The current page (background) color is\newline
\verb|\thepagecolor|\ =\ \thepagecolor \newline
(and \verb|\thepagecolornone|\ =\ \thepagecolornone ,
which would only be different from \verb|\thepagecolor|,
when the page color would be \verb|none|).

\pagebreak
\pagecolor{rgb:-green!40!yellow,3;green!40!yellow,2;red,1}

{\color{white} The current page (background) color is\newline
\verb|\thepagecolor|\ =\ \thepagecolor .}

{\color{\thepagecolor} And that makes this text practically invisible.}

{\color{white} Which made the preceding line of text practically
invisible, but it can be copied and pasted.}

\pagebreak
\newpagecolor{red}

This page uses \verb|\newpagecolor{red}|.

\pagebreak
\restorepagecolor

{\color{white}And this page uses \verb|\restorepagecolor| to restore
the page color 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, the page color is now
\verb|none| (because option \verb|nopagecolor={none}|), otherwise
\verb|white| (or the color given with option \verb|nopagecolor={...}|):
\newline
\verb|\thepagecolor|\ =\ \thepagecolor\ and
\verb|\thepagecolornone|\ =\ \thepagecolornone .

\pagebreak
\restorepagecolor

{\color{white}\verb|\restorepagecolor| restored the page color 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 color before it was changed to blue
here (i.\,e. green).}

\smallskip
{\color{red}\textbf{\lipsum[1-11]}}
\bigskip

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
%%
%% End of file `pagecolor-example.tex'.