[Univ of Cambridge] [Dept of Engineering]
next up previous contents
Next: Special characters Up: Color and Fonts Previous: Color and Fonts

Colored text

Commands that control foreground and background colors need
   \usepackage[dvips]{color}
after the \documentclass line but before \begin{document}.

\definecolor{gold}{rgb}{0.85,.66,0}
This is in \textcolor{red}{red} and this box is \colorbox{gold}{gold}.
Text color can be set using RGB values 
(\textcolor[rgb]{0,1,0}{like so}), or \textcolor[gray]{0.2}{shades} 
\textcolor[gray]{0.5}{of} \textcolor[gray]{0.8}{grey}.
produces

This is in red and this box is gold. Text color can be set using RGB values (like so), or shades of grey.



Tim Love
1999-08-05