Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

I want to define a set

 $S=
\left\{  
\left[\matrix{
a &b \cr
a^2 & b^2\cr
}\right] \left| \right.  a, b  {\rm \  real \  numbers}  \right\} $

How do I make the separating bar | same size as the matrix delimiter?

share|improve this question

marked as duplicate by Marco Daniel, Qrrbrbirlbel, ChrisS, Werner, cmhughes Feb 27 at 21:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
\;\middle|\; if you're using pdftex –  egreg Oct 24 '12 at 14:44
add comment

3 Answers

up vote 4 down vote accepted

If you use pdftex with e-TeX extensions enabled, the second solution is faster. The first works also with Knuth TeX.

\catcode`@=11
\def\Set#1#2{
  \left\{#1\mathrel{\left|\vphantom{#1#2}\right.\n@space\!}#2\right\}
}
\catcode`@=12

$S=\Set{
  \left[\matrix{
    a &b \cr
    a^2 & b^2\cr}
  \right]}{a, b {\rm \  real \  numbers}}$

$S=
\left\{
\left[\matrix{
a &b \cr
a^2 & b^2\cr
}\right] \;\middle|\;  a, b  {\rm \  real \  numbers}  \right\} $


\bye

enter image description here

share|improve this answer
add comment

You could change it manually like this:

$ S=
\left\{  
\left[\matrix{
a &b \cr
a^2 & b^2\cr
}\right] \bigg|~ a, b  {\rm \  real \  numbers}  \right\} $

equation

See Mathematics/Manual Sizing.

share|improve this answer
add comment

Looks like a job for \middle

screenshot

\documentclass{article}
\usepackage{amsmath}

\begin{document}
 $S=
\left\{  
\left[\begin{matrix}
a &b \\
a^2 & b^2\\
\end{matrix}
\right] \middle| a, b  {\rm \  real \  numbers}  \right\} $

\end{document}
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.