我正在使用以下代码,但获得的结果未设置在空间中(页面的左列)。我的页面上有它,但它与页面右列的文本重叠。我怎样才能减小数学方程的大小,或者有没有其他方法可以让它稳定在那个特定的空间中?
\Bigg(
\begin{tabular}{c}
$x_n$ \\
$y_n$ \\
$z_n$
\end{tabular}
\Bigg) = \Bigg(
\begin{tabular}{ccc}
$\cos\theta\cos\psi$ & $-\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi$ & $\sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta$ \\
$\cos\theta\sin\psi$ & $\cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi$ & $\sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi$ \\
$\sin\theta$ & $cos\theta\sin\phi$ & $cos\theta\cos\phi$
\end{tabular} \Bigg( \begin{tabular}{c}
$x_b$ \\
$y_b$ \\
$z_b$
\end{tabular} \Bigg)
答案1
最好将其分成更小的元素,3x3
矩阵实在太大了。给列命名并单独写出可以提供更窄的文本。下面我给出了两个版本,第一个使用方便的amsmath
包,第二个使用标准 LaTeX 命令。在标准 LaTeX 版本中,请注意array
在数学模式下是合适的,而不是tabular
。
\documentclass[twocolumn]{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{pmatrix}
x_n \\
y_n \\
z_n
\end{pmatrix}
=
\begin{pmatrix}
v_1& v_2& v_3
\end{pmatrix}
\begin{pmatrix}
x_b \\
y_b \\
z_b
\end{pmatrix}
,
\end{equation*}
where
\begin{gather*}
v_1 =
\begin{pmatrix}
\cos\theta\cos\psi \\
\cos\theta\sin\psi \\
\sin\theta
\end{pmatrix}
,\\
v_2 =
\begin{pmatrix}
-\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi\\
\cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi\\
\cos\theta\sin\phi
\end{pmatrix}
, \\
v_3 = \begin{pmatrix}
\sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta \\
\sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi \\
\cos\theta\cos\phi
\end{pmatrix}.
\end{gather*}
Poorer version in standard LaTeX:
\begin{displaymath}
\left(\begin{array}{c}
x_n \\
y_n \\
z_n
\end{array}\right)
=
\left(\begin{array}{ccc}
v_1& v_2& v_3
\end{array}\right)
\left(\begin{array}{c}
x_b \\
y_b \\
z_b
\end{array}\right)
,
\end{displaymath}
where
\begin{eqnarray}
v_1 &=&
\left(\begin{array}{c}
\cos\theta\cos\psi \\
\cos\theta\sin\psi \\
\sin\theta
\end{array}\right)
,\nonumber \\
v_2 &=&
\left(\begin{array}{c}
-\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi\\
\cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi\\
\cos\theta\sin\phi
\end{array}\right)
,\nonumber \\
v_3 &=& \left(\begin{array}{c}
\sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta \\
\sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi \\
\cos\theta\cos\phi
\end{array}\right)
\nonumber.
\end{eqnarray}
\end{document}
查看amsmath
文档用于具有差异对齐可能性的其他数学环境。
答案2
结合较小的字体大小、flalign*
环境和将中间矩阵一分为二的解决方案:
\documentclass[twocolumn]{article}
\usepackage{geometry}
\usepackage{mathtools}
\usepackage{lipsum}
\setlength{\columnsep}{0.6cm}
\begin{document}
\lipsum[2]
%
{\footnotesize\setlength\arraycolsep{3pt}
\begin{flalign*}
& \mathrlap{ \begin{bmatrix}
x_n \\
y_n \\
z_n
\end{bmatrix}
=
\left[\begin{array}{cc}
\cos\theta\cos\psi & -\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi \\
\cos\theta\sin\psi & \cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi \\
\sin\theta & cos\theta\sin\phi
\end{array} \right.} \\
& & & & & \left.\begin{array}{c}
\sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta \\
\sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi \\
cos\theta\cos\phi
\end{array}\right]
%
\begin{bmatrix}
x_b \\
y_b \\
z_b
\end{bmatrix} \\[-2ex]
\end{flalign*}}%
\lipsum[3-6]
\end{document}
答案3
基于伯纳德的回答,我建议使用widetext
。是的,这无法“适合 [...] 单个列”,但我认为这仍然很有用。
\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{widetext}
\setlength{\columnsep}{0.6cm}
\begin{document}
\lipsum[2]
%
\begin{widetext}
\begin{align*}
\begin{bmatrix}
x_n \\
y_n \\
z_n
\end{bmatrix}
&=
\begin{bmatrix}
\cos\theta\cos\psi & -\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi & \sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta\\
\cos\theta\sin\psi & \cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi & \sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi\\
\sin\theta & cos\theta\sin\phi & cos\theta\cos\phi
\end{bmatrix}
%
\begin{bmatrix}
x_b \\
y_b \\
z_b
\end{bmatrix} \\[-2ex]
\end{align*}%
\end{widetext}
%
\lipsum[3-6]
\end{document}
答案4
尝试这个:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}\left(\begin{array}{c}
x_n \\
y_n \\
z_n
\end{array}
\right) = \left(
\begin{array}{ccc}
\cos\theta\cos\psi & -\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi & \sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta \\
\cos\theta\sin\psi & \cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi & \sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi \\
\sin\theta & \cos\theta\sin\phi & \cos\theta\cos\phi
\end{array}\right) \left( \begin{array}{c}
x_b \\
y_b\\
z_b
\end{array} \right)
\end{equation*}
\end{document}