> 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/zh-cn/geng-duo-zhu-ti/06-bold-italics-and-underlining-es.md).

# 粗体、斜体和下划线 es

对文本进行一定格式的处理有助于突出文档中的重要概念，并使其更易读。通过使用斜体、粗体或下划线，可以改变读者对某个词的感知。

## 简介

本文解释了为文档添加格式的三种基本工具的用法：斜体、粗体和下划线。让我们从一个例子开始：

```latex
一些\textbf{最伟大的}
在\underline{科学}中的发现
是由\textbf{\textit{偶然}}发现的。
```

![Biu1.png](/files/5e5a0c2883e245ccec38f91025bd47fe4c1fed12)

如您所见，有三个可以嵌套以组合其效果的基本命令。

注意： *这些命令 **\it** 和 **\bf** 也可用于将文本转换为斜体或粗体，但不推荐使用，因为它们不会保留先前的样式。例如，使用这些命令无法创建既加粗又斜体的文本*

[在 Overleaf 中打开示例](https://www.sharelatex.com/project/new/template?zipUrl=/project/52e2cf6fcd3ae4400500066d/download/zip\&templateName=BoldItalicsUnderline\&compiler=pdflatex)

## 斜体文本

用斜体字母（也称为意大利体或斜体字）写文本非常简单，只需使用命令 **\textit**:

```latex
一些最伟大的
科学中的发现
是由\textit{偶然}发现的。
```

![Biu2.png](/files/ddfc82dea542ffb7c10b4d2f1e69ea815b32b506)

[在 Overleaf 中打开示例](https://www.sharelatex.com/project/new/template?zipUrl=/project/52e2cf6fcd3ae4400500066d/download/zip\&templateName=Bold_Italics_Underline\&compiler=pdflatex)

## 粗体文本

要写粗体文本，应使用命令 **\textbf**:

```latex
一些\textbf{最伟大的}
科学中的发现
是由偶然发现的。
```

![Biu3.png](/files/5155996dbbe3c48d7b8b9828308443ee13ff76ac)

[在 Overleaf 中打开示例](https://www.sharelatex.com/project/new/template?zipUrl=/project/52e2cf6fcd3ae4400500066d/download/zip\&templateName=Bold_Italics_Underline\&compiler=pdflatex)

## 带下划线的文本

给文本加下划线也非常简单，要使用的命令是 **\underline**:

```latex
一些最伟大的
在\underline{科学}中的发现
是由偶然发现的。
```

![Biu4.png](/files/fdf3ed00ede3bc66175ae0ec8bec639c9cbd8708)

[在 Overleaf 中打开示例](https://www.sharelatex.com/project/new/template?zipUrl=/project/52e2cf6fcd3ae4400500066d/download/zip\&templateName=Bold_Italics_Underline\&compiler=pdflatex)

## 强调文本

可以通过命令来强调文本 **\emph**。有时这个命令的行为与 **\textit** 但它们并不完全相同。

```latex
一些最伟大的 \emph{发现}
在科学中
是由偶然发现的。

\textit{一些最伟大的 \emph{发现}
在科学中
是由偶然发现的。}

\textbf{一些最伟大的 \emph{发现}
在科学中
是由偶然发现的。}
```

![Biu5.png](/files/ae241b851292cc8842af25df13b082670a6e8a85)

该命令实际执行的操作 **\emph** 取决于上下文。在普通文本中，被强调的文本会以斜体显示，但当在已经是斜体的文本上使用该命令时，这种行为会反过来。请看前面的示例以理解其含义。

此外，一些宏包，例如 [Beamer](/latex/zh-cn/yan-shi-wen-gao/01-beamer.md)，会改变命令的行为 **\emph**.

[在 Overleaf 中打开示例](https://www.sharelatex.com/project/new/template?zipUrl=/project/52e2cf6fcd3ae4400500066d/download/zip\&templateName=Bold_Italics_Underline\&compiler=pdflatex)

## 延伸阅读

更多信息请参阅：

* [段落和换行](/latex/zh-cn/latex-ji-chu/02-paragraphs-and-new-lines.md)
* [列表](/latex/zh-cn/latex-ji-chu/04-lists.md)
* [段落格式](/latex/zh-cn/ge-shi-hua/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [换行与空白](/latex/zh-cn/ge-shi-hua/05-line-breaks-and-blank-spaces.md)
* [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/zh-cn/geng-duo-zhu-ti/06-bold-italics-and-underlining-es.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.
