Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 tohecz, lockstep, David Carlisle, zeroth, Stefan Kottwitz Jan 27 '13 at 23:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5  
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
2  
{always use braces} –  David Carlisle Jan 27 '13 at 23:09
show 1 more comment

Browse other questions tagged or ask your own question.