Custom Command cannot use equation mode?

I have defined a new command below, but when ever I pass an equation into, it will not work.

\newcommand{\defn}[1]{
{\textbf{Definition}}\\
\parbox{5.2in}{\begin{flushright} \fbox{#1}\end{flushright} } }


This is what it allows me to do:

\defn{If $f$ is integrable over the interval $[a,b]$, we define $\int_{b}^{a} f(x)\ dx$ }


However, this is what I want to do:

\defn{If $f$ is integrable over the interval $[a,b]$, we define
$$\int_{b}^{a} f(x)\ dx$$ }


Or alternatively,

 \defn{If $f$ is integrable over the interval $[a,b]$, we define
\begin{equation*}
\int_{b}^{a} f(x)\ dx
}


I would greatly appreciate any help. Thank you.

-
–  Werner Jan 25 '13 at 5:52
Why don't you just use the more standard solution using environment and theorem-like constructions, the amsthm package allows you to create theorem-like structures that are unnumbered. Then you also get the bonus of automatically added separation space above and below the construction –  daleif Jan 25 '13 at 9:17

Try:

\documentclass{article}
\newcommand{\defn}[1]{%
\textbf{Definition:}\par
\minipage{5.2cm}
#1
\endminipage
}

\begin{document}
\defn{If $f$ is integrable over the interval $[a,b]$, we define
$$\int_{b}^{a} f(x)\ dx$$
}

\end{document}


You might also consider the following alternate definition, where you can set the size as we:

\newcommand{\defn}[2]{%
\textbf{Definition:}\par
\hsize#1
#2
}

-
Thanks a lot, works great :) –  Eric Jan 25 '13 at 5:52