# How can I use more than one color in shadethm package?

I know that we can change the default color given in shadethm package using, for example, \definecolor{shadethmcolor}{HTML}{F7F8E0}. But if I want to use different colors for different environments in the above fashion, what should I do? For example, say I have:

\newshadetheorem{env1}


and I want that color only for the first enviroment, and a second color for the other.

Here's one possibility:

\documentclass{article}
\usepackage{xcolor}
\usepackage{xparse}

\NewDocumentEnvironment{lemma}{o}
\IfNoValueTF{#1}
{\begin{env2}}
{\begin{env2}[#1]}
}
{\end{env2}}
\NewDocumentEnvironment{proposition}{o}
\IfNoValueTF{#1}
{\begin{env3}}
{\begin{env3}[#1]}
}
{\end{env3}}

\begin{document}

\begin{env1}
\end{env1}

\begin{lemma}
\end{lemma}

\begin{proposition}
\end{proposition}

\end{document}


The result:

However, I'd like to suggest you a more versatile approach using either thmtools ot tcolorbox. Here's an example using thmtools interaction with shadethm:

\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{amsthm}
\usepackage{thmtools}

\definecolor{mycolor}{HTML}{F7F8E0}

\begin{document}

\begin{theorem}
\end{theorem}

\begin{lemma}

• This is very nice, thanks. And I actually found your second suggestion easier. But I'm having trouble with the numbering though. If I want some abbreviation together with it, say, I'd try \declaretheorem[shaded={bgcolor=mycolor}]{prop}{Proposition}[section], but it didn't work. Is there a way to go around this? – Ivo Terek Aug 27 '15 at 19:03
• @IvoTerek You're welcome. The syntax is \declaretheorem[shaded={bgcolor=mycolor},within=section,name=Proposition]{prop}. – Gonzalo Medina Aug 27 '15 at 19:06