# Having inside delimiters same size as outside ones [duplicate]

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?

• \;\middle|\; if you're using pdftex Oct 24, 2012 at 14:44
• Is this really a duplicate? The answers at the duplicate question don't mention the answers here. Jun 11, 2017 at 17:48

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 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\}$ Looks like a job for \middle \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}