
復原中在公式中使用 \colon 或 : ?和設定符號: \冒號 vs :,讓我們來看看 Knuth 的 TeXbook 第 14 頁。 174:
$\{\,x\mid x>5\,\}$ { x | x > 5 }
$\{\,x:x>5\,\}$ { x : x > 5 }
並在p。第438章 我們看到:
f : A → B $f\colon A\rightarrow B$
L(a, b; c: x, y; z) $L(a,b;c\colon x,y;z)$
AMS 的 LaTeX 簡短數學指南說(第 12 頁):“該命令\colon
產生特殊的間距,用於f\colon A\to B
f : A → B 等結構。”
總之,這些工作建議您在 { x : x > 5 } 和 f : A → B 中對冒號使用不同的指令(即使用不同的間距)。
現在,我們假設您確實使用冒號(無論哪個命令產生的間距)作為類別術語內的分隔符號(例如,因為豎線 | 或點 ⦁ 大量用於其他目的)。純粹從語法上講,術語「{ x : p }」是一個變數綁定結構:大括號是變數綁定器,冒號是分隔符號。這個術語在公式上屬於與「∀ x ⦁ p」/「∀ x : p」相同的類別,其中量詞是變數連接符,點/冒號是分隔符,或作為「λ x.」。 p”,其中小 lambda 是變數綁定器,句點是分隔符號。因此,所有這些術語的排版都相似,這與 Knuth 的 TeXbook 相矛盾,這是過於合乎邏輯的。但這會打破傳統:我從未在同一文本中的所有三個術語中看到分隔符號周圍的間距相等。現在,如果你仍然這樣做堅持關於一致性,您會選擇哪種間距以及如何實現?
一些測試(部分無意義):
\documentclass{article}
\pagestyle{empty}
\usepackage{amssymb}
\begin{document}\noindent
\(\{\,x\in\mathrm{Nat}\mathpunct{:} p\,\}\)\\
\(\forall\, x\in\mathrm{Nat}\mathpunct{:} p\)\\
\(\mathrm{\lambda}\, x\in\mathrm{Nat}\mathpunct{.} p\)\\\\
\(\{\,x\in\mathrm{Nat}\mathrel{:} p\,\}\)\\
\(\forall\, x\in\mathrm{Nat}\mathrel{:} p\)\\
\(\mathrm{\lambda}\, x\in\mathrm{Nat}\mathrel{.} p\)\\\\
\(\{\,x\in\mathrm{Nat}\mathpunct{\colon} p\,\}\)\\
\(\forall\, x\in\mathrm{Nat}\mathpunct{:} p\)\\
\(\mathrm{\lambda}\, x\in\mathrm{Nat}\mathpunct{.} p\)\\\\
\(\{\,x\in\mathrm{Nat}\mathrel{\colon} p\,\}\)\\
\(\forall\, x\in\mathrm{Nat}\mathrel{:} p\)\\
\(\mathrm{\lambda}\, x\in\mathrm{Nat}\mathrel{.} p\)
\end{document}