![矩陣環境中的垂直間距:我怎麼能有相同的?](https://rvso.com/image/286359/%E7%9F%A9%E9%99%A3%E7%92%B0%E5%A2%83%E4%B8%AD%E7%9A%84%E5%9E%82%E7%9B%B4%E9%96%93%E8%B7%9D%EF%BC%9A%E6%88%91%E6%80%8E%E9%BA%BC%E8%83%BD%E6%9C%89%E7%9B%B8%E5%90%8C%E7%9A%84%EF%BC%9F.png)
這是我的問題:我試著將雅可比矩陣寫為另外兩個矩陣的乘積,但結果是錯誤的,因為它們沒有相同的高度。這是我的程式碼:
\documentclass[11pt]{book}
\usepackage{amsmath}
\begin{document}
\begin{align*}
Jac(f \circ \varphi)_{x_0} =& Jac(f)_{\varphi(x_0)} Jac(\varphi)_{x_0} \\
=& \begin{pmatrix}
\frac{\partial f}{\partial x}(r \cos(\theta), r \sin(\theta)) \\
\frac{\partial f}{\partial y}(r \cos(\theta), r \sin(\theta))
\end{pmatrix} \begin{pmatrix}
\cos(\theta) & -r \sin(\theta) \\
\sin(\theta) & r \cos(\theta)
\end{pmatrix}
\end{align*}
\end{document}
我不想使用 /em 那樣的技巧。你有解決辦法嗎?謝謝 !
答案1
我不會堅持矩陣具有相同的高度;相反,我會使用\dfrac
內部偏導數並稍微隔開行;請參閱第二條路線是否具有相同的高度。
\documentclass[11pt]{book}
\usepackage{amsmath}
\DeclareMathOperator{\Jac}{Jac}
\begin{document}
\begin{align*}
\Jac(f \circ \varphi)_{x_0}
&= \Jac(f)_{\varphi(x_0)} \Jac(\varphi)_{x_0} \\
&= \begin{pmatrix}
\dfrac{\partial f}{\partial x}(r \cos(\theta), r \sin(\theta)) \\[3ex]
\dfrac{\partial f}{\partial y}(r \cos(\theta), r \sin(\theta))
\end{pmatrix}
\begin{pmatrix}
\cos(\theta) & -r \sin(\theta) \\[2ex]
\sin(\theta) & r \cos(\theta)
\end{pmatrix}
\end{align*}
\begin{align*}
\Jac(f \circ \varphi)_{x_0}
&= \Jac(f)_{\varphi(x_0)} \Jac(\varphi)_{x_0} \\
&= \begin{pmatrix}
\frac{\partial f}{\partial x}(r \cos(\theta), r \sin(\theta)) \\[1ex]
\frac{\partial f}{\partial y}(r \cos(\theta), r \sin(\theta))
\end{pmatrix}
\begin{pmatrix}
\cos(\theta) & -r \sin(\theta) \\[1ex]
\sin(\theta) & r \cos(\theta)
\end{pmatrix}
\end{align*}
\end{document}
請注意數學運算符的用法以及正確的&=
而不是=&
。
答案2
使用套件\mfrac
中的(中等大小的部分)可以nccmath
為矩陣提供更合理的大小。我認為更糟糕的(從美學上來說)是讓線條幾乎對齊,所以你必須在第二個矩陣的行之間手動添加一些空間,如果你改變字體,甚至字體大小,你可能會再次調整一切。
將有一種自動方式來精確對齊矩陣,使用該 blkarray
套件並僅寫入 1 個帶有分隔符號的矩陣。然而它有一些缺陷:它不能很好地與對齊配合使用,因此,例如對齊點(=)必須寫成before
&符號。不管怎樣,下面的程式碼展示了這兩種方法。我還使用該 cellspace
套件來簡化矩陣中的行(不適用於 blkarray):
\documentclass[11pt, leqno]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\DeclareMathOperator{\Jac}{Jac}
\usepackage{blkarray}
\usepackage{nccmath}
\usepackage[math]{cellspace}
\cellspacetoplimit = 3pt
\cellspacebottomlimit = 3pt
\begin{document}
\begin{align*}
\Jac(f \circ \varphi)_{x_0} =&\Jac(f)_{\varphi(x_0)} \Jac(\varphi)_{x_0} \\
\tag*{\small manual adjustment:} =& \begin{pmatrix}
\mfrac{\partial f}{\partial x}(r \cos(\theta), r \sin(\theta)) \\
\mfrac{\partial f}{\partial y}(r \cos(\theta), r \sin(\theta))
\end{pmatrix} \begin{pmatrix}
\cos(\theta) & -r \sin(\theta) \\[6pt]
\sin(\theta) & r \cos(\theta)
\end{pmatrix}
\\%
\tag*{\small with blkarray:} = &{\ } \begin{blockarray}[t]{(c)!{\ }(cc)}
\mfrac{\partial f}{\partial x}(r \cos(\theta), r \sin(\theta)) & \cos(\theta) & -r \sin(\theta)\\[8pt]
\mfrac{\partial f}{\partial y}(r \cos(\theta), r \sin(\theta)) & \sin(\theta) & r \cos(\theta)
\end{blockarray}
\end{align*}
\end{document}