We all know that \binom{n}{r} in math mode renders the binomial coefficient. For the purposes of a note, I am TeXing up, I am interested in designing a new math operator.

Suppose I called that operator as \bil{}{}, I would like the following input \bil{n}{r} to give <n,r>.

Can anyone please help me with how I would do that?


How about

  • If I understand correctly, can we replace \left< by \langle. I think \langle looks good right? – kan Mar 30 '12 at 19:48
  • @KannappanSampath If you wish, but I believe \left< will come out as \langle. Do you see a difference (apart from the fact that \left< can grow)? – Stephan Lehmke Mar 30 '12 at 19:50
  • (Firstly, I agree with your code. It looks much better with \left< than with \langle.) – kan Mar 30 '12 at 20:05

Someting like this will work:


\newcommand*{\bil}[2]{\ensuremath{\langle #1,#2\rangle}}


Text Text \bil{4}{11} Text Text or \bil{m}{k} even $a=\bil{u}{r}$

  • Yours works just as fine. Minor Beautification: \left< and \right> works well when I tried. Thank you for the answer. +1 – kan Mar 30 '12 at 19:58
  • You are right, it's better, especially if you want the angle to stretch. – Peter Breitfeld Mar 30 '12 at 20:06
  • 2
    @PeterBreitfeld Please, have a look at tex.stackexchange.com/questions/34830/… about \ensuremath. – egreg Mar 30 '12 at 21:31
  • @egreg, thank you for this interesting link. – Peter Breitfeld Mar 30 '12 at 21:49
  • 3
    The "use-\ensuremath-only-when-really-needed" campaign is still going on. :) – egreg Mar 30 '12 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.