56

I'd like to set $1024 \times 768$ without any space between the three items. Is this possible? If so, how?

E.g., what I get is:

1024 x 768

and what I want is:

1024x768

lockstep
  • 250,273
Reid
  • 1,468
  • 2
  • 14
  • 20
  • 1
    @Marc, I want it because it looks better that way IMO. Not sure why anyone would want the letter x... that looks pretty sloppy. – Reid Apr 21 '13 at 03:49

4 Answers4

78

Math binary operators and relations automatically add appropriate spaces between the symbol and their operands. If you want to remove this space, you can turn the operator into a regular symbol by enclosing it in braces. For example

$1024 {\times} 768$

If you will be using this often you can also define a new command and say something like

\newcommand{\stimes}{{\times}}
$1024 \stimes 768$

where \stimes is a symbol version of the \times operator.

Juan A. Navarro
  • 62,139
  • 32
  • 140
  • 169
  • 10
    Good answer, I'd only add 'however, you really shouldn't be doing this!' – Joseph Wright Aug 03 '10 at 07:19
  • 1
    That's what I tried to say with "appropriate spaces" in the first sentence, but I probably was't explicit enough. :P – Juan A. Navarro Aug 03 '10 at 07:28
  • 7
    @Joseph, you don't have to use it in your documents. I write documents that look the best I can make them, not ones that follow "the rules". I deliberately left out extraneous explanations and context, but it's a deliberate choice and it looks way better in my context. – Reid Apr 21 '13 at 03:51
27

These answers seem overly complicated to me. I personally just use \! between symbols as in:

$W \! \rightarrow \! \mu$ 

This brings the symbols closer together. You can also use multiple in a row

$W \! \! \! \rightarrow \! \mu$ 
12

Perhaps defining it as an ordinary math symbol might be better than just enclose it in braces and expect that would do it now and in the future. So, I would use \mathord:

$1024\mathord{\times}768$
Stefan Kottwitz
  • 231,401
  • 3
    As Knuth points out in the TeXbook, \mathord is strictly unnecessary in TeX, since braces do the same thing. Unless you're planning on not using TeX in the future, I don't see why you would not expect it to work in the future. – TH. Sep 19 '10 at 11:28
  • 14
    Generally, I prefer a clear command like \mathord over that effect of braces which a reader perhaps might not recognize. Though you're right, this effect should not be changed in the future since subformulas should remain ordinary symbols. I just don't rely on side effects. – Stefan Kottwitz Sep 19 '10 at 20:54
4

It seems to me that what you really want is a multiplication sign that works in text mode. You can get this by writing $\times$ or, to answer your whole question 1024$\times$768.

By the way, nice question. This is a good example of where it makes sense not to use normal math typography.

  • This is easily the best answer. Screwing around with spacing in math mode is totally unnecessary if all you need is a symbol in your text. – XXX Oct 30 '16 at 03:12