summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx')
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx62
1 files changed, 62 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx b/Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx
new file mode 100644
index 00000000000..55559b3a1f8
--- /dev/null
+++ b/Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx
@@ -0,0 +1,62 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2010 by Ulrich M. Schwarz
+% See file COPYING for more details.
+%\fi
+%
+%\iffalse (hide this from DocInput)
+%<*shaded>
+%\fi
+% \begin{macrocode}
+ \define@key{thmdef}{shaded}[{}]{%
+ \thmt@trytwice{}{%
+ \RequirePackage{shadethm}%
+ \RequirePackage{thm-patch}%
+ \addtotheorempreheadhook[\thmt@envname]{%
+ \setlength\shadedtextwidth{\linewidth}%
+ \kvsetkeys{thmt@shade}{#1}\begin{shadebox}}%
+ \addtotheorempostfoothook[\thmt@envname]{\end{shadebox}}%
+ }%
+ }
+% There are some parameters you could set the default for (try them as is,
+% first).
+% (i) shadethmcolor The shading color of the background. See the
+% documentation for the color package, but with a `gray' model, I find .97
+% looks good out of my printer, while a darker shade like .92 is needed
+% to make it copy well. (Black is 0, white is 1.)
+% (i*) shaderulecolor The shading color of the border of the shaded box.
+% See (i). If \shadeboxrule is set to 0pt then this won't print anyway.
+% (i**) shadeboxrule The width of the border around the shading. Set it to
+% 0pt (not just 0) to make it disappear.
+% (i***) shadeboxsep The length by which the shade box surrounds the text.
+\define@key{thmt@shade}{textwidth}{\setlength\shadedtextwidth{#1}}
+\define@key{thmt@shade}{bgcolor}{\thmt@definecolor{shadethmcolor}{#1}}
+\define@key{thmt@shade}{rulecolor}{\thmt@definecolor{shaderulecolor}{#1}}
+\define@key{thmt@shade}{rulewidth}{\setlength\shadeboxrule{#1}}
+\define@key{thmt@shade}{margin}{\setlength\shadeboxsep{#1}}
+
+\def\thmt@colorlet#1#2{%
+ %\typeout{don't know how to let color `#1' be like color `#2'!}%
+ \@xa\let\csname\string\color@#1\@xa\endcsname
+ \csname\string\color@#2\endcsname
+ % this is dubious at best, we don't know what a backend does.
+}
+\AtBeginDocument{%
+ \ifcsname colorlet\endcsname
+ \let\thmt@colorlet\colorlet
+ \fi
+}
+
+\def\thmt@drop@relax#1\relax{}
+\def\thmt@definecolor#1#2{%
+ \thmt@def@color{#1}#2\thmt@drop@relax
+ {gray}{0.5}%
+ \thmt@colorlet{#1}{#2}%
+ \relax
+}
+\def\thmt@def@color#1#2#{%
+ \definecolor{#1}}
+% \end{macrocode}
+%\iffalse (hide this from DocInput)
+%</shaded>
+%\fi