[Tex/LaTex] Code for the Notation of Vector Projections

vector

What LaTex code do I use to get the notation on the left of this equation, that is the projection of vector a on vector v?

http://rypress.com/tutorials/mathml/media/vectors-and-functions/summary.png

Best Answer

Here is an option:

enter image description here

\documentclass{article}

% http://tex.stackexchange.com/q/169557/5764
\usepackage{mathtools}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\newcommand{\vectorproj}[2][]{\textit{proj}_{\vect{#1}}\vect{#2}}
\newcommand{\vect}{\mathbf}

\begin{document}

\[
  \vectorproj[v]{a} = \frac{\vect{a} \cdot \vect{v}}{\norm{\vect{v}}^2} \vect{v}
\]

\end{document}

\vectorproj[<onvector>]{<ofvector>} can be supplied with an optional <onvector>.