# How can I make a long pipe in mathmode for sets? [duplicate]

Possible Duplicate:
variable-sized “such that” pipe

I currently have this LaTeX code:

\text{Aff}(M) := \left \{ \sum_{i=1}^k \lambda_i p_i | p_i \in M, \lambda_i \in \mathbb{K}, \sum_{i=1}^k \lambda_i = 1\right \}


Which produces this:

But I would like to get a long pipe for my set, not this "|" short one. How can I make it long?

-

## marked as duplicate by Werner, Loop Space, egreg, Marco Daniel, Gonzalo MedinaAug 24 '12 at 21:01

You can use \middle|:

\documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath}

\begin{document}

$\mathrm{Aff}(M) := \left \{ \sum_{i=1}^k \lambda_i p_i \, \middle| \, p_i \in M, \lambda_i \in \mathbb{K}, \sum_{i=1}^k \lambda_i = 1\right \}$

\end{document}


Notice the two fine spaces I introduced (before and after the vertical bar) and the change from \text to \mathrm.

If instead of the \left\{...\right\} delimiters, some of the commands in the \big..., \Big... family is being used, then one can use the corresponding \bigm,\Bigm,... command:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\bigm\lvert\quad\Bigm\lvert\quad\biggm\lvert\quad\Biggm\lvert$

\end{document}


-
Thanks for your answer, but it doesn't work in Wikipedia. But I've found this work-around: $\mathrm{Aff}(M) := \left \{\left. \sum_{i=1}^k \lambda_i p_i \ \right|\ p_i \in M, \lambda_i \in \mathbb{K}, \sum_{i=1}^k \lambda_i = 1\right \}$ –  moose Aug 24 '12 at 20:59
Somebody mentioned that I should not use \text{} and nod \mathrm{} but \operatorname{}. –  moose Aug 24 '12 at 21:16
@moose that depends on whether you want "Aff" to behave as an operator or not. –  Gonzalo Medina Aug 24 '12 at 21:19

The braket package provides this functionality for creating sets using the notation \Set{...|...}:

\documentclass{article}
\usepackage{amssymb,amsmath}% http://ctan.org/pkg/{amssymb,amsmath}
\usepackage{braket}% http://ctan.org/pkg/braket

\begin{document}

$\mathrm{Aff}(M) := \Set{ \sum_{i=1}^k \lambda_i p_i | p_i \in M, \lambda_i \in \mathbb{K}, \sum_{i=1}^k \lambda_i = 1 }$

\end{document}​

-