# Using MikTeX how can we color some text

I am using MikTeX 2.9 on Windows 8.1. The PDF output of the Following TeX file does not display the word "example" in fore color or background color. I'm using TeXWorks editor - that comes with MikTeX - to generate the PDF:

\documentclass{article}
\begin{document}
This is an {\color{green}example} of fore color text.
This is an \colorbox{green}{example} of highlighted text.
\end{document}


\usepackage{color}

• Wouldn't it be better to send them straight to xcolor, or are there advantages of color? – Steven B. Segletes May 12 '15 at 16:54
• MiKTeX includes perhaps xolor by default, but it is not part of base LaTeX, so that you have to load it. Also you should load xcolorrather than color, as @Steven B. Segletes commented. – Bernard May 12 '15 at 17:15
• @nam You can also write the text colour as \textcolor{green}{hello}. – Alenanno May 12 '15 at 17:24
• eqnarray is in the latex format (and shouldn't be used) you should use amsmath environments instead. @nam – David Carlisle May 12 '15 at 21:01