2

I have a mathematical set notation that I want to display inline in a paragraph of text. However, when I write this, the output is not very beautiful:

$\{ (w_j,\dots,w_{j+n-1}) | 0 \leq j \leq k-1-n\}$ 

The curly braces look a bit too small, but it's bearable. What's worse is the spacing, I think: the curly braces are too close to the opening parenthesis on the left side and the "n" on the right side. The same with the pipe symbol in the middle: it's practically glued to the closing parenthesis and the "0".

Overall the tight spacing makes the definition difficult to read. So I wonder if there is a "better" way to write the above set, so that the output is more esthetically pleasing.

1

1 Answer 1

4

Use \left\{ ... \mid ... \right\}. The spacing of the curly braces looks fine to me, but if you insist on more spacing you can add a \, between the \left\{ and the (. So, the complete equation becomes

$\left\{ (w_j,\dots,w_{j+n-1}) \mid 0 \leq j \leq k-1-n \right\}$ 

or, with the extra spacing

$\left\{\, (w_j,\dots,w_{j+n-1}) \mid 0 \leq j \leq k-1-n\,\right\}$ 
3
  • 3
    I'd like to add that in general \left...\right with in inline mathematics, should be used with extreme care, because they can easily become too large, and thus alter the line space Commented Mar 18, 2011 at 15:50
  • 2
    I second that. Also, if you use \left\{ and \right\}, it makes sense to use \middle| instead of \mid, so that the vertical bar has the same size as the curly braces (note that \mid is not scalable). Commented Mar 18, 2011 at 18:19
  • Ah, I did not know about the difference between \mid and \middle. I will revise my answer later this evening, explaining a bit more about delimiter sizing and stuff like that. Thanks for the additional info. Commented Mar 18, 2011 at 18:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.