TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Why do people use unnecessary braces?
How bad for TeX is omitting braces {}, even if the result is the same?

I wanted to know what is the preffered way of writing macros which accept parameters. So what is a more correct way: \frac 1 2 or \frac{1}{2}?

I think that the former should be preffered in most cases, as the code will work if there is only one symbol and it especially help the readability of code in cases of $\vec e_i$ instead of $\vec{e}_i$ as $\vec{e_i}$ would not typeset the math correctly.

So what do people usually do in such cases?

share|improve this question

marked as duplicate by yo', lockstep, David Carlisle, zeroth, Stefan Kottwitz Jan 27 '13 at 23:16

This question was marked as an exact duplicate of an existing question.

Teaching \frac 1 2 to newbies can make them think that \frac 1 10 is good input. – egreg Jan 27 '13 at 22:31
It's most of the time, the braced version that should be adopted. – percusse Jan 27 '13 at 22:31
To me, \vec e_i makes it look like \vec applies to all of e_i, as if it were \vec{e_i}. But, as you note, \vec e_i actually typesets the same as \vec{e}_i, not \vec{e_i}. – Henry DeYoung Jan 27 '13 at 22:42
@tohecz Yes it is. Sorry for duplicating a question. – gns-ank Jan 27 '13 at 23:03
{always use braces} – David Carlisle Jan 27 '13 at 23:09