Debian Codegraph @

texmf-dist/doc/latex/shadethm/shadethm-doc.tex

raw
1 \documentclass[pagesize=auto, fontsize=12pt, DIV=10]{scrartcl}
2
3 \usepackage{fixltx2e}
4 \usepackage{etex}
5 \usepackage{lmodern}
6 \usepackage[T1]{fontenc}
7 \usepackage{textcomp}
8 \usepackage{microtype}
9 \usepackage{hyperref}
10 \hypersetup{
11 colorlinks=true, % false: boxed links; true: colored links
12 linkcolor=blue, % color of internal links (change box color with linkbordercolor)
13 citecolor=blue, % color of links to bibliography
14 filecolor=blue, % color of file links
15 urlcolor=blue % color of external links
16 }
17
18 \newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
19 \newcommand*{\pkg}[1]{\textsf{#1}}
20 \newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
21 \makeatletter
22 \newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}}
23 \makeatother
24 \newcommand*{\env}[1]{\texttt{#1}}
25 \newcommand*{\opt}[1]{\texttt{#1}}
26 \newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle}
27
28 \renewcommand*{\labelenumi}{(\theenumi)}
29
30 \addtokomafont{title}{\rmfamily}
31
32 \title{The \pkg{shadethm} package}
33 \subtitle{ Shaded theorem environments in \LaTeX,\\with \cmd{\newshadetheorem} in addition to \cmd{\newtheorem}}
34 \author{Jim Hef{}feron\thanks{\mail{[email protected]}}}
35 \date{2020/01/08}
36
37
38 \begin{document}
39
40 \maketitle
41
42 \section{This package is obsolete}
43 New projects should not use this package.
44 There are a number of newer and more powerful packages that are available.
45
46 This material only remains available for people supporting existing
47 projects.
48
49
50 \section{Usage}
51
52 Used as a \LaTeXe\ style, with \verb|\usepackage{shadethm}|, it allows declarations
53 of the form \verb|\newshadetheorem{theorem}{Theorem}|, so that
54 %
55 \begin{verbatim}
56 \begin{theorem} $e=mc^2$ \end{theorem}
57 \end{verbatim}
58 %
59 will produce the usual theorem, only placed in a shaded box.
60
61
62 \minisec{Options.}
63
64 Two come in this file:
65 %
66 \begin{description}
67 \item[\opt{bodymargin} (default)]
68 The body of the shaded text lines up with the
69 margins. Just as though you called \verb|newtheorem|, then colored later.
70 Shading falls outside the margin.
71
72 \item[\opt{shademargin}]
73 The shading lines up with the margins, so the body of
74 shaded text comes out a little thinner.
75 \end{description}
76 %
77 If you call it with an option not on that list then it will look for a
78 file \texttt{\meta{Option\-Name}.sth} and take the parameters from there. See the included
79 files \texttt{shadein.sth} and \texttt{colored.sth}, the first of which gives theorems that are
80 (like \LaTeX\ quotations) indented left and right and the second of which
81 gives color shading.
82
83
84 \section{Remarks}
85
86 \begin{enumerate}
87 \item You can of course have non-shaded environments, also. The \cmd{\newtheorem}
88 command still works.
89
90 \item Numbering within: An prior version of this style required that you
91 number within like this:
92 %
93 \begin{verbatim}
94 \newshadetheorem{thm}{Theorem}
95 \newshadetheorem{note}[shadethm]{Note} % No longer needed!
96 \end{verbatim}
97 %
98 but this one drops that requirement. If you didn't use the old version,
99 forget about it.
100
101 % \item Uses the \pkg{graphics} package. Look for it in the \href{http://ctan.org/}{CTAN} \TeX-archive nearest
102 % you, for instance at \href{http://tug.ctan.org/}{\texttt{tug.ctan.org}}.
103
104 \item Works with \pkg{amsthm.sty}.
105
106 \item Notice that if you say
107 %
108 \begin{verbatim}
109 \newshadetheorem{theorem}{Theorem}
110 \end{verbatim}
111 %
112 and then
113 %
114 \begin{verbatim}
115 \newtheorem{theorem}{Theorem}
116 \end{verbatim}
117 %
118 then you will get an error message since
119 the first allows you to say\\\verb|\begin{theorem} ...|, as does the second.
120 \end{enumerate}
121
122
123 \section{Installation}
124
125 Put this where your \TeX\ looks for \texttt{.sty} files.
126 There are some parameters you could set the default for (try them as is,
127 first).
128 %
129 \begingroup
130 \newcommand*{\desc}[1]{{\usekomafont{descriptionlabel}#1}\quad}%
131 \renewcommand*{\theenumi}{\roman{enumi}}%
132 \leftmargini = 1.5 \leftmargini
133 \begin{enumerate}
134 \item \label{item:i}\desc{\texttt{shadethmcolor}}
135 The shading color of the background. See the
136 documentation for the \pkg{color} package, but with a `gray' model, I~find .97
137 looks good out of my printer, while a darker shade like~.92 is needed
138 to make it copy well. (Black is~0, white is~1.)
139
140 \item \desc{\texttt{shaderulecolor}}
141 The shading color of the border of the shaded box.
142 See (\ref{item:i}). If \cmd{\shadeboxrule} is set to 0\,pt then this won't print anyway.
143
144 \item \desc{\cmd{\shadeboxrule}}
145 The width of the border around the shading. Set it to
146 0\,pt (not just 0) to make it disappear.
147
148 \item \desc{\cmd{\shadeboxsep}}
149 The length by which the shade box surrounds the text.
150
151 \item \desc{\cmd{\shadesetinsideminipage}}
152 The theorems are set inside a \env{minipage} to
153 get line breaks, but some things, like paragraph indents, are messed
154 with there, so I~have a hook to reset them. Probably you can just
155 leave this alone.
156
157 \item The default option. Change the \verb|\ExecuteOptions{...}| right before
158 the \cmd{\ProcessOptions}.
159 \end{enumerate}
160 \endgroup
161
162
163 \minisec{Comment:}
164
165 If you get an error about `undefined color model' then you need to create
166 the file \texttt{color.cfg} in the same place as \texttt{color.sty}, and put in it the line
167 %
168 \begin{verbatim}
169 \ExecuteOptions{dvips}
170 \end{verbatim}
171 %
172 (or~whatever is the name of your driver). See the
173 documentation for the \pkg{graphics} package. I~needed this in the distant past
174 under N\TeX.
175
176
177 \section{Bugs}
178
179 Note that this material is obsolete.
180 The bug listed will not be fixed.
181
182 \begin{enumerate}
183 \item Page breaks are a problem since it sets the theorem before it is shaded.
184 The theorem is put into a \env{minipage} in order to have the right line breaks
185 put in, but then can't be broken across pages.
186 \end{enumerate}
187
188
189 \section{License}
190
191 Copyright 1999-2020 Jim Hefferon \mail{[email protected]}.
192
193 This program can redistributed and/or modified under the terms
194 of the \LaTeX\ Project Public License Distributed from CTAN
195 archives in directory \href{http://ctan.org/macros/latex/base/lppl.txt}{\nolinkurl{macros/latex/base/lppl.txt}}; either
196 version~1 of the License, or (at your option) any later version.
197
198 \clearpage
199
200
201 \section{History}
202
203 \begin{description}
204 \item[\texttt{20I08} jh \mail{[email protected]}] Declare package obsolete to keep people from mistakenly starting new projects with it.
205 \item[\texttt{99XI23} jh] Redid the parsing to stick to \cmd{\newcommand}-style calls. Needed
206 to put in some oppresive \cmd{\expandafter} strings.
207 \item[\texttt{99VII09} jh \mail{[email protected]}] Fixed the number within situation. LPPL
208 added.
209 \item[\texttt{97I07} jh] Changed the interior of the \cmd{\DeclareOptions} to \cmd{\AtBeginDocument}
210 for cases where the \cmd{\textwidth} is changed.
211 \item[\texttt{95VI19} jh] Adapted for \LaTeXe. Now uses the \pkg{graphics} package, and all
212 the neat \LaTeXe\ package stuff. Still haven't rewritten the parsing code to
213 use the new optional arguments to \cmd{\newcommand}, though. Ah well.
214 \item[\texttt{94VII11} jim hefferon \mail{[email protected]}.] First written (after lots
215 of sporadic tries, over months; I couldn't get any of the extant shading
216 macros to work with theorems) from a hint in TvZ's \texttt{Fancybox} writeup.
217 It's all so easy once you know how.
218 \end{description}
219
220
221 \end{document}