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

在这里插入图片描述

粗体文字

要使文本粗体使用\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.}

在这里插入图片描述
\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.}

在这里插入图片描述
PS:该文从overleaf的帮助教程中翻译,请见Bold,_italics_and_underlining

  • 12
    点赞
  • 67
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值