When writing documents in LaTeX (specifically, I use LyX for it), I'd like to use some custom color for the text; for example, instead of using \textcolor{red}{abc}
(red RGB(255,0,0)
, which works perfectly) I'd like to use something like \textcolor{#990000}{abc}
(dark red RGB(153,0,0)
this throws an error).
So my specific question is:
- How can I define the color of the text in LaTeX?
- Is it possible to define a custom color to use within my document?
For example, would it be possible to define a colorrojo_oscuro
with value#990000
and use it in my document like\textcolor{rojo_oscuro}{def}
?
You can use latexcolor to include quite a few extra predefined colors. To use it you must include it more or less like this:
or, as it says here , you can do just this:
Then you will have to search for the colors by their name and use the one you want, the list looks something like this:
You can read more here and if you need any colors not listed, which I doubt since there are almost 1,000 colors, you can make one
pull request
here .You can also define a custom color in
RGB
like so:or use the code
HTML
You may also be interested in seeing the topic of available fonts: http://www.tug.dk/FontCatalogue/
From the package
xcolor
you can use\definecolor
. For example:If you prefer to specify the hex value of the color (HTML):