在兩個 \arrowvert 之間放置空格以指示群組的基數

在兩個 \arrowvert 之間放置空格以指示群組的基數

如何在 Latex 中的兩條垂直線之間放置空格,例如鍵入組基數的常用表示法?

答案1

不在\cdot參數的分隔符號之間放置一個會導致意義不明確。考慮以下範例:

\documentclass{article}
\pagestyle{empty}% for cropping
\begin{document}
\ldots where $|\cdot|$ denotes the cardinality of a set\ldots
\[ \aleph = |A| \]

\ldots where $|\ |$ denotes the cardinality of a set\ldots
\[ \aleph = |\ |A \mbox{ or } \aleph = A|\ | \mbox{ or } \aleph = |A| \mbox{?} \]

\ldots where $||$ denotes the cardinality of a set\ldots

\ldots where $\|$ is the delimiter for the 2-norm\ldots
\[ \| v \| \equiv \sqrt{\langle v, v\rangle} \]
\end{document}

在此輸入影像描述

答案2

只為完成這一切

\documentclass[a4paper]{memoir}
\usepackage{mathtools,etoolbox}
\DeclarePairedDelimiterX\Card[1]\lvert\rvert{
  \ifblank{#1}{{-}}{#1}
}
\begin{document}
where $\Card{}$ denotes the cardinality of a set:
\[ \aleph = \Card{A} \]
\end{document}

答案3

另一種變體是亨利的回答使用\dots

\documentclass[a5paper]{article}
\usepackage{amsmath}

\begin{document}
where $\lvert\dots\rvert$ denotes the cardinality of a set:
\[ \aleph = \lvert A\rvert \]
\end{document}

結果

相關內容