# Designing a new mathematical operator

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>.

-

\newcommand\bil[2]{%
\mathord{\left<#1,#2\right>}%
}
-
If I understand correctly, can we replace \left< by \langle. I think \langle looks good right? –  kan Mar 30 '12 at 19:48
BTW, thanks very much for your answer. –  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
And, thanks a lot. +1 –  kan Mar 30 '12 at 19:53
(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:

\documentclass{article}

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

\begin{document}

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

\end{document}
-
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
@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
The "use-\ensuremath-only-when-really-needed" campaign is still going on. :) –  egreg Mar 30 '12 at 21:55