[翻譯] [Overleaf] LaTeX 中的粗體、斜體、下劃線

原  文:Bold, italics and underlining
譯  者:Xovee
翻譯時間:2020年5月25日

LaTeX 中的粗體、斜體、下劃線

在一個文檔中,簡單的文字排版可以對某些概念進行重點描述,增強其可讀性。使用粗體、斜體、或者下劃線,可以帶給讀者不同的感覺。

介紹

在這篇文章中,我們將會學習三種不同的基礎文字排版:斜體、粗體、下劃線。讓我們首先看一個例子:

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

在這裏插入圖片描述
你可以看到,我們使用了三種基礎指令,它們可以互相嵌套來產生不同的效果。注意:命令\it\bf也可以用來生成粗體、斜體,不過我們並不推薦使用它們,因爲它們不能處理文字之前的樣式。這意味着,你不能同時定義一個粗斜體。

在Overleaf中打開這個例子。

斜體

使用斜體是非常簡單的,使用\emph或者\textit命令:

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

在這裏插入圖片描述
在Overleaf中打開這個例子。

粗體

使用\textbf指令來對文字進行加粗:

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

在這裏插入圖片描述

在Overleaf中打開這個例子。

下劃線

使用\underline來對文字添加下劃線:

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

在這裏插入圖片描述

在Overleaf中打開這個例子。

強調文字

你可以使用\emph命令來強調文字,有時候\emph的行爲與\textbf一樣,它們還有一些差異:

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中打開這個例子。

延伸閱讀

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章