TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 33 down vote accepted

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

share|improve this answer

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:

share|improve this answer
This is pretty elegant. – You Sep 6 '11 at 21:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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