
眾所周知,它\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
。