# Can I use both of setbuilder notations in one article? [closed]

There are two setbuilder notations, the vertical bar and the colon. In some cases, it is better to make a choice. For example, compare

\{f \mid f\colon M \rightarrow N \text{ is continuous}\}


and

\{f : f\colon M \rightarrow N \text{ is continuous}\}.


Also,

\{x : \lvert x \rvert = 1\}


and

 \{x \mid \lvert x \rvert = 1\}.


But I feel uneasy because I was not consistent with the notation. Is it OK if I use both of them in one article?

• Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – jub0bs Apr 23 '13 at 12:25
• Thanks. Could you let me know I do I type math here? I am still trying to find out how. – user29526 Apr 23 '13 at 12:46
• @user29526 typeset the math using latex then upload an image using the image button in the editor – David Carlisle Apr 23 '13 at 12:50
• I'm afraid this is more of a mathematical style question than a TeX question. Try math.stackexchange.com? – Ryan Reich Apr 23 '13 at 15:26
• Use a semicolon ; throughout! – Hendrik Vogt Apr 23 '13 at 15:38

This isn't really a TeX question (and so might get closed as off topic) but if you think your users may be worried that the different nations actually mean something different then it would be better to stick to one. If for example you stick to \mid you could avoid the clash of notation by using \abs(x) rather than |x| (after defining \abs with \DeclareMathOperator)

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator\abs{abs}
\begin{document}

$\{f \mid f\colon M \rightarrow N \text{ is continuous}\}$

and

$\{x \mid \abs(x) = 1\}.$

\end{document}

• Sorry. I had no idea where to ask this. But using \abs(x) doesn't seem to solve the problem. It doesn't look good to me if the absolute value comes right after the vertical bar. After I find out how to write math, I will display it here. – user29526 Apr 23 '13 at 12:47
• @user29526, what David presumably has in mind is to define abs(x) to write just that (not $\lvert x \rvert$) when using \mid for sets. – vonbrand Apr 23 '13 at 17:30
• @vonbrand yes exactly I mean to use the notation abs(x) (with the same spacing as \log) rather than using |x|. – David Carlisle Apr 23 '13 at 19:01

I think consistency is better. What you can do is to emphasise the differences between your vertical bars, or your colons, with spacing as in

$\bigl\{ f\colon M \to N \; : \; \text{$f$is continuous} \bigr\}$


or delimiter resizing, as in

$\bigl\{ x \;\big|\; \lvert x \rvert = 1 \bigr\}$


(In the latter case, I would be tempted to use \Bigl, \Big, and \Bigr, but this would work less well for inline math inside a paragraph of prose.)

I find that whitespace and larger delimiters help to reinforce the distinction between different levels of mathematical syntax when manually (or is that optically?) parsing it, and that this can be helpful when there is repetition of similar symbols in different roles.