Yahoo Web Search

Search results

  1. This article explains how to use color in your LaTeX document via the color or xcolor packages. Note that user-level documentation of the color package is contained in The LaTeX standard graphics bundle .

  2. Before defining a new color, let’s see how the color red is defined: \definecolor{red}{rgb}{1,0,0} Obviously, red is the name of the color to be defined, rgb is the color model, and 1,0,0 are three corresponding values for red, green, and blue. In other words, for red we use 100% red, 0% green and 0% blue.

  3. The simplest command to change the color of elements in the LaTeX document is \color {color}. This command switches the color for the current group in which the command is inserted. Let’s look at an example to understand how it works: This shows the basic use of colors in \LaTeX. \item {\color{red} And red!}

  4. The package allows you to use the names of 19 base colors (black, white, blue, green, yellow, red etc.); these names are always available. Besides, the package has some options to get more predefined colors, which should be added globally.

  5. I know that it is possible to obtain colored text in Latex by including the color package and writing like \textcolor{red}{This is red text} How could I define a macro which would produce text of a given color such as \red{This is red text} ?

  6. Just to provide some variety, here's a solution that provides a LaTeX macro called \boldredcaps which renders all uppercase letters in its argument in bold and red automatically. No need to apply lots of \textbf{\textcolor{red}{...}} instructions by hand. The LaTeX macro \boldredcaps relies on Lua's powerful gsub string function to ...

  7. In sufficiently new version of LaTeX, simply load xcolor package and use \mathcolor. Refer to texdoc mathcolor for documentation. \documentclass{article} \usepackage{xcolor} \begin{document} $\mathcolor{red}{1}\mathcolor{blue}{+}\mathcolor{green}{2}$ $1+2$ \end{document}