Introduction

Welcome back to Your First LaTeX Document! This is lesson four of six, so you are now past the halfway point of the course. In the first three lessons, you set up the write-compile-view workflow, built a complete document from scratch, and mastered the core syntax patterns — commands, arguments, and environments — that make LaTeX tick. Today, you will put those patterns to immediate, visible use by learning how to style text as bold, italic, or emphasized.

By the end of this lesson, you will know three commands: \textbf{} for bold, \textit{} for italic, and \emph{} for semantic emphasis. More importantly, you will understand why LaTeX offers two ways to produce italic-looking text and when to reach for each one.

Why Emphasis Matters

In everyday writing, bold and italic text guide the reader's eye. A bold word signals importance or labels a key item, while an italic word might introduce a new term, mark a book title, or add subtle stress to a phrase. Without these visual cues, a long paragraph can feel flat and difficult to scan — think of a textbook printed entirely in the same weight and style.

LaTeX gives you precise control over emphasis through short commands that follow the familiar \commandname{content} pattern. The key idea for this lesson is that LaTeX distinguishes between telling the compiler what the text should look like (direct formatting) and telling the compiler what the text means (semantic formatting). This distinction will become clear as we work through the three commands below.

Bold Text with \textbf{}

The \textbf{} command makes text bold. You have already seen this command in passing during the earlier lessons — its name stands for "text bold face." Place the word or phrase you want bolded inside the curly braces:

When compiled, this produces: "Calcium is an essential mineral for bone health." Only the content inside the braces turns bold; the rest of the sentence stays at normal weight. You can bold a single word or an entire phrase — just include everything you need between the braces.

Italic Text with \textit{}

The companion command \textit{} sets text in italic. The name stands for "text italic," and it works exactly the same way:

This compiles to: "The novel The Stranger was published in 1942." Book titles, foreign words, and technical terms are common reasons to reach for \textit{}.

Both \textbf{} and \textit{} are direct formatting commands. They tell LaTeX exactly what the text should look like — bold face or italic shape — no questions asked. This is perfectly fine when you know the precise visual result you want.

Semantic Emphasis with \emph{}

LaTeX also provides a command called \emph{}, short for "emphasize." At first glance it seems identical to \textit{}, because in normal upright text \emph{} produces italic output:

This compiles to: "We must never ignore the error log." So why does \emph{} exist if \textit{} already gives us italics?

The answer is that \emph{} is a semantic command. Instead of saying "make this italic," it says "this word deserves emphasis." LaTeX then decides the best visual way to show that emphasis based on the surrounding context. In upright text, emphasis appears as italics. But inside text that is already italic, \emph{} does something different — and that is where its real value shows up.

\textit{} — Direct Formatting\emph{} — Semantic Emphasis
Philosophy"Make this italic""Emphasize this word"
In normal upright text→ italic→ italic
In italic text→ italic (blends in)→ upright (stands out)
BehaviorFixed — always the sameAdaptive — depends on context
How \emph{} Differs from \textit{}

The difference becomes visible when you nest emphasis inside italic text. Consider these two examples:

These lines compile to:

  • Line 1: The lecture was fascinating from start to finish. — the word "fascinating" appears in upright type, standing out against the surrounding italics.
  • Line 2: The lecture was fascinating from start to finish. — the word "fascinating" blends in with the surrounding italics; no visible emphasis.

In the first line, \emph{fascinating} appears inside a \textit{} block. Because the surrounding text is already italic, \emph{} switches to upright (roman) type so the word still stands out visually.

In the second line, \textit{fascinating} is nested inside another \textit{} block. Since both commands request the same italic shape, the nested word looks exactly like the text around it and no visible emphasis occurs.

The takeaway: use \emph{} when your goal is to stress a word regardless of context. Use \textit{} when you specifically need the italic shape — for example, a book title that should stay italic even inside other italic text.

Combining Bold and Italic

Sometimes a word or phrase calls for both bold and italic styling at the same time. In LaTeX, you achieve this by nesting one command inside the other:

This compiles to: "The most critical step is calibration." The outer \textbf{} makes the text bold, and the inner \textit{} adds italic, producing bold italic text. The nesting order does not matter visually — \textit{\textbf{most critical}} gives the same result — but placing \textbf{} on the outside is a common convention.

Emphasis in a Résumé Entry

Let's see all three commands working together in a realistic example. Imagine you are writing a résumé entry in LaTeX:

When compiled, this produces:

Data Analyst at Riverstone Labs, 2021–2023.

Designed an automated reporting pipeline that reduced weekly processing time by 40%. This achievement was recognized as the top process improvement of the year.

Each command serves a distinct purpose in this snippet:

  • \textbf{Data Analyst} bolds the job title so it catches the eye first.
  • \textit{Riverstone Labs} italicizes the company name, a common typographic convention.
  • \emph{top process improvement} semantically emphasizes a key achievement.

One detail worth noting: we wrote 40\% with a backslash in front of the percent sign. In LaTeX, % is a special character that starts a comment — everything after a bare % on the same line is ignored by the compiler. To print a literal percent sign in the output, you escape it by writing \%. You will meet a handful of other special characters like this (&, #, $, ) in future lessons, all of which follow the same backslash-escape rule.

Conclusion and Next Steps

In this lesson, you learned three commands for styling text: \textbf{} for bold, \textit{} for italic, and \emph{} for semantic emphasis that adapts to its surrounding context. You also saw how nesting \textit{} inside \textbf{} produces bold italic text, and why \emph{} switches to upright type when it appears inside an already-italic block.

Now head over to the practice exercises to put these tools to work. You will bold and italicize individual words, observe how \emph{} flips between italic and upright in real time, layer commands to create bold italic text, and assemble a polished résumé entry that combines all three emphasis styles.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal