2

I want to split my equation into two lines and have it boxed at the same time. I've tried split but can't figure it out. Thanks in advance!

\begin{equation}
    \boxed{
     \int \limits_{\Omega} \frac{1}{\mu}\nabla\times\mathbf{A}\cdot\nabla\times\mathbf{\hat{A}}d\Omega + \int \limits_{\Omega_{b}} \sigma\frac{\partial \mathbf{A}}{\partial t}\cdot\mathbf{\hat{A}}d\Omega_{b} +
\int \limits_{\Omega_{b}} \sigma\frac{\partial(\nabla V)}{\partial t}\cdot\mathbf{\hat{A}}d\Omega_{b} = \int \limits_{\Gamma_{b}} \left[\frac{1}{\mu}\nabla\times\mathbf{A}\times\mathbf{n}\right]\cdot\mathbf{\hat{A}}d\Gamma_{b}}
    \label{eq:debil1}
\end{equation}

3 Answers 3

4

It is not clear (to me), what you like to have in box. So, below are two options:

\documentclass[margin=3mm, preview]{standalone} % you not say, which document class you use ...
\usepackage{amsmath}

\begin{document}
\begin{equation}\label{eq:debil1}
\boxed{
\begin{split}
& \int\limits_{\Omega} \frac{1}{\mu}\nabla\times\mathbf{A}\cdot\nabla\times\mathbf{\hat{A}}d\Omega +
\int\limits_{\Omega_{b}} 
    \sigma\frac{\partial\mathbf{A}}{\partial t}\cdot\mathbf{\hat{A}}d\Omega_b +
    \int\limits_{\Omega_{b}} \sigma\frac{\partial(\nabla V)}{\partial t} \cdot\mathbf{\hat{A}}d\Omega_b  \\
& = \int\limits_{\Gamma_{b}}
    \left[\frac{1}{\mu}\nabla\times\mathbf{A}\times\mathbf{n}\right]
    \cdot\mathbf{\hat{A}}d\Gamma_b
\end{split}
}
\end{equation}

or 

\medskip
\fbox{\begin{minipage}{\dimexpr\textwidth-2\fboxsep+2\fboxrule\relax}
\begin{equation}\label{eq:debil1}
\begin{split}
& \int\limits_{\Omega} \frac{1}{\mu}\nabla\times\mathbf{A}\cdot\nabla\times\mathbf{\hat{A}}d\Omega +
\int\limits_{\Omega_{b}}
    \sigma\frac{\partial\mathbf{A}}{\partial t}\cdot\mathbf{\hat{A}}d\Omega_b +
    \int\limits_{\Omega_{b}} \sigma\frac{\partial(\nabla V)}{\partial t} \cdot\mathbf{\hat{A}}d\Omega_b  \\
& = \int\limits_{\Gamma_{b}}
        \left[\frac{1}{\mu}\nabla\times\mathbf{A}\times\mathbf{n}\right]
        \cdot\mathbf{\hat{A}}d\Gamma_b
\end{split}
\end{equation}
    \end{minipage}}
\end{document}

enter image description here

1
  • Great! I wanted the first option. Thank you very much! Commented Oct 19, 2020 at 3:04
2

I have two proposals, one with aligned and one with multlined.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools} % necessary for the second solution

\newcommand{\intl}{\int\limits}
\newcommand{\diff}{\mathop{}\!d}

\begin{document}

\begin{equation}
\label{eq:debil1}
  \boxed{
    \begin{aligned}
    &\!% because of the following \int
    \intl_{\Omega}
      \frac{1}{\mu}\nabla\times\mathbf{A}\cdot\nabla\times\hat{\mathbf{A}}
    \diff\Omega
    +
    \intl_{\Omega_{b}}
      \sigma\frac{\partial \mathbf{A}}{\partial t}\cdot\hat{\mathbf{A}}
    \diff\Omega_{b}
    +
    \intl_{\Omega_{b}}
      \sigma\frac{\partial(\nabla V)}{\partial t}\cdot\hat{\mathbf{A}}
    \diff\Omega_{b}
    \\
    &=
    \intl_{\Gamma_{b}}
      \left[\frac{1}{\mu}\nabla\times\mathbf{A}\times\mathbf{n}\right]\cdot\hat{\mathbf{A}}
    \diff\Gamma_{b}
    \end{aligned}
  }% end of \boxed
\end{equation}

\begin{equation}
\label{eq:debil1-bis}
  \boxed{
    \begin{multlined}
    \intl_{\Omega}
      \frac{1}{\mu}\nabla\times\mathbf{A}\cdot\nabla\times\hat{\mathbf{A}}
    \diff\Omega
    +
    \intl_{\Omega_{b}}
      \sigma\frac{\partial \mathbf{A}}{\partial t}\cdot\hat{\mathbf{A}}
    \diff\Omega_{b}
    +
    \intl_{\Omega_{b}}
      \sigma\frac{\partial(\nabla V)}{\partial t}\cdot\hat{\mathbf{A}}
    \diff\Omega_{b}
    \\
    =
    \intl_{\Gamma_{b}}
      \left[\frac{1}{\mu}\nabla\times\mathbf{A}\times\mathbf{n}\right]\cdot\hat{\mathbf{A}}
    \diff\Gamma_{b}
    \end{multlined}
  }% end of \boxed
\end{equation}

\end{document}

Some points to note.

  1. the command for the differential ensures the required thin space in front of it; also, you can simply modify its definition if somebody wants you to make all d’s upright (I hope not, but…);

  2. instead of typing \int\limits all along, define a command;

  3. I think that “hatting a boldface variable” is better than “boldfacing a hatted variable” (your opinion may vary).

1
  • Thanks a lot. I will take a note on those tips you gave me! Commented Oct 19, 2020 at 3:05
-1

The breqn package -- http://www.tug.org/TUGboat/Articles/tb18-3/tb56down.pdf

enter image description here

\documentclass[10pt,a4paper]{article}

\usepackage{amsmath}

\usepackage{breqn}
\begin{document}

\begin{dmath*}
 \int \limits_{\Omega} \frac{1}{\mu}\nabla\times\mathbf{A}\cdot\nabla\times\mathbf{\hat{A}}d\Omega + \int \limits_{\Omega_{b}} \sigma\frac{\partial \mathbf{A}}{\partial t}\cdot\mathbf{\hat{A}}d\Omega_{b} +
\int \limits_{\Omega_{b}} \sigma\frac{\partial(\nabla V)}{\partial t}\cdot\mathbf{\hat{A}}d\Omega_{b} = \int \limits_{\Gamma_{b}} \left[\frac{1}{\mu}\nabla\times\mathbf{A}\times\mathbf{n}\right]\cdot\mathbf{\hat{A}}d\Gamma_{b}
\end{dmath*}

\end{document}
1
  • 2
    This doesn't solve the problem of boxing the result.
    – egreg
    Commented Oct 18, 2020 at 8:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .