[Tex/LaTex] How to define an inner product argument in LaTeX


I would like to make an inner-product symbol for my math paper. I would like it to work along the lines of \frac{arg1}{arg2}. Specifically, I would like to make a function, so that I could say


and get something that looked like

\langle arg1, arg2 \rangle. If someone could guide me through how to do this, it would be appreciated.

Best Answer

Using mathtools you can make a definition that allows resizing of the brackets when necessary.

Sample output



\DeclarePairedDelimiterX{\inp}[2]{\langle}{\rangle}{#1, #2}


\( \inp{\mathbf u}{\mathbf v} \)

  \inp*{\frac1n\mathbf u}{\frac 2n\mathbf v} =
  \inp[\Big]{\frac1n\mathbf u}{\frac 2n\mathbf v}


In this version \inp just prints standard sized brackets and \inp* uses \left...\right to scale the brackets to enclose the material. Often \inp* will produce brackets that are too big, and manual scaling can be provided by \inp[\big], \inp[\Big], \inp[\bigg], \inp[\Bigg] etc.

Related Question