Code for the Notation of Vector Projections?

Assuming you may want the projection typeset as an operator (not italic), you can declare a new operator with the \DeclareMathOperator{}{} from the amsmath package. Inspired by Werners answer I threw in a macro for a projection command.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator{\proj}{proj}
\newcommand{\vct}{\mathbf}
\newcommand{\vctproj}[2][]{\proj_{\vct{#1}}\vct{#2}}

\begin{document}
\[
\vctproj[v]{a} = \frac{\vct{a}\cdot\vct{v}}{\lVert\vct{v}\rVert^2}\vct{v}
\]
\end{document}

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

Tags:

Vector