If you see this, something is wrong
First published on Sunday, Aug 31, 2025 and last modified on Wednesday, May 27, 2026 by François Chaplais.
Documents Live implements most of the xcolor package.
In practice, color usage should be done in two steps.
Documents Live has a predefined set of colors which is pretty extensive. You can see it here .
If you want to define your own color, we advise you to use a color picker and copy the hex value (6 letters/digits) to the clipboard. Then you define the color in the preamble of your document as follows.
\definecolor{color name}{HTML}{hex value}The hex value should NOT be preceded with the \specialStorage{2} hash character. Note that color names and hex values are case insensitive. Example:
\definecolor{testColor}{HTML}{f3d8b7}The opacity of a color is defined by a percentage. A totally opaque color has an opacity of 100; it has the same effect as if the opacity had not been specified. A totally transparent color has an opacity of 0; it has the same effect as if the color had not been applied.
To add opacity to a color, append the color name with a question mark ? followed by the opacity. For instance, testColor?70 applies the color testColor with an opacity of 70%.
Remark it is much simpler to define a color by blending colors first and define the opacity after, than to blend colors which already have an opacity. Remember that “transparent” is not the same as “white”.
There are three text color dommand.
\textcolor\textcolor{color name}{text}
set the color of text to the prescribed color. Example: This text has the blue color.
\colorbox\colorbox{color name}{text}
set the background color of text to the prescribed color. The text color is automatically adjusted for improved readability. Example: This text has a blue background color.
\fcolorbox\fcolorbox{frame color}{background color}{text}
frames the text with a border of color frame color and backgound color background color. Example: This text has a red border and a turquoise background.
You apply color to Documents Live objects by wrapping them in a latexDiv environment and styling the latexDiv itself. latexDiv uses the same color names as the other commands.
Summary 1 (color usage)
Colors are defined using the \definecolor command in the preamble. Then the color name can be used in all LaTeX commands that use color.