Sarmate.net Sarmate.net
Home Features Pricing Documentation Contact
Log in Sign up

Colours and boxes

To catch the eye: some colour (the xcolor package) and proper boxes (the tcolorbox package). Two simple tools that transform the look of a document.

Colour with xcolor

\textcolor{colour}{text} colours the text; \colorbox{colour}{text} colours the background.

Compile Compile: one word in colour and one word highlighted. Then try changing the colours (blue, teal, orange…).

Boxes with tcolorbox

A titled, coloured box, perfect for a note or a definition.

Compile Compile this box, then change its title and its colours (colback = background, colframe = border).
Without memorising the options: build your boxes visually and grab the tcolorbox code. Open the box editor →
Key point: xcolor to add colour (\textcolor, \colorbox), tcolorbox for titled boxes (colback/colframe).