4

When I try to input:

\begin{eqnarray*}
w(t) &=& \frac{1}{2}Cv^2(t)\\
\boxed{w(t) &=& \frac{1}{2}C \frac{q(t)^2}{C^2}}\\
w(t) &=& \frac{1}{2}\frac{q(t)^2}{C}\\
w(t) &=& \frac{1}{2}Cv^2(t)\\
\end{eqnarray*}

I get an error. The following code works but the box is way of to the left... (I didn't use &=& on the boxed equation this time.)

\begin{eqnarray*}
w(t) &=& \frac{1}{2}Cv^2(t)\\
\boxed{w(t) = \frac{1}{2}C \frac{q(t)^2}{C^2}}\\
w(t) &=& \frac{1}{2}\frac{q(t)^2}{C}\\
w(t) &=& \frac{1}{2}Cv^2(t)\\
\end{eqnarray*}

Are there any ways to fix this issue?

9

Why no use \Aboxed command of the package mathtools? inside of an align* environment

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
w(t) &= \frac{1}{2}Cv^2(t)\\
\Aboxed{w(t) &= \frac{1}{2}C \frac{q(t)^2}{C^2}}\\
w(t) &= \frac{1}{2}\frac{q(t)^2}{C}\\
w(t) &= \frac{1}{2}Cv^2(t)\\
\end{align*}
\end{document}

enter image description here

  • My editor doesnt want to import mathtools for some reason... – Rectifier Oct 13 '14 at 18:18
  • What system do you use? OS? Tex distribution? Editor? – skpblack Oct 13 '14 at 18:24
  • Win8, texmaker and the error I get is: 'mathtools.sly' not found – Rectifier Oct 13 '14 at 18:25
  • MiKTeX or TeXLive? – skpblack Oct 13 '14 at 18:26
  • You must install the mathtools package. If you use MiKTeX install from MiKTeX Package Manager. – skpblack Oct 13 '14 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.