LaTeX forum ⇒ Text FormattingBicolor character Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
primu2002
Posts: 2
Joined: Fri Apr 04, 2014 6:26 pm

Bicolor character

Postby primu2002 » Sat Apr 05, 2014 2:55 pm

Hi All.

I would like to have a character 'w' that is half green, half red.

Has anybody a clue for this issue?

Bye!

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Postby esdd » Sat Apr 05, 2014 4:25 pm

There is a suggestion with tikz:

  1. \documentclass{scrartcl}
  2. \usepackage{tikz}
  3. \newcommand\grletter[1]{%
  4. \tikz[baseline=(l.base),inner sep=0pt,outer sep=0pt]{
  5. \node[green](l){\phantom{#1}};
  6. \begin{scope}
  7. \clip(l.south)rectangle(l.north west);\node[green]at(l){#1};
  8. \end{scope}
  9. \begin{scope}
  10. \clip(l.south)rectangle(l.north east);\node[red]at(l){#1};
  11. \end{scope}
  12. }%
  13. }
  14. \begin{document}
  15. Text \grletter{w} Text \grletter{p}
  16. \end{document}


grletter.png
grletter.png (4.81 KiB) Viewed 1945 times

primu2002
Posts: 2
Joined: Fri Apr 04, 2014 6:26 pm

Postby primu2002 » Sun Apr 06, 2014 4:19 pm

Thank you! Correct!


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 3 guests