1

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}
1

add

\usepackage{color}

to the preamble

  • 1
    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
  • @David, I followed your suggestion. Now, I'm getting the following error: "The required file tex\context\base\supp-pdf.mkii is missing. It is a part of the following package: mptopdf". I thought the MikTeX would include the color package by default. It does display all my amsmath correctly without installing any extra packages. – nam May 12 '15 at 17:04
  • 1
    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
  • 1
    @nam You can also write the text colour as \textcolor{green}{hello}. – Alenanno May 12 '15 at 17:24
  • 1
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.