angle annotation text shift above

How can I shift the angle annotation text to avoid overlap with the arc?

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,angles,quotes,through}
\newcommand{\ann}[4]{
\draw let \p1=($(#1)-(#2)$),
\p2=($(#3)-(#2)$),
\n1={atan2(\y1,\x1)},
\n2={atan2(\y2,\x2)}
in
(#2)++(\n1:5pt) arc (\n1:\n2:5pt) node[midway,sloped] {$#4$} ;
}
\begin{document}
\begin{tikzpicture}[scale=2]
\pgfmathsetmacro\a{60}
\coordinate (O) at (0,0);
\coordinate (A) at ({cos(\a)},{sin(\a)});
\coordinate (B) at (-1,0);
\coordinate (C) at (1,0);
\draw (O) circle (1);
\draw (A) -- (B) -- (C) -- cycle
(A) -- (O)
;
\ann{O}{B}{A}{\theta};
\ann{O}{A}{B}{\theta};
\ann{O}{A}{C}{\beta};
\ann{O}{C}{A}{\beta};

\foreach \x in {A,B,C,O} {
\node[circle,inner sep=0,minimum size=1pt,label=\x] at (\x) {};
}
\end{tikzpicture}
\end{document}


If I use above, sometimes it's above and sometimes it's below!

For the sake of readability I would not slope the angles. Rather,

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,angles,quotes,through}
\newcommand{\ann}[4]{
\draw let \p1=($(#1)-(#2)$),
\p2=($(#3)-(#2)$),
\n1={atan2(\y1,\x1)},
\n2={atan2(\y2,\x2)}
in
(#2)++(\n1:5pt) arc (\n1:\n2:5pt) (#2)++({(\n1+\n2)/2}:9pt) node {$#4$} ;
}
\begin{document}
\begin{tikzpicture}[scale=2]
\pgfmathsetmacro\a{60}
\coordinate (O) at (0,0);
\coordinate (A) at ({cos(\a)},{sin(\a)});
\coordinate (B) at (-1,0);
\coordinate (C) at (1,0);
\draw (O) circle (1);
\draw (A) -- (B) -- (C) -- cycle
(A) -- (O)
;
\ann{O}{B}{A}{\theta};
\ann{O}{A}{B}{\theta};
\ann{O}{A}{C}{\beta};
\ann{O}{C}{A}{\beta};

\foreach \x in {A,B,C,O} {
\node[circle,inner sep=0,minimum size=1pt,label=\x] at (\x) {};
}
\end{tikzpicture}
\end{document}


(From your previous questions I take that you do not want to use the angles library, which allows you to annotate angles, too.)

If you want to slope them, you can do that, too. (I do not know if you want to add a rotation angle of 90, which one could do, too.)

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,angles,quotes,through}
\newcommand{\ann}[4]{
\draw let \p1=($(#1)-(#2)$),
\p2=($(#3)-(#2)$),
\n1={atan2(\y1,\x1)},
\n2={atan2(\y2,\x2)}
in
(#2)++(\n1:5pt) arc (\n1:\n2:5pt) (#2)++({(\n1+\n2)/2}:9pt)
node[rotate={(\n1+\n2)/2+ifthenelse(cos((\n1+\n2)/2)<0,180,0)}] {$#4$} ;
}
\begin{document}
\begin{tikzpicture}[scale=2]
\pgfmathsetmacro\a{60}
\coordinate (O) at (0,0);
\coordinate (A) at ({cos(\a)},{sin(\a)});
\coordinate (B) at (-1,0);
\coordinate (C) at (1,0);
\draw (O) circle (1);
\draw (A) -- (B) -- (C) -- cycle
(A) -- (O)
;
\ann{O}{B}{A}{\theta};
\ann{O}{A}{B}{\theta};
\ann{O}{A}{C}{\beta};
\ann{O}{C}{A}{\beta};

\foreach \x in {A,B,C,O} {
\node[circle,inner sep=0,minimum size=1pt,label=\x] at (\x) {};
}
\end{tikzpicture}
\end{document}


• Thanks, if add midway in node option, then the shift not happen, not sure why! :-) – lucky1928 Oct 21 '19 at 2:19
• @lucky1928 The midway option does work, but it puts the node literally in the middle of the arc. The next step of sophistication would be to use something like midway,above (or below or left or right) but then TikZ would interpret the above key depending on the layout. Then you could add allow upside down, but it turns out that you know all the data, so it is easier IMHO to do it in the way indicated in the answer. – Schrödinger's cat Oct 21 '19 at 2:23

You can use tkzMarkAngle and tkzLabelAngle options from tkz-euclide package to annotate angle.

\documentclass[border=3mm]{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[scale=2]
\tkzDefPoint(0,0){O}
\tkzDefPoint(60:1){A}
\tkzDefPoint(-1,0){B}
\tkzDefPoint(1,0){C}

\draw (O) circle (1);
\draw (A) -- (B) -- (C) -- cycle
(A) -- (O)
;

\tkzLabelPoints[above](A,B,C,O)
\tkzMarkAngle[size=2ex](O,B,A)
\tkzMarkAngle[size=2ex](B,A,O)
\tkzMarkAngle[size=1ex](O,A,C)
\tkzMarkAngle[size=2ex](A,C,O)

\tkzLabelAngle[pos=0.4](O,B,A){$\theta$}
\tkzLabelAngle[pos=0.4](B,A,O){$\theta$}
\tkzLabelAngle[pos=0.25](O,A,C){$\theta$}
\tkzLabelAngle[pos=0.4](A,C,O){$\theta$}
\end{tikzpicture}
\end{document}