LaTeX has its own default font—Computer Modern—which looks great everywhere and in any size. It will be completely fine for most use cases. (Although it’s possible to set custom fonts. This chapter won’t discuss that yet.)

Even so, you usually want to typeset a font in different styles. To emphasize phrases. To create more hierarchy in the text and structure content. This chapter explains that part.

Emphasis

These commands exist for typesetting different font styles:

CommandSwitch CommandDescription
\textnormal{…}{ \normalfont … }The default or normal font.
\textit{…}{ \itshape … }Italic
\textsl{…}{ \slshape … }slanted
\textsc{…}{ \scshape … }Small Caps
\uppercase{…}Transforms all letters to uppercase
\lowercase{…}Transforms all letters to lowercase
\textbf{…}{ \bfseries … }Bold
\textmd{…}{ \mdseries … }Medium weight
\textlf{…}{ \lfseries … }Light weight
\textsubscript{…}Subscript
\textsuperscript{…}Superscript
\emph{…}{ \em … }Emphasis, typically italics, but differs based on document style.
1This is \textit{italic} and \textbf{bold} text, and even one with \textsuperscript{super}script. For some reason, we want \uppercase{uppercase letters} here.
Code left > output right
Code left > output right

As stated earlier, it’s recommended to write your own semantical commands that use these, instead of implementing them directly into the document.

Sizes

A bunch of switch commands exist to change the text size. Ordered from smallest to largest these are:

CommandRemark
\tinyAs small as it gets (unreadable for some)
\scriptsizeSame size as subscripts and superscripts
\footnotesizeSame size as footnotes
\small
\normalsizeRegular size
\large
\Large
\LARGE
\hugeUse these last two sparingly—only for big chapter headings or title page.
\Huge
 1\tiny Tiny text
 2
 3\scriptsize Slightly bigger
 4
 5\footnotesize Even bigger
 6
 7\small Still going bigger
 8
 9\normalsize Back to normal again
10
11\large Getting large
12
13\Large Getting larger
14
15\LARGE Even larger
16
17\huge Woah, this is huge
18
19\Huge BIG, BOLD AND BEAUTIFUL
Code left > output right
Code left > output right

Remember that these are switch commands that take effect everywhere within the scope they’re in. This means that you can enlarge, for example, a complete table of contents!

Fonts

There are, generally speaking, three different types of fonts. It’s always recommended to keep the amount of different fonts as low as possible in any project, but sometimes you need a good way to typeset different types of content, and then these can make your life easier.

CommandSwitchDescription
\textrm{…}{ \rmfamily … }Roman serif font. Default.
\textsf{…}{ \sffamily … }Sans-serif font
\texttt{…}{ \ttfamily … }Monospace (fixed-width) font
1Serif looks more sophisticated than \textsf{sans-serif} in print. For computer formatted code, use \texttt{teletype text}.
Code left > output right
Code left > output right
Remark

All commands discussed so far have one tiny difference between their regular and switch syntax. The latter one does not correct spacing after the style has ended. That’s why the first one is recommended.

You’ll learn much later how to add your own fonts, as it’s unfortunately not an easy process. LaTeX was meant to only be used with a few font families when it was created. And it was created a long time ago.

Underlined

The rule is: don’t underline anything. Ever. It’s easy to miss. It doesn’t look great. Fonts don’t support it.

People generally relate underlines with links on the web and nothing else. As such, this section is mostly useful if that’s what you want to include in your document. Underlines and strikethroughs are also a handy tool for the editing process.

The built-in command is \textunderline{text}, but it doesn’t always work well. Iit ignores line breaks, for example.

To solve this, and add multiple types of underlines, include a new package: \usepackage[normalem]{ulem}.

The package stands for underline emphasis. This means that it changes the \emph command as well, but you don’t want that, which is what the optional argument normalem is for.

These commands are available:

CommandDescription
\uline{…}Regular underline
\uwave{…}Wavy underline
\sout{…}Strikethrough (or strike-out)
\xout{…}Forward slash through every individual character
1A \uline{regular underline} is great, but \uwave{wavy ones are even cooler}!
2
3\sout{This part of the text has been edited out.}
Code left > output right
Code left > output right
Continue with this course
Support me and this website!

Want to support me?

Buy one of my projects. You get something nice, I get something nice.

Donate through a popular platform using the link below.

Simply giving feedback or spreading the word is also worth a lot.