我正在寻找一种方法来使用该physics
包实现相同的输出(关于矩阵条目的对齐) - 或者只是一种仅适用于mathtools
(的构象)像这儿)。无论如何,提前致谢。
\documentclass{standalone}
\usepackage{mathtools}
\usepackage{physics}
% workaround found by adding an optional argument to the original code
% (note the xparse package was already loaded with physics)
\DeclareDocumentCommand\pmqty{O{r} m}{\begin{pmatrix*}[#1]#2\end{pmatrix*}} % adjusted
% VS
% \DeclareDocumentCommand\pmqty{m}{\begin{pmatrix}#1\end{pmatrix}} % original
\DeclareDocumentCommand\pmqtyOld{m}{\begin{pmatrix}#1\end{pmatrix}} % for comparison
\begin{document}
$\begin{pmatrix*}[r]
-1 & 3 \\
2 & -4
\end{pmatrix*}$
$\pmqtyOld{
-1 & 3 \\
2 & -4
}$
$\pmqty{
-1 & 3 \\
2 & -4
}$
\end{document}