I want to get the LaTeX2e logo but with each character having a different color. I know that \LaTeXe produces the logo, but how do I give a color to each character?

2 Answers 2


You can use the \textcolor command from the xcolor package to give a color to each character of the logo. Running

texdef -t latex LaTeXe

in a terminal, you can get the implememtation of the LaTeX2e logo:

\mbox {\m@th
  \if b\expandafter \@car \f@series \@nil \boldmath \fi
  \LaTeX \kern .15em2$_{\textstyle \varepsilon }$}

Since the \LaTeXe command is built upon the \LaTeX command which, in its turn, uses the \TeX command (you can use texdef to see their definition), I defined three commands \ClrTeX, \ClrLaTeX, and \ClrLaTeXe to assign a color to each character of the three logos:



  {\sbox\z@ T%
     \vbox to\ht\z@{\hbox{\check@mathfonts

    \if b\expandafter\@car\f@series\@nil\boldmath\fi






enter image description here


An alternative solution is to define \ClrLaTeXe based on local patches of \TeX, \LaTeX and \LaTeXe:



  \expandafter\patchcmd\csname LaTeX \endcsname {L}          {\textcolor{#1}{L}}          {\unskippp}{}%
  \expandafter\patchcmd\csname LaTeX \endcsname {A}          {\textcolor{#2}{A}}          {\unskippp}{}%
  \patchcmd\TeX                                 {T}          {\textcolor{#3}{T}}          {\unskippp}{}%
  \patchcmd\TeX                                 {E}          {\textcolor{#4}{E}}          {\unskippp}{}%
  \patchcmd\TeX                                 {X}          {\textcolor{#5}{X}}          {\unskippp}{}%
  \expandafter\patchcmd\csname LaTeXe \endcsname{2}          {\textcolor{#6}{2}}          {\unskippp}{}%
  \expandafter\patchcmd\csname LaTeXe \endcsname{\varepsilon}{\textcolor{#7}{\varepsilon}}{\unskippp}{}%




The resulting output is:

  • 1
    This is pretty elegant.
    – You
    Commented Sep 6, 2011 at 21:50

You must log in to answer this question.

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