| 1 |
\documentclass{article} % test of LaTeX package shadethm.sty |
| 2 |
\usepackage{shadethm} |
| 3 |
\newshadetheorem{theorem}{Theorem}[section] |
| 4 |
\newshadetheorem{cor}[theorem]{Corollary} |
| 5 |
\newtheorem{remark}[theorem]{Remark} |
| 6 |
\newtheorem{unshadedtheorem}[theorem]{Theorem} |
| 7 |
\newtheorem{comment}{Comment}[section] |
| 8 |
|
| 9 |
\begin{document} |
| 10 |
Document begins with some initial text. |
| 11 |
|
| 12 |
\section{First Section} |
| 13 |
Here is some initial text before the shaded box. |
| 14 |
|
| 15 |
\begin{theorem} |
| 16 |
This is the text to be shaded. |
| 17 |
\end{theorem} |
| 18 |
|
| 19 |
This is some text after the first shade. |
| 20 |
It is separated from the environments by a blank line; that is |
| 21 |
all handled as usual in \LaTeX. |
| 22 |
\begin{cor} |
| 23 |
This is more text to be shaded. |
| 24 |
It is numbered with the same counter as the environment above. |
| 25 |
|
| 26 |
Multiple paragraphs will be handled with the usual paragraph indentation, |
| 27 |
unless of course the user asks for a different paragraph indentation inside |
| 28 |
the environment. |
| 29 |
\end{cor} |
| 30 |
This is not separated from the prior environment by a blank line and |
| 31 |
so I don't expect a new paragraph. |
| 32 |
This shows that the default is for the shaded areas have the usual text size |
| 33 |
so that shading sticks out into the margin. |
| 34 |
This is the shadethm option \emph{bodymargin}. |
| 35 |
The behavior of having the shading end at the margin |
| 36 |
(so the words do not take up the full text width) |
| 37 |
comes from the option \emph{shademargin}, invoked with |
| 38 |
\verb!\usepackage[shademargin]{shadethm}!. |
| 39 |
|
| 40 |
|
| 41 |
\begin{unshadedtheorem} |
| 42 |
More text. |
| 43 |
This time not set in shade, but it is still numbered in the same sequence. |
| 44 |
\end{unshadedtheorem} |
| 45 |
|
| 46 |
A bit more. |
| 47 |
|
| 48 |
\begin{comment} |
| 49 |
More text. |
| 50 |
This time neither set in shade, nor numbered in the same sequence. |
| 51 |
\end{comment} |
| 52 |
|
| 53 |
|
| 54 |
\section{A New Section} |
| 55 |
|
| 56 |
Section preamble. |
| 57 |
|
| 58 |
\begin{theorem} |
| 59 |
This theorem is shaded and the number has been reset by the section. |
| 60 |
\end{theorem} |
| 61 |
|
| 62 |
\begin{remark} |
| 63 |
And a closing remark |
| 64 |
\end{remark} |
| 65 |
Finishing text. |
| 66 |
|
| 67 |
\clearpage |
| 68 |
\section{A Test of Colors} |
| 69 |
This section shows how you can fool around to see some of you own colors. |
| 70 |
% Set up some lengths so that you can see the border. |
| 71 |
\setlength{\shadeboxsep}{2pt} |
| 72 |
\setlength{\shadeboxrule}{.4pt} |
| 73 |
\setlength{\shadedtextwidth}{\textwidth} |
| 74 |
\addtolength{\shadedtextwidth}{-2\shadeboxsep} |
| 75 |
\addtolength{\shadedtextwidth}{-2\shadeboxrule} |
| 76 |
\setlength{\shadeleftshift}{0pt} |
| 77 |
\setlength{\shaderightshift}{0pt} |
| 78 |
% Macro to test colors |
| 79 |
\newcommand{\thmwithcmykcolor}[2]{% |
| 80 |
\par Material before the theorem. |
| 81 |
\definecolor{shadethmcolor}{cmyk}{#1}% |
| 82 |
\definecolor{shaderulecolor}{cmyk}{#2}% |
| 83 |
\begin{theorem} |
| 84 |
This is a theorem set in the cmyk color \textbf{#1}, surrounded with a |
| 85 |
borderline set in the cmyk color \textbf{#2}. |
| 86 |
Note, for instance, that shades darken on overheads, so test your colors |
| 87 |
where you will use them. |
| 88 |
\end{theorem}} |
| 89 |
% Some colors |
| 90 |
\thmwithcmykcolor{.10,.10,0,0}{.75,.75,0,.5} |
| 91 |
\thmwithcmykcolor{.04,.04,0,.10}{.99,0,0.52,0.70} |
| 92 |
\thmwithcmykcolor{0,.13,.11,0}{0,0.88,0.85,0.35} |
| 93 |
The prior theorem illustrates what happens if you use the option |
| 94 |
\emph{colored}, as supplied in the file \verb!colored.sth!, |
| 95 |
except that the supplied file has the color stick out into the margin. |
| 96 |
|
| 97 |
One more supplied option is \emph{shadein} where each shaded theorem |
| 98 |
is indented, like a \LaTeX\ quotation. |
| 99 |
% ---> Uncomment if you want to test dvips's named colors |
| 100 |
% \newcommand{\thmwithnamedcolor}[1]{% |
| 101 |
% \par Material before the theorem. |
| 102 |
% \definecolor{shadethmcolor}{named}{#1}% |
| 103 |
% \definecolor{shaderulecolor}{named}{Black}% |
| 104 |
% \begin{theorem} |
| 105 |
% This is a theorem set in the named color \textbf{#1}, surrounded with a blac |
| 106 |
% borderline. |
| 107 |
% Note, for instance, that colors darken on overheads, so test your colors |
| 108 |
% where you will use them. |
| 109 |
% \end{theorem}} |
| 110 |
% |
| 111 |
% These are all the DVIPS named colors from color.pro (as of 1999-Aug-11). |
| 112 |
% \thmwithnamedcolor{GreenYellow} |
| 113 |
% \thmwithnamedcolor{Yellow} |
| 114 |
% \thmwithnamedcolor{Goldenrod} |
| 115 |
% \thmwithnamedcolor{Dandelion} |
| 116 |
% \thmwithnamedcolor{Apricot} |
| 117 |
% \thmwithnamedcolor{Peach} |
| 118 |
% \thmwithnamedcolor{Melon} |
| 119 |
% \thmwithnamedcolor{YellowOrange} |
| 120 |
% \thmwithnamedcolor{Orange} |
| 121 |
% \thmwithnamedcolor{BurntOrange} |
| 122 |
% \thmwithnamedcolor{Bittersweet} |
| 123 |
% \thmwithnamedcolor{RedOrange} |
| 124 |
% \thmwithnamedcolor{Mahogany} |
| 125 |
% \thmwithnamedcolor{Maroon} |
| 126 |
% \thmwithnamedcolor{BrickRed} |
| 127 |
% \thmwithnamedcolor{Red} |
| 128 |
% \thmwithnamedcolor{OrangeRed} |
| 129 |
% \thmwithnamedcolor{RubineRed} |
| 130 |
% \thmwithnamedcolor{WildStrawberry} |
| 131 |
% \thmwithnamedcolor{Salmon} |
| 132 |
% \thmwithnamedcolor{CarnationPink} |
| 133 |
% \thmwithnamedcolor{Magenta} |
| 134 |
% \thmwithnamedcolor{RedViolet} |
| 135 |
% \thmwithnamedcolor{Fuchsia} |
| 136 |
% \thmwithnamedcolor{Lavender} |
| 137 |
% \thmwithnamedcolor{Thistle} |
| 138 |
% \thmwithnamedcolor{Orchid} |
| 139 |
% \thmwithnamedcolor{DarkOrchid} |
| 140 |
% \thmwithnamedcolor{Purple} |
| 141 |
% \thmwithnamedcolor{Plum} |
| 142 |
% \thmwithnamedcolor{Violet} |
| 143 |
% \thmwithnamedcolor{RoyalPurple} |
| 144 |
% \thmwithnamedcolor{BlueViolet} |
| 145 |
% \thmwithnamedcolor{Periwinkle} |
| 146 |
% \thmwithnamedcolor{CadetBlue} |
| 147 |
% \thmwithnamedcolor{CornflowerBlue} |
| 148 |
% \thmwithnamedcolor{MidnightBlue} |
| 149 |
% \thmwithnamedcolor{NavyBlue} |
| 150 |
% \thmwithnamedcolor{RoyalBlue} |
| 151 |
% \thmwithnamedcolor{Blue} |
| 152 |
% \thmwithnamedcolor{Cerulean} |
| 153 |
% \thmwithnamedcolor{Cyan} |
| 154 |
% \thmwithnamedcolor{ProcessBlue} |
| 155 |
% \thmwithnamedcolor{SkyBlue} |
| 156 |
% \thmwithnamedcolor{Turquoise} |
| 157 |
% \thmwithnamedcolor{TealBlue} |
| 158 |
% \thmwithnamedcolor{Aquamarine} |
| 159 |
% \thmwithnamedcolor{BlueGreen} |
| 160 |
% \thmwithnamedcolor{Emerald} |
| 161 |
% \thmwithnamedcolor{JungleGreen} |
| 162 |
% \thmwithnamedcolor{SeaGreen} |
| 163 |
% \thmwithnamedcolor{Green} |
| 164 |
% \thmwithnamedcolor{ForestGreen} |
| 165 |
% \thmwithnamedcolor{PineGreen} |
| 166 |
% \thmwithnamedcolor{LimeGreen} |
| 167 |
% \thmwithnamedcolor{YellowGreen} |
| 168 |
% \thmwithnamedcolor{SpringGreen} |
| 169 |
% \thmwithnamedcolor{OliveGreen} |
| 170 |
% \thmwithnamedcolor{RawSienna} |
| 171 |
% \thmwithnamedcolor{Sepia} |
| 172 |
% \thmwithnamedcolor{Brown} |
| 173 |
% \thmwithnamedcolor{Gray} |
| 174 |
|
| 175 |
Enjoy! |
| 176 |
\textit{--Jim Hefferon} |
| 177 |
\end{document} |