Monday, February 02, 2009

Using Color in Latex

Have you ever wanted to use color in latex? It is actually pretty simple. All you need to do is include the color package:
Then you can use simple commands like:
\textcolor{Red}{I like Red.}
To produce:
Here is a list of the 68 standard colors that you could use:
Apricot Aquamarine Bittersweet Black Blue BlueGreen BlueViolet BrickRed Brown BurntOrange CadetBlue CarnationPink Cerulean CornflowerBlue Cyan Dandelion DarkOrchid Emerald ForestGreen Fuchsia Goldenrod Gray Green GreenYellow JungleGreen Lavender LimeGreen Magenta Mahogany Maroon Melon MidnightBlue Mulberry NavyBlue OliveGreen Orange OrangeRed Orchid Peach Periwinkle PineGreen Plum ProcessBlue Purple RawSienna Red RedOrange RedViolet Rhodamine RoyalBlue RoyalPurple RubineRed Salmon SeaGreen Sepia SkyBlue SpringGreen Tan TealBlue Thistle Turquoise Violet VioletRed White WildStrawberry Yellow YellowGreen YellowOrange
Furthermore, you can define custom colors by specifying the RGB values as follows:

and then using it as you would the other colors, like so:
\textcolor{MyCrazyColor}{My text in my crazy color.}

Read more about it at Bent Peterson's site.

No comments: