# How do I create a variant of the snugshade box from the framed package to wrap my definition environments in a blue box?

I'm already using snugshade to wrap my theorem environments in a grey box, but I'd like to have another bounding box just like snugshade to wrap my definitions in a blue box instead.

Here is my code:

    \documentclass[english,nohyper]{tufte-handout}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{enumitem}       % customizable list environments
\theoremstyle{definition}
\newtheorem{defn}{\protect\definitionname}
\theoremstyle{remark}
\newtheorem*{rem*}{\protect\remarkname}
\theoremstyle{definition}
\newtheorem*{example*}{\protect\examplename}
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

\usepackage[dvipsnames]{xcolor}
\usepackage{framed}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\renewcommand{\sectionmark}[1]{%
\markboth{}{\thesection.\ #1}}

\makeatother

\usepackage{babel}
\providecommand{\definitionname}{Definition}
\providecommand{\examplename}{Example}
\providecommand{\remarkname}{Remark}
\providecommand{\theoremname}{Theorem}

\begin{document}
\begin{defn}
Let $A\subseteq\mathbb{R}$ and let $f:A\rightarrow\mathbb{R}$, we
say that $f$ is \textbf{continuous }on $A$, if given $\varepsilon>0$
and $u\in A$, there exists a $\delta_{\varepsilon,u}>0$, perhaps
depending on $u$, such that
$\left|f\left(x\right)-f\left(u\right)\right|<\varepsilon\quad\text{whenever }x\in A\text{ and }\left|x-u\right|<\delta_{\varepsilon,u}$
Essentially to say that a function $f$ is continuous on $A$ is
to say that $f$ is continuous at every point $u\in A$.\end{defn}

\begin{thm}
More text\end{thm}
\end{document}

-

I would recommend you use the mdframed package instead, as that allows for page breaks and much more customization.

However, you can simply redefine shadecolor. have defined a custom Snugshade environment that allows you to specify the color

\newenvironment{Snugshade}[1][236,236,236]{
}{%
}


If not specified, it defaults to the gray you were using:

## Code:

\documentclass[english,nohyper]{tufte-handout}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{enumitem}       % customizable list environments
\theoremstyle{definition}
\newtheorem{defn}{\protect\definitionname}
\theoremstyle{remark}
\newtheorem*{rem*}{\protect\remarkname}
\theoremstyle{definition}
\newtheorem*{example*}{\protect\examplename}
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

\usepackage[dvipsnames]{xcolor}
\usepackage{framed}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\renewcommand{\sectionmark}[1]{%
\markboth{}{\thesection.\ #1}}

\makeatother

\usepackage{babel}
\providecommand{\definitionname}{Definition}
\providecommand{\examplename}{Example}
\providecommand{\remarkname}{Remark}
\providecommand{\theoremname}{Theorem}

}{%
}

\begin{document}
\begin{defn}
Let $A\subseteq\mathbb{R}$ and let $f:A\rightarrow\mathbb{R}$, we
say that $f$ is \textbf{continuous }on $A$, if given $\varepsilon>0$
and $u\in A$, there exists a $\delta_{\varepsilon,u}>0$, perhaps
depending on $u$, such that
$\left|f\left(x\right)-f\left(u\right)\right|<\varepsilon\quad\text{whenever }x\in A\text{ and }\left|x-u\right|<\delta_{\varepsilon,u}$
Essentially to say that a function $f$ is continuous on $A$ is
to say that $f$ is continuous at every point $u\in A$.\end{defn}

\begin{thm}
More text\end{thm}

\begin{thm}
More text inside default Snugshade with option 106,176,226.
\end{thm}