I want to have a 2x2 matrix of arrows (\uparrow and \downarrow) to illustrate electronic spins. I've managed to get a fraction without the horizontal line using \genfrac, but I can't figure out how to reduce the vertical spacing between the pairs of arrows down.
What I have so far (working example):
\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\newcommand{\stack}[2]{\genfrac{}{}{0pt}{0}{#1}{#2}}
\begin{document}
$\stack{\uparrow\uparrow}{\downarrow\downarrow}$
\end{document}
EDIT: This is what I ended up doing, after combining some of the answers here:
\newcommand{\stack}[2]{\array{c}{\scriptstyle #1}\\[-1.1ex]{\scriptstyle #2}\endarray}
And the final result, which is going into my report:
\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\newcommand{\up}{\uparrow}
\newcommand{\dw}{\downarrow}
\newcommand{\stack}[2]{\array{c}{\scriptstyle #1}\\[-1.1ex]{\scriptstyle #2}\endarray}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
Spin arrangements &Spins up &Degeneracy &Energy &Magnetization \\ \hline
$\stack{\up\up}{\up\up}$ &4 &1 &-8J &4 \\
$\stack{\up\up}{\up\dw}$ $\stack{\up\up}{\dw\up}$ $\stack{\up\dw}{\up\up}$ $\stack{\dw\up}{\up\up}$ &3 &4 &0 &2 \\
$\stack{\up\up}{\dw\dw}$ $\stack{\dw\dw}{\up\up}$ $\stack{\up\dw}{\up\dw}$ $\stack{\dw\up}{\dw\up}$ &2 &4 &0 &0 \\
$\stack{\up\dw}{\dw\up}$ $\stack{\dw\up}{\up\dw}$ &2 &2 &8J &0 \\
$\stack{\up\dw}{\dw\dw}$ $\stack{\dw\up}{\dw\dw}$ $\stack{\dw\dw}{\up\dw}$ $\stack{\dw\dw}{\dw\up}$ &1 &4 &0 &-2 \\
$\stack{\dw\dw}{\dw\dw}$ &0 &1 &-8J &-4 \\
\hline
\end{tabular}
\end{table}
\end{document}
$\begin{matrix} \uparrow\uparrow\\ \downarrow\downarrow\end{matrix}$in the text. There is also thesmallmatrixenvioronment, or you can replace ` \\ ` by\\[-0.5ex]to make the lines closer if you wish. – Andrew Swann Nov 5 '12 at 11:43$\uparrow\uparrow\atop\downarrow\downarrow$? – Thruston Nov 5 '12 at 12:31\atopgives me some weird amsmath errors though, know how to fix those?Package amsmath Warning: Foreign command \atop,(amsmath) \frac or \genfrac should be used instead. – Filip Nov 5 '12 at 13:44