為什麼 \big\mid 不起作用?

為什麼 \big\mid 不起作用?

眾所周知,它\big\mid會引發錯誤。但為什麼會這樣呢?據我所知,\mid相當於\mathrel|,而\lvert和分別\rvert相當於\mathopen|\mathclose|--- 就像\vert相當於|。和\lvert,\rvert\big, \bigl與和一起工作\bigr。因此,透過對稱性,我認為與等\mid一起使用\big,\bigm也是有意義的。

微量元素:

\documentclass{article}

\begin{document}
$\bigl\rvert ... \bigr\lvert$ works fine.

$\big\mid$ does not.
\end{document}

請注意,我並不是在尋找解決方案列印更高的\mid;我知道我可以使用\big|or \bigm|。我只是好奇。

答案1

  • 命令\bigl\vert\bigm\vert\bigr\vert在語意上是對稱的。順便說一句,命令\bigl\lvert \bigl\vert \big\lvert和的三元組\bigr\rvert \bigr\vert \big\rvert分別產生相同的輸出。

  • 從語意上來說,這個指令\mid有點異常。正如 @egreg 在評論中指出的那樣,\mid它被構造為關係符號,並且未設定為採用大小修改前綴。

在此輸入影像描述

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\dots\ $\bigl\lvert \ldots \bigm| \ldots \bigr\rvert$ \dots\ works fine.

\dots\ $\bigl\vert \ldots \bigm\vert \ldots \bigr\vert$ \dots\ works just the same.

\dots\ $\bigl\vert \ldots \big| \ldots \bigr\vert$ \dots\ works too, but it isn't the same.

\end{document}

答案2

使用\big通常是錯誤的,因為它產生一個普通的原子。因此,人們最好用它\bigl來打開柵欄、\bigr關閉柵欄和\bigm建立關係。

\bigX無論如何,最終的定義都是\big如此,但首先添加正確的類型。並且\big<token>簡單地做到了

\left<token>

所以我們必須確保 的參數\bigX是分隔符,但事實\mid並非如此。

原則上,我們可以解除對我們知道建立在分隔符號之上的關係的這種限制:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\let\amsmath@bigm\bigm

\renewcommand{\bigm}[1]{%
  \ifcsname fenced@\string#1\endcsname
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
  {\expandafter\amsmath@bigm\csname fenced@\string#1\endcsname}%
  {\amsmath@bigm#1}%
}

\newcommand{\DeclareFence}[2]{\@namedef{fenced@\string#1}{#2}}
\makeatother

\DeclareFence{\mid}{|}

\begin{document}

$\bigl\{\, x\in X \bigm\mid x\notin X \,\bigr\}$

\smallskip

$\bigl\{\, x\in X \bigm| x\notin X \,\bigr\}$

\end{document}

這只是一個概念證明,所以我沒有嘗試對\bigm兄弟姐妹\Bigm\biggm和進行概括\Biggm

在此輸入影像描述

相關內容