将 bmatrix 与边框对齐,同时使其居中

将 bmatrix 与边框对齐,同时使其居中

梅威瑟:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{center}
    \newcommand*\Eval[3]{\left.#1\right\rvert_{#2}^{#3}}

    The Matrix is: \\
    \medskip

    $\begin{bmatrix}
        \frac{A}{B} & \frac{C}{D} \\[6pt]
        \frac{E}{F} & \frac{G}{H} 
    \end{bmatrix}$

    $\implies \Eval{\begin{bmatrix}
        \frac{A}{B} & \frac{C}{D} \\[6pt]
        \frac{E}{F} & \frac{G}{H} 
        \end{bmatrix}}{LONG TEXT LONG TEXT LONG TEXT}{}$

    $\implies \begin{bmatrix}
    \frac{A}{B} & \frac{C}{D} \\[6pt]
    \frac{E}{F} & \frac{G}{H} 
    \end{bmatrix}$
\end{center}
\end{document}

我的页面中有几个矩阵位于中央,前面有隐含箭头。我该如何对齐矩阵,使矩阵的边界对齐?

答案1

通常情况下,你应该使用一个align*环境来实现这一点:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{center}
    The Matrix is:
\end{center}
\begin{align*}
 & \begin{bmatrix}
        \frac{A}{B} & \frac{C}{D} \\[6pt]
        \frac{E}{F} & \frac{G}{H}
        \end{bmatrix} \\[1ex]
    \implies & \begin{bmatrix}
        \frac{A}{B} & \frac{C}{D} \\[6pt]
        \frac{E}{F} & \frac{G}{H}
        \end{bmatrix} \\[1ex]
        \implies & \begin{bmatrix}
    \frac{A}{B} & \frac{C}{D} \\[6pt]
    \frac{E}{F} & \frac{G}{H}
    \end{bmatrix}
\end{align*}

\end{document} 

enter image description here

编辑

这是一段代码,用于在矩阵右侧添加一些文本,同时保持矩阵居中。表格列的宽度必须根据实际情况进行调整

\documentclass{article}
\usepackage{amsmath}
\usepackage[showframe]{geometry}

\begin{document}

\begin{center}
    The Matrix is:
\end{center}
\begin{align*}
 & \begin{bmatrix}
        \frac{A}{B} & \frac{C}{D} \\[6pt]
        \frac{E}{F} & \frac{G}{H}
        \end{bmatrix} \\[1ex]
    \implies & \begin{bmatrix}
        \frac{A}{B} & \frac{C}{D} \\[6pt]
        \frac{E}{F} & \frac{G}{H}
        \end{bmatrix}\rlap{\quad\begin{tabular}{|p{5cm}@{}}LONG TEXT LONG TEXT LONG TEXT\end{tabular}} \\[1ex]
        \implies & \begin{bmatrix}
    \frac{A}{B} & \frac{C}{D} \\[6pt]
    \frac{E}{F} & \frac{G}{H}
    \end{bmatrix}
\end{align*}

\end{document}

enter image description here

相关内容