15

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}} 
6
  • 1
    do you want the result of $m{\times}n$ or is that too tight? Commented Jan 22, 2016 at 14:12
  • Looks pretty good. Because the "times" glyph has some space built into it, I suppose. That was easy. Thanks again. Commented Jan 22, 2016 at 14:23
  • @bubba, you edited over my edited. Commented Jan 22, 2016 at 14:32
  • @bubba, now I edited again. If you wish, please, change but be careful. Commented Jan 22, 2016 at 14:34
  • 3
    \newcommand*\by{{\times}} would be the nice approach that david suggested and then use $m \by n$. Commented Jan 22, 2016 at 17:46

1 Answer 1

24

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

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.