There are two ways to specify colors:
- as predefined LaTeX colors like BlueViolet (see color chart here: https://en.wikibooks.org/wiki/LaTeX/Colors),
- specifying their Hex-codes, like #DFE612 (you can choose a color, for example, here: https://www.google.com/search?q=color+picker)
How to add colors?
- Add an Inline equation block or select text or part of it and turn it into an equation.
- Enclose the text in curly braces. The spaces in the text will disappear.
- Add \colorbox{White} before the text. This will make the words separate again.
- To change the font color, for example, to the predefined BlueViolet, write color{BlueViolet} before the text.
- Let’s change the background color to #DFE612. Go to \colorbox, delete White and paste DFE612 instead.
- In the end, do not forget to click on Done; otherwise, the changes will not be saved.
- Because you are working with an equation, the font has changed.
- Color names can be processed incorrectly, so it’s better to use Hex encoding.
\color{BlueViolet} \colorbox{DFE612} {Colored line of text}
Want to master Notion like a pro?
Get our 5-star Notion Interactive Course.
200+ exercises. 36 topics. 25+ video tutorials
How to wrap lines?
- For clarity of the code, you can transfer commands to different lines, and this will not affect the appearance of your text. To move the code, press Shift + Enter
\color{BlueViolet}
\colorbox{DFE612} {Colored line of text}
- How to wrap lines? To do this, the first and all subsequent lines must be explicitly written in curly braces, with a separate property colorbox and separated by
\\
:
\color{BlueViolet}
\colorbox{DFE612} {Veeeeeeeeeeeeeeeeeeeeeeeeeeery looooooooooooooooooooooooooooong line} \\
\colorbox{DFE612} {Another veeeeeeeeeeeeeeeeeeeeeeeeeeeery looooooooooooooooooooooooooooong line}
Single color stripe
If you want to make a single color stripe:
- Just write the text of the required length
- Change both the background color and the color of the text itself to the desired
\color{d30000}
\colorbox{d30000}{------------------------------------------------------------}
Usage in text blocks
You can insert colored text into any text properties that allow equations: titles, quotes, lists, and so on.
- Create the required block, such as a toggle heading or a quote
- Select all or part of the text, turn it into an equation and change its color using the
color
andcolorbox
commands