[Tex/LaTex] Symbol for m by n matrix

math-modemath-operators

I have been using m \times n to denote the size of a matrix. But lately I've decided that it has too much space and doesn't look quite right (to me). Presumably the largish spaces are present because LaTeX treats \times as a mathematical operator — it thinks I'm writing $m$ multiplied by $n$.

So, I'd like to define a \by symbol, so that I can write m \by n instead of m \times n, and get reduced spacing. The obvious approach is to define \by to be \hspace{-0.1em}\times\hspace{-0.1em}, or something like that.

Does that seem like a good approach? I'm a bit worried about what will happen if I use this in superscripts.

Edit: I ended up using

\newcommand{\by}{\hspace{0.05em}{\times}\hspace{0.05em}}

Best Answer

You could use $m{\times}n$ so that you get mathord spacing (i.e. no extra space) rather than the default mathbin spacing,

Related Question