1

I'd like to use my macro \angs for draw the angle label. I first tried the following code, it has some problems.

\usetikzlibrary{quotes,angles}
\tikzset{
  ar/.style={angle radius=#1},
  ar/.default=0.65cm,
  ae/.style={angle eccentricity=#1},
  ae/.default=0.75,
}
\def\angs[#1,#2]#3#4{%
\draw pic[draw,angle radius=#1,"{\scriptsize $#4$}",angle eccentricity=#2] {angle = #3}
}
\begin{tikzpicture}
\coordinate[label=below:{\scriptsize $A$}] (A) at (0,0);
\coordinate[label=below:{\scriptsize $B$}] (B) at (2,0);
\coordinate[label=above:{\scriptsize $C$}] (C) at (3,2);
\draw (A) -- (B) -- (C);
%\draw pic[draw,angle radius=0.65cm,"{\scriptsize $120^{\circ}$}",angle eccentricity=0.5] {angle = C--B--A};
\angs[ar,ae]{A--B--C}{120^{\circ}};
\end{tikzpicture}

1 Answer 1

3

Perhaps you want something like

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{quotes,angles}
\tikzset{
  ar/.style={angle radius=#1},
  ar/.default=0.65cm,
  ae/.style={angle eccentricity=#1},
  ae/.default=0.75,
}

\newcommand{\angs}[3][]{%
  \draw pic[ar,ae,#1,draw,"{\scriptsize $#3$}"] {angle = #2}
}

\begin{document}

\begin{tikzpicture}
\coordinate[label=below:{\scriptsize $A$}] (A) at (0,0);
\coordinate[label=below:{\scriptsize $B$}] (B) at (2,0);
\coordinate[label=above:{\scriptsize $C$}] (C) at (3,2);
\draw (A) -- (B) -- (C);
\angs[ar,ae]{A--B--C}{240^{\circ}};
\end{tikzpicture}

\begin{tikzpicture}
\coordinate[label=below:{\scriptsize $A$}] (A) at (0,0);
\coordinate[label=below:{\scriptsize $B$}] (B) at (2,0);
\coordinate[label=above:{\scriptsize $C$}] (C) at (3,2);
\draw (A) -- (B) -- (C);
\angs[ar=1cm,ae=.3]{A--B--C}{240^{\circ}};
\end{tikzpicture}

\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .