> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-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://ayakaleaf-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.
