我有以下 tex 代码。
\documentclass{IEEEtran}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
\lipsum[1-9]
Integer sapien est, iaculis in, pretium quis,
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at,
mollis ac, nulla. Curabitur auctor semper nulla. Donec varius
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at,
mollis ac, nulla. Curabitur auctor semper nulla. Donec varius
\begin{equation}\label{eq:init}
\Omega^{a}_{t} =
\begin{bmatrix}
(a_t)^2 &0 &0\\
0 &(a_t)^3 &0\\
0 &0 &\hspace{-2ex}(a_t)^4
\end{bmatrix},
\Omega^{b}_{t} = \hat{\Omega}^{a}_{t} =
\begin{bmatrix}
(b_t)^2 & 0\\
0 & (b_t)^4
\end{bmatrix}.
\end{equation}
\section{New section}
\lipsum[1-7]
\end{document}
我手动在 a 中添加了一些空格bmatrix
以将方程编号向上移动。
\begin{equation}\label{eq:init}
\Omega^{a}_{t} =
\begin{bmatrix}
(a_t)^2 &\hspace{-2ex}0 &\hspace{-2ex}0\\
0 &\hspace{-2ex}(a_t)^3 &\hspace{-2ex}0\\
0 &\hspace{-2ex}0 &\hspace{-2ex}(a_t)^4
\end{bmatrix},
\Omega^{b}_{t} = \hat{\Omega}^{a}_{t} =
\begin{bmatrix}
(b_t)^2 & 0\\
0 & (b_t)^4
\end{bmatrix}.
\end{equation}
然后底线就不对齐了...你知道如何将方程式编号向上移动并保持底线对齐吗?
答案1
$(a_t)^2$ 和 $a_t^2$ 之间(在数学意义上)有什么区别?如果你在方程中省略括号,它将很好地适应列宽
如果你坚持在变量周围使用括号,那么你可以使用
\setlength\arraycolsep{2pt}
after来“缩小”矩阵宽度\begin{equation}
:
\documentclass{IEEEtran}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
\lipsum[1-9]
\begin{equation}\label{eq:init}
\Omega^{a}_{t} =
\begin{bmatrix}
a_t^2 & 0 & 0\\
0 & a_t^3 & 0\\
0 & 0 & a_t^4
\end{bmatrix},
\Omega^{b}_{t} = \hat{\Omega}^{a}_{t} =
\begin{bmatrix}
b_t^2 & 0\\
0 & b_t^4
\end{bmatrix}.
\end{equation}
\begin{equation}\label{eq:init}
\setlength\arraycolsep{2pt}
\Omega^{a}_{t} =
\begin{bmatrix}
(a_t)^2 & 0 & 0\\
0 & (a_t)^3 & 0\\
0 & 0 & (a_t)^4
\end{bmatrix},
\Omega^{b}_{t} = \hat{\Omega}^{a}_{t} =
\begin{bmatrix}
(b_t)^2 & 0\\
0 & (b_t)^4
\end{bmatrix}.
\end{equation}
\section{New section}
\lipsum
\end{document}
- 关于方程溢出底部文本边框的问题,请考虑其他答案中的建议,或者看看将数学环境从 更改为
equation
(gather
在方程前/后定义了不同的垂直空间)是否可以帮助您:
\documentclass{IEEEtran}
\usepackage{amsmath}
\usepackage{lipsum}
%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\lipsum[1-9]
Integer sapien est, iaculis in, pretium quis,
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at,
mollis ac, nulla. Curabitur auctor semper nulla. Donec varius
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at,
mollis ac, nulla. Curabitur auctor semper nulla. Donec varius
\begin{gather}\label{eq:init}
\setlength\arraycolsep{2pt}
\Omega^{a}_{t} =
\begin{bmatrix}
(a_t)^2 & 0 & 0\\
0 & (a_t)^3 & 0\\
0 & 0 & (a_t)^4
\end{bmatrix},
\Omega^{b}_{t} = \hat{\Omega}^{a}_{t} =
\begin{bmatrix}
(b_t)^2 & 0\\
0 & (b_t)^4
\end{bmatrix}.
\end{gather}
\section{New section}
\lipsum
\end{document}
答案2
这明显是作弊啊,不过……
添加\vphantom
四行以使乳胶认为高度大于实际高度:
\documentclass{IEEEtran}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
\lipsum[1-9]
Integer sapien est, iaculis in, pretium quis,
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at,
mollis ac, nulla. Curabitur auctor semper nulla. Donec varius
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at,
mollis ac, nulla. Curabitur auctor semper nulla. Donec varius
\begin{equation}\label{eq:init}
\Omega^{a}_{t} =
\begin{bmatrix}
(a_t)^2 &\hspace{-2ex}0 &\hspace{-2ex}0\\
0 &\hspace{-2ex}(a_t)^3 &\hspace{-2ex}0\\
0 &\hspace{-2ex}0 &\hspace{-2ex}(a_t)^4
\end{bmatrix},
\Omega^{b}_{t} = \hat{\Omega}^{a}_{t} =
\begin{bmatrix}
(b_t)^2 & 0\\
0 & (b_t)^4
\end{bmatrix}.
\vphantom{
\begin{bmatrix}
(a_t)^2\\
(a_t)^2\\
(a_t)^2\\
(a_t)^2
\end{bmatrix}
}
\end{equation}
\section{New section}
\lipsum[1-7]
\end{document}
答案3
A\vspace{1pt}
确实解决了问题(尽管它可能不是理想的解决方案):
\documentclass{IEEEtran}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
\lipsum[1-9]
Integer sapien est, iaculis in, pretium quis,
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at,
mollis ac, nulla. Curabitur auctor semper nulla. Donec varius
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at,
mollis ac, nulla. Curabitur auctor semper nulla. Donec varius
\begin{equation}\label{eq:init}
\Omega^{a}_{t} =
\begin{bmatrix}
(a_t)^2 &\hspace{-2ex}0 &\hspace{-2ex}0\\
0 &\hspace{-2ex}(a_t)^3 &\hspace{-2ex}0\\
0 &\hspace{-2ex}0 &\hspace{-2ex}(a_t)^4
\end{bmatrix},
\Omega^{b}_{t} = \hat{\Omega}^{a}_{t} =
\begin{bmatrix}
(b_t)^2 & 0\\
0 & (b_t)^4
\end{bmatrix}.
\vspace{1pt}
\end{equation}
\section{New section}
\lipsum[1-7]
\end{document}