我想在 HTML 格式的四开文档的矩阵中将数字与减号对齐,类似于以下示例:
$$\begin{bmatrix}
3 & 4 \\
-2 & 0 \\
1 & 2
\end{bmatrix}$$
一种可能的解决方案是使用
\phantom{-}
:
$$\begin{bmatrix}
\phantom{-}3 & 4 \\
-2 & 0 \\
\phantom{-}1 & 2
\end{bmatrix}$$
但是,当矩阵有很多数字时,这不是很有效。我知道在 LaTeX 中,
mathtools
包可以达到预期的结果:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
\begin{bmatrix*}[r]
3 & 4 \\
-2 & 0 \\
1 & 2
\end{bmatrix*}
\]
\end{document}
是否可以在 Quarto HTML 文档中使用
mathtools
LaTeX 包?或者,如果没有,是否还有 mathtools
的其他替代方案可供考虑,请记住 Quarto 使用 MathJax 来渲染方程?