If I want to typeset conditional probabilities (e.g. P[A | B]) or set-builder-notation (e.g. {x | x ∈ ℝ}), what symbol should I use for the vertical bars? Candidates are bar.v
(producing and equivalent to “|”) and divides
(producing and equivalent to “∣”).
Arguments for bar.v
:
- Found on most keyboards, hence significantly easier to type
- The official docs use it in set-builder-notation examples, e.g. here.
- The vertical bar in conditional probabilities and set-builder-notation has nothing to do with divisibility, so using a symbol called
divides
seems unidiomatic.
Arguments for divides
:
- Before issue #306 (sorry, I can only add two links per post) got fixed, I think
divides
was the only way to typeset conditional probabilities and set-builder-notation? Nowadays, bothdivides
andbar.v
produce very similar (though not identical!) output. - The LaTeX-counterpart to
bar.v
is\vert
, and the LaTeX-counterpart todivides
is\mid
. In LaTeX, conditional probabilities and set-builder-notation should be typeset with\mid
, according to this stackexchange answer.