有没有办法修改 LaTeX 左右分隔符的默认垂直间距约定?

有没有办法修改 LaTeX 左右分隔符的默认垂直间距约定?

我想知道是否有办法修改 LaTeX 中左右分隔符处理垂直间距的方式。当它们包围一个分子大但分母小的分数时,往往会出现这种情况。我发布了一个(虚构的)示例,但它说明了我遇到的问题 - 表达式底部有很多额外的垂直空间,我想知道是否有办法摆脱它。

非常感谢。下面是使用 amsmath 包的独立简短 LaTeX 文章。

\documentclass{article}

\usepackage{amsmath}

\begin{document}
When this expression is included in the text, $\left\vert\frac{\begin{bmatrix}\phantom{-}d&-b\\-c&\phantom{-}a\end{bmatrix}}{a d-b c}\right\vert$, the absolute value signs treat the denominator as if it were the same size as the numerator, even though it is much smaller. The fraction bar is centred about at the middle of the line of the text. In this expression, $\frac{\begin{bmatrix}\phantom{-}d&-b\\-c&\phantom{-}a\end{bmatrix}}{a d-b c}$, the centring is the same; the fraction bar is about in line with the middle of the text. However, the vertical spacing before the next line of text is much smaller.

The same phenomenon occurs in displayed equations.
\begin{equation*}
\left\vert\begin{bmatrix}a&b\\c&d\end{bmatrix}^{-1}\right\vert=\left\vert\frac{\begin{bmatrix}\phantom{-}d&-b\\-c&\phantom{-}a\end{bmatrix}}{a d-b c}\right\vert
\end{equation*}
Note the spacing below this equation and the following text. Contrast with the following example,
\begin{equation*}
\begin{bmatrix}a&b\\c&d\end{bmatrix}^{-1}=\frac{\begin{bmatrix}\phantom{-}d&-b\\-c&\phantom{-}a\end{bmatrix}}{a d-b c}
\end{equation*}
where the text is much closer to the denominator of the fraction. The same effect does not happen in the next example,
\begin{equation*}
\left.\begin{bmatrix}a&b\\c&d\end{bmatrix}^{-1}\right.=\left.\frac{\begin{bmatrix}\phantom{-}d&-b\\-c&\phantom{-}a\end{bmatrix}}{a d-b c}\right.
\end{equation*}
in which the expressions have been surrounded by invisible left and right delimiters. It does happen in the next example,
\begin{equation*}
\left(\begin{bmatrix}a&b\\c&d\end{bmatrix}^{-1}\right)=\left(\frac{\begin{bmatrix}\phantom{-}d&-b\\-c&\phantom{-}a\end{bmatrix}}{a d-b c}\right)
\end{equation*}
which uses parentheses instead of absolute values.
\end{document}

答案1

分隔符自然延伸至相等的长度两个都方向 - 向上和向下。否则,我认为看起来会很别扭。不过,有办法解决这个问题。一种方法是将“不平衡”的分数放在 中array。例如,

...$\begin{array}{|@{\,}c@{\,}|}
  \frac{\begin{bmatrix}\phantom{-}d&-b\\ -c&\phantom{-}a\end{bmatrix}}{a d-b c}
\end{array}$

数组作为可伸缩分隔符

新分隔符的外观array\vert分隔符相比略有不同。这是因为后者称为领导者由一堆重叠的小 s 组成\vert,而前者是具有\rule特定长度和宽度的 。如果放大到分隔符末端,差异会更加明显。但这不会在打印中显示出来。

答案2

我不确定你想要的最终效果是什么,但是,如果 bmatrix 之外的变量中的字符较小,那么可以通过将它们设置为矩阵来改进其中一些,例如,

The same phenomenon occurs in displayed equations.
\[
\begin{vmatrix}
    \begin{bmatrix}a&b\\c&d\end{bmatrix}^{-1}
\end{vmatrix}
=
\begin{vmatrix}
    \frac{\begin{bmatrix}\phantom{-}d&-b\\-c&\phantom{-}a\end{bmatrix}}{a d-b c}
\end{vmatrix}
\]

但更一般地,使用\dfrac而不是\frac会给“大”分数带来更常见的表现,例如,

When this expression is included in the text, $\begin{vmatrix}
\dfrac{\begin{bmatrix}\phantom{-}d&-b\\-c&\phantom{-}a\end{bmatrix}}{a 
d-b c}\end{vmatrix}$,

相关内容