[Tex/LaTex] Making an anti-clockwise circled arrow around a + sign in a math environment

environmentsmath-mode

\makeatletter
\newlength\@SizeOfCirc%
\newcommand{\CricArrowRight}[1]{%
\setlength{\@SizeOfCirc}{\maxof{\widthof{#1}}{\heightof{#1}}}%
\tikz [x=1.0ex,y=1.0ex,line width=.15ex, draw=black]%
\draw [->,anchor=center]%
node (0,0) {#1}%
(0,1.2\@SizeOfCirc) arc (-90:180:1.2\@SizeOfCirc);%
}%
\makeatother

This being in the premeable and the code below used in the document,

\begin{equation}
\CricArrowRight{+}\sum M_{z})_{o}&=0
\end{equation}

what I have produced is this,

enter image description here

but what I need to produce is the following:

enter image description here

Could you please help me write the equation above properly?

Best Answer

The arc starts at (0, 1.2\@SizeOfCirc), which is above the + sign. As you want it to start below the +, simply change the arc to start at (0, -1.2\@SizeOfCirc). This gives the following result:

Result

To position the symbol such that the + is aligned correctly, you'll have to change the baseline option of \tikz to baseline=-\the\dimexpr\fontdimen22\textfont2\relax, as described in this answer. The result then looks like this:

End result

The complete code:

\documentclass{article}

\usepackage{amsmath}
\usepackage{tikz,calc}

\makeatletter
\newlength\@SizeOfCirc%
\newcommand{\CricArrowRight}[1]{%
\setlength{\@SizeOfCirc}{\maxof{\widthof{#1}}{\heightof{#1}}}%
\tikz [x=1.0ex,y=1.0ex,line width=.15ex, draw=black, baseline=-\the\dimexpr\fontdimen22\textfont2\relax]%
\draw [->,anchor=center]%
node (0,0) {#1}%
(0,-1.2\@SizeOfCirc) arc (-90:180:1.2\@SizeOfCirc);
}%
\makeatother

\begin{document}
\begin{equation}
    \CricArrowRight{+} \sum M_{z})_{o}=0
\end{equation}
\end{document}