6

I want to create a mathematical symbol as below.

enter image description here

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 Aug 20 '18 at 8:45
4

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

enter image description here

\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}
\comangle{} your new symbol.

\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}

enter image description here

  • 1
    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
  • 3
    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
  • 1
    It seems the most versatile approach. Bravo! – Steven B. Segletes Aug 20 '18 at 11:47
  • 3
    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
  • 1
    @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.