Tags
tutorial
LaTeX used
difficulty/replicability
easy
Latex has two modes: equation mode and text mode. Notion's in-line and block equations are, of course, in equation mode by default. This means that you can insert math code such as
\frac{2}{2}
for or \lim\limits_{n\to\infty}f(x)
for and it will render. However, if you try to write text it will come out in italics and none of the spaces will render, for instance
You could manually insert spaces in math mode using a backslash
\
, Instead, we can toggle text mode and we don't have to worry about spaces not showing up.
\text{}
There are various ways to toggle text mode inside a LaTeX equation. The first is by putting your text inside a
\text{}
tag. For instance, the code on the left renders as the block on the right:Inside
\text{}
, you can no longer write equation code, but you can toggle back into equation mode either - By closing the text tag:
\text{Text and }\frac{1}{2}\text{ is an equation}
, or
- By enclosing the equation in dollar signs:
\text{Text and $\frac{1}{2}$ is an equation}
These both render as
Specific font face
You can also go into text mode by using a specific font tag. For instance, if you write your text inside the brackets in
\texttt{}
you will get a monospaced typewriter font that looks like .Besides , you can do and .
These are the three font tags that will toggle text mode (i.e. spaces show up) and you can also put them inside a
\text{}
tag.Then there are the math fonts, which you can only use in equation mode (i.e. you can't use them inside \text{} and you have to manually insert spaces with a backslash). These fonts are
\mathfrak{}
, \mathcal{}
, \mathscr{}
, and \mathbb{}
. The last three only work for capital letters. Here's how they look: Look at my code and notice I manually added the spaces between words with a
\
. The \\
s in the code are just line breaks. Font color with \color{}
You can change the color of font by using the
\color{}
tag. You can put it outside a text tag or inside a text tag. Whenever you call \color{}
a new time it'll change the color of the text after it. Consider this code for example:omg\color{red}abc\color{blue}def
→ \text{\color{cadetblue}in a text tag}
→ If you want to only make one portion of the text a different color and then switch back to the default color, you can encluse the section of text in
{ }
and put the color tag inside the brackets to separate it from the rest, for instancegives us
the colors you can use with the color tag are , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and .
Even more font color with \textcolor{}
Text color is used slightly differently, it is used as
\textcolor{color here}{your text here}
. If you don't add the second set of brackets only the first letter will change color. The text will still be in math mode so if you want to have it recognize spaces you need to toggle textmode. The benefit of textcolor is that in addition to the colors above, you can also use any HTML color code. For instance, here's an equation written in color :
You can pick out the html code for any color on this site.
Text size & an in-line text suggestion
If you're adding some text in the middle of a line with an in-line equation, maybe cause you want to give it a nice color or something, I suggest also changing its size. If I just add latex text in its it looks a bit chunky but if I add a tag in front of it, it looks more comparable to the size of the notion text on the line!
The size tags in latex are, in ascending order of size: \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large, \LARGE, \huge, \Huge. You change size of a portion of text by sorrounding it by brackets and putting the size tag inside the brackets at the beginning, for instance
{\small this}
is . If you already have it inside a \text{}
tag and want to change the size of everything in the tag, the {}
in \text{}
already count as your brackets for grouping stuff together, and you don't have to add an extra {}
.