In my math equations, I'd like to use a circle symbol which has the top and bottom half colored at a specific color. Ideally with a separating line at the diameter. The symbol should also work if I use it as a superscript in math mode.

So something like enter image description here

What would be an approach to achieve that?


A solution with TikZ:

  • The size adapts to the current math style. The example uses the size of letter A.

  • The line width decreases with smaller line styles.

Full example:


    \mathord{% change accordingly to the symbol type
  % #1: bottom color
  % #2: top color
  % #3: math style
  % #4: unused
  \@twohalfcircle@dimen=\ht0 %
    - .5\@twohalfcircle@linewidth
    line width=\@twohalfcircle@linewidth,
    \filldraw[fill={#1}] circle[];
      (-\@twohalfcircle@radius, 0)
      -- cycle



  • 1
    Nice. It would be nicer if the line width change according to radius. – Sigur Aug 15 '15 at 11:42
  • 1
    @Sigur, yes, I was already preparing it, see the updated answer. – Heiko Oberdiek Aug 15 '15 at 11:46
  • Wow, that's pretty nice. I didn't guess how much little tuning there is. – Gerenuk Aug 15 '15 at 12:19

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.