![我怎样才能将方程式拆分成几行并同时将其框起来](https://linux22.com/image/422518/%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E5%B0%86%E6%96%B9%E7%A8%8B%E5%BC%8F%E6%8B%86%E5%88%86%E6%88%90%E5%87%A0%E8%A1%8C%E5%B9%B6%E5%90%8C%E6%97%B6%E5%B0%86%E5%85%B6%E6%A1%86%E8%B5%B7%E6%9D%A5.png)
我想将方程式拆分成两行,并同时将其框起来。我试过拆分,但搞不定。提前谢谢!
\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}
需要注意的一些事项。
差速器的命令确保它前面有所需的狭窄空间;此外,如果有人希望你让所有的 d 都直立(我希望不是,但是……),你可以简单地修改它的定义;
不用
\int\limits
一直输入,而是定义一个命令;我认为“给粗体变量加帽子”比“给带帽子的变量加粗”更好(您的意见可能有所不同)。
答案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}