LaTex的粗体、斜体和下划线

LaTex的粗体、斜体和下划线

目录

  • LaTex的粗体、斜体和下划线
    • 斜体文本
    • 粗体文字
    • 带下划线的文字
    • 强调文字
    • 全套示例

简单的文本格式有助于突出文档中的重要概念并使其更具可读性。使用斜体、粗体或带下划线的词可以改变读者的看法。

本文将介绍三种基本的文本格式化工具:斜体、粗体和下划线。让我们从一个例子开始:

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

在这里插入图片描述
如您所见,共有三个基本命令,它们可以嵌套以获得组合效果。

注意:来自纯 TeX 的原始文本格式命令\it(斜体)和\bf(粗体)仍然可以在 LaTeX 文档中使用,但不鼓励使用,也不推荐使用,因为它们不保留以前的样式。例如,当使用那些旧命令时,您不能同时应用斜体和粗体。

斜体文本

要使文本斜体很简单,请使用\emphor或者\textit命令:

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

LaTex的粗体、斜体和下划线_第1张图片

粗体文字

要使文本粗体使用\textbf命令:

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

在这里插入图片描述

带下划线的文字

要为文本添加下划线,请使用以下\underline命令:

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

在这里插入图片描述

强调文字

可以使用\emph命令强调文本。有时该\emph命令的行为与 \textit一样,但并不完全相同:

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.}

LaTex的粗体、斜体和下划线_第2张图片
\emph命令对其参数的实际作用取决于上下文——在普通文本中,强调的文本是斜体的,但如果在斜体文本中使用,则此行为相反——参见上面的示例。此外,一些软件包,例如Beamer,会改变\emph命令的行为。

全套示例

以下示例收集了本文中包含的各种代码片段,以便您可以在 Overleaf 中将它们全部打开。


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.}

LaTex的粗体、斜体和下划线_第3张图片
PS:该文从overleaf的帮助教程中翻译,请见Bold,_italics_and_underlining

你可能感兴趣的:(LaTex,latex)