Could you help me to create an environment out of this code:
\smallskip\centering\framebox[0.9\textwidth]{
\begin{minipage}[c]{0.8\textwidth}
\begin{eqnarray}
I & = & -\mu\frac{W}{L}\int_{V_{S}}^{V_{D}} Q_{m} \cdot \ud{}V_{ch} \\
v_{g} - \Delta\phi_{i} - v_{ch} + \ln(\frac{q_{int}}{2}) & = & 4 q_{g} + \ln(q_{g}) + \ln\left( 1 + q_{g}\frac{C_{ox}}{C_{Si}} \right) \\
i & \approx & -q_{mD}^2 + q_{mD} - (-q_{mS}^2 + q_{mS})
\end{eqnarray}
\[\mathrm{where:} \quad v_{x} = \frac{V_{x}}{U_{T}},\ q_{int} = \frac{e n_{i} t_{Si}}{4 C_{ox} U_{T}},\ q_{x} = \frac{Q_{x}}{4 C_{ox} U_{T}},\ C_{Si} = \frac{\varepsilon_{Si}} {t_{Si}}\]
\medskip
\end{minipage}}
I have in mind something like:
\newenvironment{\MyMathBox}
{\smallskip\centering\framebox[0.9\textwidth]{
\begin{minipage}[c]{0.8\textwidth}}
{\medskip
\end{minipage}}}
The eqnarray block must be implementable inside the environment.


\usepackage{amsmath}, change{eqnarray}to{align}and remove the 2nd&on each line, i.e. change& = &to& =. It will be much nicer :) Ane related question / possible duplicate: http://tex.stackexchange.com/questions/20575/attractive-boxed-equations – yo' Mar 01 '13 at 19:22\eqnarrayvs\align. – Werner Mar 01 '13 at 19:24mdframed. it's overkill, but it should probably allow you to do what you want. – barbara beeton Mar 01 '13 at 21:26