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 172 173 174 175 176 177
|
\documentclass{article} % test of LaTeX package shadethm.sty
\usepackage{shadethm}
\newshadetheorem{theorem}{Theorem}[section]
\newshadetheorem{cor}[theorem]{Corollary}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{unshadedtheorem}[theorem]{Theorem}
\newtheorem{comment}{Comment}[section]
\begin{document}
Document begins with some initial text.
\section{First Section}
Here is some initial text before the shaded box.
\begin{theorem}
This is the text to be shaded.
\end{theorem}
This is some text after the first shade.
It is separated from the environments by a blank line; that is
all handled as usual in \LaTeX.
\begin{cor}
This is more text to be shaded.
It is numbered with the same counter as the environment above.
Multiple paragraphs will be handled with the usual paragraph indentation,
unless of course the user asks for a different paragraph indentation inside
the environment.
\end{cor}
This is not separated from the prior environment by a blank line and
so I don't expect a new paragraph.
This shows that the default is for the shaded areas have the usual text size
so that shading sticks out into the margin.
This is the shadethm option \emph{bodymargin}.
The behavior of having the shading end at the margin
(so the words do not take up the full text width)
comes from the option \emph{shademargin}, invoked with
\verb!\usepackage[shademargin]{shadethm}!.
\begin{unshadedtheorem}
More text.
This time not set in shade, but it is still numbered in the same sequence.
\end{unshadedtheorem}
A bit more.
\begin{comment}
More text.
This time neither set in shade, nor numbered in the same sequence.
\end{comment}
\section{A New Section}
Section preamble.
\begin{theorem}
This theorem is shaded and the number has been reset by the section.
\end{theorem}
\begin{remark}
And a closing remark
\end{remark}
Finishing text.
\clearpage
\section{A Test of Colors}
This section shows how you can fool around to see some of you own colors.
% Set up some lengths so that you can see the border.
\setlength{\shadeboxsep}{2pt}
\setlength{\shadeboxrule}{.4pt}
\setlength{\shadedtextwidth}{\textwidth}
\addtolength{\shadedtextwidth}{-2\shadeboxsep}
\addtolength{\shadedtextwidth}{-2\shadeboxrule}
\setlength{\shadeleftshift}{0pt}
\setlength{\shaderightshift}{0pt}
% Macro to test colors
\newcommand{\thmwithcmykcolor}[2]{%
\par Material before the theorem.
\definecolor{shadethmcolor}{cmyk}{#1}%
\definecolor{shaderulecolor}{cmyk}{#2}%
\begin{theorem}
This is a theorem set in the cmyk color \textbf{#1}, surrounded with a
borderline set in the cmyk color \textbf{#2}.
Note, for instance, that shades darken on overheads, so test your colors
where you will use them.
\end{theorem}}
% Some colors
\thmwithcmykcolor{.10,.10,0,0}{.75,.75,0,.5}
\thmwithcmykcolor{.04,.04,0,.10}{.99,0,0.52,0.70}
\thmwithcmykcolor{0,.13,.11,0}{0,0.88,0.85,0.35}
The prior theorem illustrates what happens if you use the option
\emph{colored}, as supplied in the file \verb!colored.sth!,
except that the supplied file has the color stick out into the margin.
One more supplied option is \emph{shadein} where each shaded theorem
is indented, like a \LaTeX\ quotation.
% ---> Uncomment if you want to test dvips's named colors
% \newcommand{\thmwithnamedcolor}[1]{%
% \par Material before the theorem.
% \definecolor{shadethmcolor}{named}{#1}%
% \definecolor{shaderulecolor}{named}{Black}%
% \begin{theorem}
% This is a theorem set in the named color \textbf{#1}, surrounded with a blac
% borderline.
% Note, for instance, that colors darken on overheads, so test your colors
% where you will use them.
% \end{theorem}}
%
% These are all the DVIPS named colors from color.pro (as of 1999-Aug-11).
% \thmwithnamedcolor{GreenYellow}
% \thmwithnamedcolor{Yellow}
% \thmwithnamedcolor{Goldenrod}
% \thmwithnamedcolor{Dandelion}
% \thmwithnamedcolor{Apricot}
% \thmwithnamedcolor{Peach}
% \thmwithnamedcolor{Melon}
% \thmwithnamedcolor{YellowOrange}
% \thmwithnamedcolor{Orange}
% \thmwithnamedcolor{BurntOrange}
% \thmwithnamedcolor{Bittersweet}
% \thmwithnamedcolor{RedOrange}
% \thmwithnamedcolor{Mahogany}
% \thmwithnamedcolor{Maroon}
% \thmwithnamedcolor{BrickRed}
% \thmwithnamedcolor{Red}
% \thmwithnamedcolor{OrangeRed}
% \thmwithnamedcolor{RubineRed}
% \thmwithnamedcolor{WildStrawberry}
% \thmwithnamedcolor{Salmon}
% \thmwithnamedcolor{CarnationPink}
% \thmwithnamedcolor{Magenta}
% \thmwithnamedcolor{RedViolet}
% \thmwithnamedcolor{Fuchsia}
% \thmwithnamedcolor{Lavender}
% \thmwithnamedcolor{Thistle}
% \thmwithnamedcolor{Orchid}
% \thmwithnamedcolor{DarkOrchid}
% \thmwithnamedcolor{Purple}
% \thmwithnamedcolor{Plum}
% \thmwithnamedcolor{Violet}
% \thmwithnamedcolor{RoyalPurple}
% \thmwithnamedcolor{BlueViolet}
% \thmwithnamedcolor{Periwinkle}
% \thmwithnamedcolor{CadetBlue}
% \thmwithnamedcolor{CornflowerBlue}
% \thmwithnamedcolor{MidnightBlue}
% \thmwithnamedcolor{NavyBlue}
% \thmwithnamedcolor{RoyalBlue}
% \thmwithnamedcolor{Blue}
% \thmwithnamedcolor{Cerulean}
% \thmwithnamedcolor{Cyan}
% \thmwithnamedcolor{ProcessBlue}
% \thmwithnamedcolor{SkyBlue}
% \thmwithnamedcolor{Turquoise}
% \thmwithnamedcolor{TealBlue}
% \thmwithnamedcolor{Aquamarine}
% \thmwithnamedcolor{BlueGreen}
% \thmwithnamedcolor{Emerald}
% \thmwithnamedcolor{JungleGreen}
% \thmwithnamedcolor{SeaGreen}
% \thmwithnamedcolor{Green}
% \thmwithnamedcolor{ForestGreen}
% \thmwithnamedcolor{PineGreen}
% \thmwithnamedcolor{LimeGreen}
% \thmwithnamedcolor{YellowGreen}
% \thmwithnamedcolor{SpringGreen}
% \thmwithnamedcolor{OliveGreen}
% \thmwithnamedcolor{RawSienna}
% \thmwithnamedcolor{Sepia}
% \thmwithnamedcolor{Brown}
% \thmwithnamedcolor{Gray}
Enjoy!
\textit{--Jim Hefferon}
\end{document}
|