I would like to do the same sort of thing as in the question How to create table column wise in LaTeX?, except that I want to do it in math mode.
To be precise: I want to enter an array of items of possibly different sizes, similar to the matrix environment, except that in the LaTeX source code I want to specify one column of items and the next column, and so on, instead of specifying the items by row as usual. I want the result to be vertically centered like the matrix environment.
I also want to be able to specify the amount of horizontal and vertical space between the items.
Here is an mwe to show what I mean.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
x =
\begin{matrix}
1 & 4 \
2 & 5 \
3 & \Big(6\Big) \
\end{matrix}
\end{equation}
\end{document}
In this LaTeX code, the items appear in the order 1, 4, 2, 5, 3, 6, but I want to specify them in the order 1, 2, 3, 4, 5, 6.
(Actually, even better than that would be 3, 2, 1, 6, 5, 4 - column-wise but with the columns specified in reverse order. But I can imagine this being difficult and will be happy enough with the 1, 2, 3, 4, 5, 6 order.)
Here's what the mwe output looks like.
There is a related question, Is there a way to automatically transpose a matrix written in Latex?, but because that question is asking specifically about transposing a matrix, the answers don't end up having a way to specify the space between elements. I'm hoping for a simpler solution along the lines of the top answer at How to create table column wise in LaTeX?, which is more about stacking boxes on top of each other than doing hefty expl3 stuff.





