我怎样才能将方程式拆分成几行并同时将其框起来

我怎样才能将方程式拆分成几行并同时将其框起来

我想将方程式拆分成两行,并同时将其框起来。我试过拆分,但搞不定。提前谢谢!

\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}

答案1

我不清楚你喜欢在盒子里放什么。因此,以下是两个选项:

\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}

在此处输入图片描述

答案2

我有两个建议,一个是aligned,一个是multlined

在此处输入图片描述

\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}

需要注意的一些事项。

  1. 差速器的命令确保它前面有所需的狭窄空间;此外,如果有人希望你让所有的 d 都直立(我希望不是,但是……),你可以简单地修改它的定义;

  2. 不用\int\limits一直输入,而是定义一个命令;

  3. 我认为“给粗体变量加帽子”比“给带帽子的变量加粗”更好(您的意见可能有所不同)。

答案3

包裹breqn——http://www.tug.org/TUGboat/Articles/tb18-3/tb56down.pdf

在此处输入图片描述

\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}

相关内容