I realise that this is somewhat of a special question, but is it possible to have regular characters in formulas, where the left half is colored e.g. in red and the right half is colored in blue, similar to the image below?

Character with two colors as desired


I'm not sure what this would be used for, but the only method I see is to typeset two copies of the same glyph, clipped and differently colored.


    \def\Ahalf##1{\dimexpr.5\width ##1 0.025em\relax}
    \textcolor{red}{\clipbox{0 0 {\Ahalf+} 0}{A}}%
    \textcolor{blue}{\clipbox{{\Ahalf-} 0 0 0}{A}}%


enter image description here

The little correction depends on the character: the vertex of the A doesn't lie at the exact half.

The risk of optical effects is very big: here the horizontal stem doesn't seem to connect properly, but just because of the choice of the colors.

  • What do you mean by optical effect? There actually is a bright line between the two colors, it's not just an optical illusion. – Overv Sep 17 '14 at 18:08

Why not with tikz (I know for sure... it is heavy).


      \node[inner sep=0pt,outer sep=0pt] (a) {\phantom{#1}};
      \clip (a.south west) rectangle ($(a.north)-(0.5\pgflinewidth,0)$);
      \node[inner sep=0pt,outer sep=0pt,text=#2]  {#1};
    \clip (a.south east) rectangle ($(a.north)-(0.5\pgflinewidth,0)$);
      \node[inner sep=0pt,outer sep=0pt,text=#3]  {#1};

\Atwo{blue}{red} \Atwo[B]{green}{magenta}

enter image description here

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.