> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/latex-basics/03-bold-italics-and-underlining.md).

# Bold, italics and underlining

## Introduction

Simple text formatting helps to highlight important concepts within a document and make it more readable. Using italics, bold or underlined words can change the perception of the reader.

In this article three basic text formatting tools will be explained: italics, bold and underline. Let's begin with an example:

```latex
Some of the \textbf{greatest}
discoveries in \underline{science}
were made by \textbf{\textit{accident}}.
```

[Open this LaTeX fragment in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=text+formatting+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0ASome+of+the+%5Ctextbf%7Bgreatest%7D+%0Adiscoveries+in+%5Cunderline%7Bscience%7D+%0Awere+made+by+%5Ctextbf%7B%5Ctextit%7Baccident%7D%7D.%0A%5Cend%7Bdocument%7D)

The following graphic shows the output of this LaTeX code—the document preamble is added automatically by the Overleaf link:

![Example of italics, bold and underline](/files/VY8Wa7MW6UTuVKdjV8zp)

As you can see, there are three basic commands and they can be nested to get combined effects.

Note: The original text-formatting commands from plain TeX, `\it` (italicize) and `\bf` (bold face) will still work in a LaTeX document but their use is discouraged and not recommended because they don't preserve previous styles. For example, when using those old commands you can't apply both italics and bold at the same time.

## Italicized text

To make a text italic is straightforward, use the `\textit` (`\emph`) command:

```latex
Some of the greatest
discoveries in science
were made by \textit{accident}.
```

[Open this LaTeX fragment in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=italic+text+formatting+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0ASome+of+the+greatest+%0Adiscoveries+in+science+%0Awere+made+by+%5Ctextit%7Baccident%7D.%0A%5Cend%7Bdocument%7D)

The following graphic shows the output of this LaTeX code—the document preamble is added automatically by the Overleaf link:

![Example of italicized text](/files/WK5dcQtVcZRl1gZFj5vL)

## Bold text

To make a text bold use `\textbf` command:

```latex
Some of the \textbf{greatest}
discoveries in science
were made by accident.
```

[Open this LaTeX fragment in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=bold+text+formatting+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0ASome+of+the+%5Ctextbf%7Bgreatest%7D+%0Adiscoveries+in+science+%0Awere+made+by+accident.%0A%5Cend%7Bdocument%7D)

The following graphic shows the output of this LaTeX code—the document preamble is added automatically by the Overleaf link:

![Textformattingex3.png](/files/7Eq0mYD2TzlwG3cnUcn8)

## Underlined text

To underline text use the `\underline` command:

```latex
Some of the greatest
discoveries in \underline{science}
were made by accident.
```

[Open this LaTeX fragment in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=underline+text+formatting+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0ASome+of+the+greatest+%0Adiscoveries+in+%5Cunderline%7Bscience%7D+%0Awere+made+by+accident.%0A%5Cend%7Bdocument%7D)

The following graphic shows the output of this LaTeX code—the document preamble is added automatically by the Overleaf link:

![Example of underlined text](/files/RzZoJWj0Uv7yeXDRsqsH)

## Emphasising text

Text can be emphasized using the `\emph` command. Sometimes the `\emph` command behaves just as `\textit`, but is not exactly the same:

```latex
Some of the greatest \emph{discoveries}
in science
were made by accident.

\textit{Some of the greatest \emph{discoveries}
in science
were made by accident.}

\textbf{Some of the greatest \emph{discoveries}
in science
were made by accident.}
```

[Open this LaTeX fragment in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=emphasizing+text+formatting+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0ASome+of+the+greatest+%5Cemph%7Bdiscoveries%7D+%0Ain+science+%0Awere+made+by+accident.%0A%0A%5Ctextit%7BSome+of+the+greatest+%5Cemph%7Bdiscoveries%7D+%0Ain+science+%0Awere+made+by+accident.%7D%0A%0A%5Ctextbf%7BSome+of+the+greatest+%5Cemph%7Bdiscoveries%7D+%0Ain+science+%0Awere+made+by+accident.%7D%0A%5Cend%7Bdocument%7D)

The following graphic shows the output of this LaTeX code—the document preamble is added automatically by the Overleaf link:

![Example of emphasized text](/files/M7BMcgB5f2cRfYSJ5MQV)

What the `\emph` command actually does with its argument depends on the context—inside normal text the emphasized text is italicized, but this behaviour is reversed if used inside an italicized text—see example above. Moreover, some packages, e.g. [Beamer](/latex/presentations/01-beamer.md), change the behaviour of the `\emph` command.

## Full set of examples

The following example collects the various code fragments contained in this article so that you can open them all together in Overleaf.

```latex
First example, bold, italics and underline:

Some of the \textbf{greatest} discoveries in \underline{science} were made by \textbf{\emph{accident}}.

\vspace{1.5cm}

Example of italicized text:

Some of the greatest discoveries in science were made by \emph{accident}.

\vspace{1.5cm}

Example of boldface text:

Some of the \textbf{greatest} discoveries in science were made by accident.

\vspace{1.5cm}

Example of underlined text:

Some of the greatest discoveries in \underline{science} were made by accident.

\vspace{1.5cm}

Example of emphasized text in different contexts:

Some of the greatest \emph{discoveries} in science were made by accident.

\textit{Some of the greatest \emph{discoveries} in science were made by accident.}

\textbf{Some of the greatest \emph{discoveries} in science were made by accident.}
```

[Open this LaTeX code in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=text+formatting+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Ctitle%7BBold%2C+Italics+and+Underline%7D%0A%5Cauthor%7BAn+example+from+Overleaf%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0AFirst+example%2C+bold%2C+italics+and+underline%3A%0A%0ASome+of+the+%5Ctextbf%7Bgreatest%7D+discoveries+in+%5Cunderline%7Bscience%7D+were+made+by+%5Ctextbf%7B%5Cemph%7Baccident%7D%7D.%0A%0A%5Cvspace%7B1.5cm%7D%0A%0AExample+of+italicized+text%3A+%0A%0ASome+of+the+greatest+discoveries+in+science+were+made+by+%5Cemph%7Baccident%7D.%0A%0A%5Cvspace%7B1.5cm%7D%0A%0AExample+of+boldface+text%3A%0A%0ASome+of+the+%5Ctextbf%7Bgreatest%7D+discoveries+in+science+were+made+by+accident.%0A%0A%5Cvspace%7B1.5cm%7D%0A%0AExample+of+underlined+text%3A%0A%0ASome+of+the+greatest+discoveries+in+%5Cunderline%7Bscience%7D+were+made+by+accident.%0A%0A%5Cvspace%7B1.5cm%7D%0A%0AExample+of+emphasized+text+in+different+contexts%3A%0A%0ASome+of+the+greatest+%5Cemph%7Bdiscoveries%7D+in+science+were+made+by+accident.%0A%0A%5Ctextit%7BSome+of+the+greatest+%5Cemph%7Bdiscoveries%7D+in+science+were+made+by+accident.%7D%0A%0A%5Ctextbf%7BSome+of+the+greatest+%5Cemph%7Bdiscoveries%7D+in+science+were+made+by+accident.%7D%0A%5Cend%7Bdocument%7D)

## Further reading

For more information see

* [Paragraphs and new lines](/latex/latex-basics/02-paragraphs-and-new-lines.md)
* [Lists](/latex/latex-basics/04-lists.md)
* [Paragraph formatting](/latex/formatting/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [Line breaks and blank spaces](/latex/formatting/05-line-breaks-and-blank-spaces.md)
* [The not so short introduction to LaTeX2ε](http://www.ctan.org/tex-archive/info/lshort/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/latex-basics/03-bold-italics-and-underlining.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
