# Matrix doesn't shrink when put in fraction.

This is my minimal example, the problem is the different size of the two x. I would expect the matrix to be shrunken too, but it isn't. Why is this and how is it corrected?

\documentclass[a4paper,12pt]{article}
\begin{document}
$\frac{\begin{pmatrix}x\end{pmatrix}x}{2}$
\end{document}


edit: I just realized: this is not matrix specific. \underbrace does it too. seems like the information to be smaller doesn't get through these "frames":

\documentclass[a4paper,12pt]{article}
\begin{document}
$\frac{\begin{pmatrix}x\end{pmatrix}x}{2}e^{\begin{pmatrix}x\end{pmatrix}x}\int_{\begin{pmatrix}x\end{pmatrix}x}$
$\frac{\underbrace{x}x}{2}e^{\underbrace{x}x}\int_{\underbrace{x}x}$
\end{document}

-
With a little experimenting you could probably do what you want with a \scalebox from the graphicx package. But how to do this automatically, I don't know... –  Seamus May 3 '11 at 21:10

In this case you can use the smallmatrix environment of the amsmath package. Both x would have the same size. smallmatrix doesn't include delimiters, they have to be added.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\begin{document}
$\frac{\left(\begin{smallmatrix}x\\y\end{smallmatrix}\right)x}{2}$
\end{document}


-
add mathtools and you will get a delimited version, psmallmatrix for example –  daleif May 3 '11 at 21:34
i know about smallmatrix but i dont consider this a solution. i expect the stuff to adapt its size depending on context. the single x does it, why not the matrix? what is the rationale of the makers behind this decision? or is it a bug? –  peter May 3 '11 at 22:31
i now tried working with \smallmatrix as a means to make stuff smaller, but it has the disadvantage that it raises its contents. so if i use a smallmatrix to make the stuff over an \underbrace smaller, it is at the same time further up and doesnt look like the rest any more. –  peter May 5 '11 at 17:25

Without having any solid knowledge on the issue, I trust the amsmath is doing The Right Thing. But I wanted to share some explorations on size and spacing. Personally, I'd fancy the bigl/r one.

$${(x)x\over2} \qquad {\left(x\right)x\over2} \qquad {{x\choose y}x\over2} \qquad {\left({x\atop y}\right)x\over2} \qquad {\bigl({x\atop y}\bigr)x\over2} \qquad {\pmatrix{x\cr y}x\over2} \qquad$$


-