![方程的对齐](https://linux22.com/image/380754/%E6%96%B9%E7%A8%8B%E7%9A%84%E5%AF%B9%E9%BD%90.png)
\begin{align}
\begin{split}
\label{eq:1.20}
\left( \frac{U}{2}\begin{bmatrix}
-1+\beta & 1-\beta & 0 & 0 & \hdots & 0 \\
-1-\beta & 2\beta & 1-\beta & 0 & \hdots & 0 \\
0 & -1-\beta & 2\beta & 1-\beta & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1-\beta & 1+\beta \\
\end{bmatrix} + \frac{a}{h^e}\begin{bmatrix}
1 & -1 & 0 & 0 & \hdots & 0 \\
-1 & 2 & -1 & 0 & \hdots & 0 \\
0 & -1 & 2 & -1 & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1 & 1 \\
\end{bmatrix} \right) \begin{bmatrix} T_1 \\ T_2 \\ T_3 \\ \vdots \\ T_N
\end{bmatrix} \\ = \frac{fh^e}{2}\begin{bmatrix} 1 \\ 2 \\ 2 \\ \vdots \\ 1
\end{bmatrix}
\end{split}
\end{align}
如何获取页面中心等号后面的部分?
答案1
我会这样写你的等式:
\documentclass[10pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{multline}
\label{eq:1.20}
\left(\frac{U}{2}\begin{bmatrix}
-1+\beta & 1-\beta & 0 & 0 & \dots & 0 \\
-1-\beta & 2\beta & 1-\beta & 0 & \dots & 0 \\
0 & -1-\beta & 2\beta & 1-\beta & \dots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1-\beta & 1+\beta \\
\end{bmatrix}\right. + \\
\left.\frac{a}{h^e}\begin{bmatrix}
1 & -1 & 0 & 0 & \dots & 0 \\
-1 & 2 & -1 & 0 & \dots & 0 \\
0 & -1 & 2 & -1 & \dots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1 & 1 \\
\end{bmatrix} \right) \begin{bmatrix}
T_1 \\ T_2 \\ T_3 \\ \vdots \\ T_N
\end{bmatrix}
= \frac{fh^e}{2}\begin{bmatrix}
1 \\ 2 \\ 2 \\ \vdots \\ 1
\end{bmatrix}
\end{multline}
\end{document}
答案2
你可以用gathered
它们来居中,但是它太宽了,我会用multline
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\label{eq:1.20}
\begin{gathered}
\left( \frac{U}{2}\begin{bmatrix}
-1+\beta & 1-\beta & 0 & 0 & \hdots & 0 \\
-1-\beta & 2\beta & 1-\beta & 0 & \hdots & 0 \\
0 & -1-\beta & 2\beta & 1-\beta & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1-\beta & 1+\beta \\
\end{bmatrix} + \frac{a}{h^e}\begin{bmatrix}
1 & -1 & 0 & 0 & \hdots & 0 \\
-1 & 2 & -1 & 0 & \hdots & 0 \\
0 & -1 & 2 & -1 & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1 & 1 \\
\end{bmatrix} \right) \begin{bmatrix} T_1 \\ T_2 \\ T_3 \\ \vdots \\ T_N
\end{bmatrix} \\ = \frac{fh^e}{2}\begin{bmatrix} 1 \\ 2 \\ 2 \\ \vdots \\ 1
\end{bmatrix}
\end{gathered}
\end{equation}
\begin{multline}
\label{eq:1.20}
\left( \frac{U}{2}\begin{bmatrix}
-1+\beta & 1-\beta & 0 & 0 & \hdots & 0 \\
-1-\beta & 2\beta & 1-\beta & 0 & \hdots & 0 \\
0 & -1-\beta & 2\beta & 1-\beta & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1-\beta & 1+\beta \\
\end{bmatrix}\right.\\
+ \frac{a}{h^e}\left.\begin{bmatrix}
1 & -1 & 0 & 0 & \hdots & 0 \\
-1 & 2 & -1 & 0 & \hdots & 0 \\
0 & -1 & 2 & -1 & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1 & 1 \\
\end{bmatrix}\right)\begin{bmatrix} T_1 \\ T_2 \\ T_3 \\ \vdots \\ T_N
\end{bmatrix} \\
= \frac{fh^e}{2}\begin{bmatrix} 1 \\ 2 \\ 2 \\ \vdots \\ 1
\end{bmatrix}
\end{multline}
\end{document}
答案3
另外两个变体gathered
,其中方程编号与底行对齐:
- 较小的值
\arraycolsep
并使用的medsize
环境nccmath
使得方程适合默认边距 - 如果您不需要默认边距,则加载
geometry
会提供更合理的边距,并且只使用较小的 \arraycolsep 值来适合边距。
具有两种可能性的代码(并加载了几何图形):
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{mathtools, nccmath, mleftright}
\usepackage{bigstrut}
\newenvironment{bmmatrix}{\begin{medsize}\begin{bmatrix}}%
{\end{bmatrix}\end{medsize}}
\begin{document}
\mbox{}
\begin{equation}
\setlength{\arraycolsep}{3pt}
\label{eq:1.20}
\begin{gathered}[b]
\mathclap{\mleft( \mfrac{U}{2}\begin{bmmatrix}
-1+\beta & 1-\beta & 0 & 0 & \hdots & 0 \bigstrut[t]\\
-1-\beta & 2\beta & 1-\beta & 0 & \hdots & 0 \\
0 & -1-\beta & 2\beta & 1-\beta & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1-\beta & 1+\beta \\
\end{bmmatrix} + \mfrac{a}{h^e}\begin{bmmatrix}
1 & -1 & 0 & 0 & \hdots & 0 \bigstrut[t] \\
-1 & 2 & -1 & 0 & \hdots & 0 \\
0 & -1 & 2 & -1 & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1 & 1 \\
\end{bmmatrix} \mright) \begin{bmmatrix} T_1 \bigstrut[t]\\ T_2 \\ T_3 \\ \vdots \\ T_N
\end{bmmatrix}} \\[1ex] = \mfrac{fh^e}{2}\begin{bmmatrix} 1 \bigstrut[t]\\ 2 \\ 2 \\ \vdots \\ 1
\end{bmmatrix}
\end{gathered}
\end{equation}
\vspace{3ex}
\begin{equation}
\setlength{\arraycolsep}{3pt}
\label{eq:1.20}
\begin{gathered}[b]
\left( \frac{U}{2}\begin{bmatrix}
-1+\beta & 1-\beta & 0 & 0 & \hdots & 0 \\
-1-\beta & 2\beta & 1-\beta & 0 & \hdots & 0 \\
0 & -1-\beta & 2\beta & 1-\beta & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1-\beta & 1+\beta \\
\end{bmatrix} + \frac{a}{h^e}\begin{bmatrix}
1 & -1 & 0 & 0 & \hdots & 0 \\
-1 & 2 & -1 & 0 & \hdots & 0 \\
0 & -1 & 2 & -1 & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1 & 1 \\
\end{bmatrix} \right) \begin{bmatrix} T_1 \\ T_2 \\ T_3 \\ \vdots \\ T_N
\end{bmatrix} \\ = \frac{fh^e}{2}\begin{bmatrix} 1 \\ 2 \\ 2 \\ \vdots \\ 1
\end{bmatrix}
\end{gathered}
\end{equation}
\end{document}
答案4
尝试这个
\begin{align}
\begin{split}
\label{eq:1.20}
\left( \frac{U}{2}\begin{bmatrix}
-1+\beta & 1-\beta & 0 & 0 & \hdots & 0 \\
-1-\beta & 2\beta & 1-\beta & 0 & \hdots & 0 \\
0 & -1-\beta & 2\beta & 1-\beta & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1-\beta & 1+\beta \\
\end{bmatrix}\right. &+ \left.\frac{a}{h^e}\begin{bmatrix}
1 & -1 & 0 & 0 & \hdots & 0 \\
-1 & 2 & -1 & 0 & \hdots & 0 \\
0 & -1 & 2 & -1 & \hdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & 0 & -1 & 1 \\
\end{bmatrix} \right) \begin{bmatrix} T_1 \\ T_2 \\ T_3 \\ \vdots \\ T_N
\end{bmatrix}
\\ &= \frac{fh^e}{2}\begin{bmatrix} 1 \\ 2 \\ 2 \\ \vdots \\ 1
\end{bmatrix}
\end{split}
\end{align}
希望这能有所帮助