Coloring your document

We could enhance our texts further by colors. We didn't deal with it yet, because most people use LaTeX for writing serious books and articles, or letters where too much color may harm the appearance. But why not try something fancy? For instance, diagrams and tables in presentations are often colorful.

We just need to load the color package:

\usepackage{color}

From now on, we have to use a command to set the text color:

  • \color{name} is a declaration that switches to the color name. Just try \color{blue}.
  • \textcolor{name}{text} is the corresponding command form, coloring just text. That's like {\color{name}}, not new for you.

The package offers the command \definecolor . Use this to mix your own colors. You may read it in the ...

Get LaTeX Beginners Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.