# Making a custom angle symbol

I want to create a mathematical symbol as below.

This symbol should be exactly the same as the usual \angle command (with the amsfonts package) in terms of dimensions: it should not be wider or taller. It should have the same 'arc' as in \measuredangle (but not its dimensions, since this is taller). And of course, it should be filled with gray: \color{gray} (with the xcolor package). I want to be able to use it in an equation like $$\filledangle ABC$$, identical to how commands like \angle are used. How can I do this? I have a sense that I would perhaps need to define a macro perhaps using tikz; but I have no clue where to start.

I can draw the figure by itself quite easily. Consider the following MWE:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw[fill=gray] (0,0) -- +(45:2) arc (45:0:2) -- (0,0);
\draw (0,0)--(45:3) (0,0)--(0:3);
\end{tikzpicture}
\end{document}


This produces something similar to what I want, but I am not sure that this is the correct scale used in \angle, nor do I know how to get this into the form of a command in math mode or how to get it to scale correctly.

P.S. This symbol should scale properly and be of the correct relative size to the math beside it; e.g. if I type $$x^{\filledangle ABC}$$ for whatever reason, the symbol should turn smaller accordingly. Thanks in advance!

• Nice problem to play with, but could you share what you have tried so far as an MWE. This will help us to have an head-start rather than starting from scratch!! – Raaja_is_at_topanswers.xyz Aug 20 '18 at 8:45

I hope to have understood your question. By changing the coordinates you can adjust the angle as you wish.

\documentclass{article}
\usepackage{tikz,xcolor}
\usetikzlibrary{quotes,angles}
\newcommand{\comangle}[1]{%
\begin{tikzpicture}
\draw coordinate (a) at (0.3,0);
\draw coordinate (b) at (0,0);
\draw coordinate (c) at (.2,0.25);
\draw (a) -- (b) -- (c) pic [draw=black,fill=gray!50,angle radius=.2cm] {angle=a--b--c};
\end{tikzpicture}%
}
\begin{document}

\end{document}


VARIATION

\documentclass{article}
\usepackage{tikz,xcolor}
\usetikzlibrary{quotes,angles}
\newcommand{\comangle}{\kern.08em%
\begin{tikzpicture}
\draw coordinate (a) at (0.15,0);
\draw coordinate (b) at (0,0);
\draw coordinate (c) at (.14,0.25);
\draw (a) -- (b) -- (c) pic [draw=black,fill=gray!50,angle radius=.11cm] {angle=a--b--c};
\end{tikzpicture}%
\kern.08em%
}
\begin{document}
$\angle A$

$\comangle A$

\end{document}


• There were two spurious spaces in the solution. I fixed them for you by ending two lines with a % character. Hope you don't mind. ;-) – Harald Hanche-Olsen Aug 20 '18 at 10:57
• Another suggested improvement: Use \begin{tikzpicture}[x=1em,y=1em] and multiply all coordinates by 3 (more or less). Then it will scale with font size. Possibly, one can argue that using 1ex instead of 1em is better. Or you can just use some other multiple of em or ex and leave the numbers inside alone. You choose. PS. If you want to use this in math mode, possibly some more work is needed, like wrapping the whole construct in \mathop{}. – Harald Hanche-Olsen Aug 20 '18 at 11:00
• It seems the most versatile approach. Bravo! – Steven B. Segletes Aug 20 '18 at 11:47
• To make it similar dimensions to \angle, you could try something like \newcommand{\comangle}{\kern.08em% \begin{tikzpicture} \draw coordinate (a) at (0.15,0); \draw coordinate (b) at (0,0); \draw coordinate (c) at (.14,0.25); \draw (a) -- (b) -- (c) pic [draw=black,fill=gray!50,angle radius=.11cm] {angle=a--b--c}; \end{tikzpicture}% \kern.08em } Then, compare $\angle A$ $\comangle A$ – Steven B. Segletes Aug 20 '18 at 11:55
• @Teyyf Since it is based on Sebastiano's code, I think it should be incorporated into his answer. He deserves the credit! I just added a tweak. – Steven B. Segletes Aug 20 '18 at 13:26