How do I use font colors in Latex documents?

By Alvin J. Alexander, devdaily.com

This is really pretty easy. In the preamble of the document use this tag:

\usepackage{color}

Then, when you need to use a different color in your document, use a tag like this:

Here's a cool site you should check out: {\color{blue}{http://www.devdaily.com/}}

A full (but brief) document might look like this:

\documentclass[letterpaper,11pt]{report}
\usepackage{color}
\definecolor{Blue}{rgb}{0.3,0.3,0.9}
\begin{document}
Here's a cool site you should check out: {\color{Blue}{http://www.devdaily.com/}}
\end{document}

Note that in this example I've defined my own color "Blue" with the RGB values shown. Piece of cake.


devdaily logo