使用「mleftright」套件時,在「align」環境中出現括號大小和間距問題

使用「mleftright」套件時,在「align」環境中出現括號大小和間距問題

我在處理包裹時遇到了一些問題mleftright。對於我正在寫的一篇特定數學論文,我創建了一個宏,它允許我編寫函數符號,其括號會自動調整為參數的高度。我使用的巨集是

\newcommand{\func}[2]{#1 \mleft( #2 \mright)}

我使用該mleftright封裝是因為它在間距方面的優勢。現在,當我寫 時$$ \func{q}{f^{\flat}} $$,參數周圍的括號太大(內聯顯示不會發生這種情況$...$)。寫作$$ \func{q}{f^{\sharp}} $$不會產生任何問題。我知道扁平符號比銳符號高一點,但這並不能保證使用超大括號來容納它作為以上標形式出現的參數。

mleftright另一個問題是環境中的行為align。例如,當執行以下 MWE 時

\documentclass[letter,10pt]{amsart}
\usepackage{mleftright}

\begin{document}

Observe that we have
\begin{align*}
   F
&= G \\
&= \mleft[ e^{f^{g}} \cdot H \mright] \cdot J \\
&= K.
\end{align*}

\end{document}

我看到左方括號與等號之間有一個額外的空格。這是因為它e^{f^{g}}具有高輸出。

現在,我知道這些問題也會出現在 和 中,\left[並且\right]不是特定於該mleftright軟體包的,但是有人可以提出一個修復方案,以便我可以繼續使用該軟體包,到目前為止該軟體包對我來說效果很好?

非常感謝你的幫忙!我很感激!

答案1

較大的支架具有更寬的側軸承;在這種情況下,您可能需要手動修正它,但在嘗試此操作之前,您應該嘗試使用較小的括號。

我展示了四個實例,其中第二個是我要使用的。

\documentclass[letterpaper,10pt]{amsart}
\usepackage{mleftright}

\usepackage{xcolor} % for the test
\newcommand{\myrule}{\smash{\color{red}\kern-0.1pt\vrule height 1cm depth 4cm width 0.1pt}}

\begin{document}

Observe that we have
\begin{align*}
   F
&= \myrule G \\
&= [ e^{f^{g}} \cdot H ] \cdot J \\
&= [ e^{f^{g}} \cdot H\, ] \cdot J \\
&= \bigl[ e^{f^{g}} \cdot H \bigr] \cdot J \\
&= \mleft[ e^{f^{g}} \cdot H \mright] \cdot J \\
&= K.
\end{align*}

\end{document}

在此輸入影像描述

手動更正將\!如下面的程式碼所示

\documentclass[letterpaper,10pt]{amsart}
\usepackage{mleftright}

\usepackage{xcolor} % for the test
\newcommand{\myrule}{\smash{\color{red}\kern-0.1pt\vrule height 1cm depth 4cm width 0.1pt}}

\begin{document}

Observe that we have
\begin{align*}
   F
&= \myrule G \\
&= [ e^{f^{g}} \cdot H ] \cdot J \\
&= [ e^{f^{g}} \cdot H\, ] \cdot J \\
&= \!\bigl[ e^{f^{g}} \cdot H \bigr] \cdot J \\
&= \!\mleft[ e^{f^{g}} \cdot H \mright] \cdot J \\
&= K.
\end{align*}

\end{document}

在此輸入影像描述

\bigl以下是不同尺寸(普通、 、\Bigl\bigglan \Biggl)括號邊界框的比較:

在此輸入影像描述

相關內容