I have the following expression

$$\left\{\varphi\in\text{End}\left({\widetilde{E}/\overline{\F}_{\Pf}}\right)\mid \varphi\text{Frob}_{\Pf}=\text{Frob}_{\Pf}\varphi\right\}$$

and would like to know how to match the length of \mid to the length of \left\{ and \right\}. Thanks!

  • 4
    Use \,\middle\vert\, Jul 22, 2013 at 14:47
  • You cannot, \mid is not a fence it is a binary symbol. I would also suggest making a macro for sets and thus hide the vertical line inside the macro. Then it is also easier to change syntax later on instead of having to do a lot of search and replace. (personally I tend to use mathtools to build such a set macro).
    – daleif
    Jul 22, 2013 at 14:47
  • and please don't use \text for operators, use say \operatorname for once of, ot define \End. \text does not give you what you would expect in an italic context.
    – daleif
    Jul 22, 2013 at 14:50
  • @daleif I did use \operatorname but I fear that people wouldn't understand \End and \Frob.
    – BlackAdder
    Jul 22, 2013 at 15:01
  • 1
    In your formula, \left( and \right) should be ( and ); increasing the size to cover the tilde is wrong. Then also the outer braces can be normal size or, if you really want them larger, \bigl\{ and \bigr\}; you can then use \bigm| for the middle bar.
    – egreg
    Jul 22, 2013 at 15:06

2 Answers 2


For middle stretchable delimiters you can use \middle:






enter image description here

Notice also the use of \DeclareMathOperator to produce the right font and spacing for "End" and "Frob". Also, $$...$$ shouldn't be used in modern LaTeX documents; use \[...\] instead. Since I didn't know the definitions of some commands, I defined them provisionally.

  • 1
    The horizontal spacing of using \,\middle\vert\, is not the same as using \mid
    – null
    Dec 13, 2019 at 13:37

For completeness here is the one I normally use


Edit 2014. After using \Set{A}{B} for some time, this syntax is not particularly natural, too far from the actual meaning. Instead I'm now using this

\providecommand\given{} % is redefined in \Set

Now we can simply use

\Set{ x\in A \given x^2 > 1 }

much much closer to the mathematical meaning.

I use the \SetSymbol because there are very complicated set constructions, where one cannot use \Set (\{ and \} on separate lines), and thus in that case one may want to be able to refer to the given symbol for sets, just in case one want change the symbol later on.

Not the answer you're looking for? Browse other questions tagged .