我有代码
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\DeclareMathOperator{\Tr}{Tr}
\begin{document}
\begin{eqnarray}
\hat K_0(\omega,\kappa_1) &=& \hat J_1(\omega,\kappa_1)J_0(\omega,\kappa_1) \nonumber\\
&=& \begin{bmatrix} r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L} & r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L} \\ r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L} & r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L} \end{bmatrix}
\begin{bmatrix} r_0^{+}(\omega) & r_0^{-}(\omega) \\ r_0^{-}(\omega) & r_0^{+}(\omega)\end{bmatrix} \nonumber\\
&=& \begin{bmatrix} r_0^{+}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L} + r_0^{-}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L} & r_0^{-}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L} + r_0^{+}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L} \\ r_0^{+}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L} + r_0^{-}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L} & r_0^{-}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L} + r_0^{+}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L} \end{bmatrix} \nonumber\\
&=& \begin{bmatrix} \hat U(\omega) & \hat G(\omega) \\ \hat V(\omega) & \hat H(\omega) \end{bmatrix}. \nonumber\\
\end{eqnarray}
\end{document}
矩阵方程溢出到页眉。我该如何让它适合我的页面?
答案1
总是使用align..
而不是eqnarray
已经节省了一半所需空间,那么也许:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\DeclareMathOperator{\Tr}{Tr}
\begin{document}
\begin{equation}
\begin{aligned}
\hat K_0(\omega,\kappa_1) & = \hat J_1(\omega,\kappa_1)J_0(\omega,\kappa_1)\\
&= \begin{bmatrix} r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L} & r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L} \\r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L} & r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L} \end{bmatrix}
\begin{bmatrix} r_0^{+}(\omega) & r_0^{-}(\omega) \\r_0^{-}(\omega) & r_0^{+}(\omega)\end{bmatrix} \\
&= \begin{bmatrix}
\begin{aligned}r_0^{+}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L}\qquad \\{}+ r_0^{-}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L}\end{aligned} &
\begin{aligned}r_0^{-}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L}\qquad \\{}+ r_0^{+}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L}\end{aligned} \\[15pt]
\begin{aligned}r_0^{+}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L}\qquad \\{}+ r_0^{-}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L}\end{aligned} &
\begin{aligned}r_0^{-}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L}\qquad \\{}+ r_0^{+}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L}\end{aligned} \end{bmatrix}\\
&= \begin{bmatrix} \hat U(\omega) & \hat G(\omega) \\ \hat V(\omega) & \hat H(\omega) \end{bmatrix}.\\
\end{aligned}
\end{equation}
\end{document}
答案2
(红线表示文本边框)
使用mathools
(用于\MoveEqLeft
)和nccmath
(用于中等尺寸mmatrix
):
\documentclass{article}
\usepackage{nccmath, mathtools, amssymb}
\DeclareMathOperator{\Tr}{Tr}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{align*}
\MoveEqLeft
\hat K_0(\omega,\kappa_1) \notag \\
& = \hat J_1(\omega,\kappa_1)J_0(\omega,\kappa_1)
\notag \\
& = \begin{bmatrix}
r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L}
& r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L} \\
r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L}
& r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L}
\end{bmatrix}
\begin{bmatrix}
r_0^{+}(\omega) & r_0^{-}(\omega) \\
r_0^{-}(\omega) & r_0^{+}(\omega)
\end{bmatrix} \\
& = \left[\begin{mmatrix}
r_0^{+}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L} + r_0^{-}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L} & r_0^{-}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{-}L} + r_0^{+}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{+}L} \\ r_0^{+}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L} + r_0^{-}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L} & r_0^{-}(\omega) r_1^{-}(\omega)e^{i \bar \lambda_1^{-}L} + r_0^{+}(\omega) r_1^{+}(\omega)e^{i \bar \lambda_1^{+}L} \end{mmatrix}\right] \notag \\
& = \begin{bmatrix}
\hat U(\omega) & \hat G(\omega) \\
\hat V(\omega) & \hat H(\omega)
\end{bmatrix}. \notag
\end{align}
\end{document}
eqnarray
注意:不推荐使用,而应使用align
from amsmath
。