> 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-tw/zi-xing/01-font-sizes-families-and-styles.md).

# 字型大小、字族與樣式

## 簡介

LaTeX 通常會根據文件的邏輯結構（例如章節）選擇適當的字型與字型大小。在某些情況下，你可能會想要手動設定字型與大小。

下列範例示範如何在 LaTeX 中使用可用的最小字型大小（`\tiny`）以及小型大寫字體（`\textsc{...}`）樣式：

```latex
這是一個簡單的範例，{\tiny 這裡會顯示不同的字型大小}，以及 \textsc{不同的字型樣式}。
```

[在 Overleaf 中開啟這個範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Font+sizes+and+styles\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0AThis+is+a+simple+example%2C+%7B%5Ctiny+this+will+show+different+font+sizes%7D+and+also+%5Ctextsc%7Bdifferent+font+styles%7D.%0A%5Cend%7Bdocument%7D)

下列圖片顯示了上述範例所產生的輸出： ![FontStyles.png](/files/580428044f7f725db898c430838a8a36de89fa9f)

## 字型大小

字型大小以特殊名稱來識別，實際大小不是絕對值，而是相對於在 `\documentclass` 語句中宣告的字型大小（見 [在 LaTeX 中建立文件](/latex/zh-tw/latex-ji-chu/01-learn-latex-in-30-minutes.md)).

在下列範例中， `{\huge huge font size}` 表示括號內的文字必須以 *huge* 字型大小來格式化。可用字型大小的完整清單請見 [參考指南](#reference-guide).

```latex
在這個範例中，設定了 {\huge huge font size}，而且
{\footnotesize Foot note size also}。可用的字型大小有相當多的種類。
。
```

[在 Overleaf 中開啟這個範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Huge+font+size\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0AIn+this+example+the+%7B%5Chuge+huge+font+size%7D+is+set+and+%0Athe+%7B%5Cfootnotesize+Foot+note+size+also%7D.+There%27s+a+fairly+%0Alarge+set+of+font+sizes.%0A%5Cend%7Bdocument%7D)

下列圖片顯示了上述範例所產生的輸出： ![FontSizesOLV2.png](/files/163294d2c7ac6c25282b56ac87fa28d0982b12ec)

## 字型家族

預設情況下，在標準 LaTeX 類別中，文字的預設樣式通常是羅馬體（直立）襯線字型。若要使用其他樣式（**家族**），例如無襯線、打字機體（等寬）等，就需要使用一些特定的 LaTeX 指令，如下列範例所示：

```latex
在這個範例中，使用了一個命令與一個切換指令。
\texttt{用來變更句子樣式的命令
}。

\sffamily
切換指令會從這一點開始變更樣式，直到
文件結尾，除非使用另一個切換指令。
```

[在 Overleaf 中開啟這個範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Choosing+type+styles\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0AIn+this+example%2C+a+command+and+a+switch+are+used.+%0A%5Ctexttt%7BA+command+is+used+to+change+the+style+%0Aof+a+sentence%7D.%0A%0A%5Csffamily%0AA+switch+changes+the+style+from+this+point+to+%0Athe+end+of+the+document+unless+another+switch+is+used.%0A%5Cend%7Bdocument%7D)

下列圖片顯示了上述範例所產生的輸出：

![UsingFontStyles2.png](/files/8d9e751bb91658baa5ede04766696cbb9de87375)

你可以在 LaTeX 文件中使用下列命令，將無襯線字型設為預設：

```latex
 \renewcommand{\familydefault}{\sfdefault}
```

同樣地，若要將羅馬體字型設為預設：

```latex
 \renewcommand{\familydefault}{\rmdefault}
```

## 字型樣式

LaTeX 中最常見的字型樣式有 [粗體、斜體與底線](/latex/zh-tw/latex-ji-chu/03-bold-italics-and-underlining.md)，但還有其他幾種。

在下列範例中， `\textsl` 命令會將文字設定為 *傾斜* 樣式，使文字看起來有點像 *斜體*，但又不完全相同。請參閱 [參考指南](#reference-guide) 以取得完整的字型樣式清單。

```latex
這段文字的一部分被寫成 \textsl{不同的
字型樣式} 以加以強調。
```

[在 Overleaf 中開啟這個範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Using+slanted+text\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0APart+of+this+text+is+written+%5Ctextsl%7Bin+a+different+%0Afont+style%7D+to+highlight+it.%0A%5Cend%7Bdocument%7D)

下列圖片顯示了上述範例所產生的輸出：

![UsingSlantedText.png](/files/325e3db8ea6b2533579849ad2d4c70a27f705e9c)

如果你想回到「normal」字型樣式（你所使用的 LaTeX 類別的預設值），可以使用 `\textnormal{...}` 命令或 `\normalfont` 切換指令來做到。

## 整合所有內容

下列範例將本文中使用的各種 LaTeX 程式碼片段組合在一起。

```latex
\documentclass{article}
\begin{document}
%不同字型大小與類型的範例
這是一個簡單的範例，{\tiny 這裡會顯示不同的字型大小}，以及 \textsc{不同的字型樣式}。

\vspace{1cm}

%不同字型大小與類型的範例
在這個範例中，設定了 {\huge huge font size}，而且 {\footnotesize Foot note size also}。可用的字型大小有相當多的種類。

\vspace{1cm}

%不同字型大小與類型的範例
在這個範例中，使用了一個命令與一個切換指令。 \texttt{用來變更句子樣式的命令}。

\sffamily
切換指令會從這一點開始變更樣式，直到文件結尾，除非使用另一個切換指令。
\rmfamily

\vspace{1cm}

%不同字型大小與類型的範例
這段文字的一部分被寫成 \textsl{不同的字型樣式} 以加以強調。
\end{document}
```

[在 Overleaf 中開啟這個範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+using+font+styles%2C+sizes+and+famlies\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%25Example+of+different+font+sizes+and+types%0AThis+is+a+simple+example%2C+%7B%5Ctiny+this+will+show+different+font+sizes%7D+and+also+%5Ctextsc%7Bdifferent+font+styles%7D.+%0A%0A%5Cvspace%7B1cm%7D%0A%0A%25Example+of+different+font+sizes+and+types%0AIn+this+example+the+%7B%5Chuge+huge+font+size%7D+is+set+and+the+%7B%5Cfootnotesize+Foot+note+size+also%7D.+There%27s+a+fairly+large+set+of+font+sizes.%0A%0A%5Cvspace%7B1cm%7D%0A%0A%25Example+of+different+font+sizes+and+types%0AIn+this+example%2C+a+command+and+a+switch+are+used.+%5Ctexttt%7BA+command+is+used+to+change+the+style+of+a+sentence%7D.%0A%0A%5Csffamily%0AA+switch+changes+the+style+from+this+point+to+the+end+of+the+document+unless+another+switch+is+used.%0A%5Crmfamily%0A%0A%5Cvspace%7B1cm%7D%0A%0A%25Example+of+different+font+sizes+and+types%0APart+of+this+text+is+written+%5Ctextsl%7Bin+different+font+style%7D+to+highlight+it.%0A%5Cend%7Bdocument%7D)

## 參考指南

**字型大小**

| 命令            | 輸出                                                                     |
| ------------- | ---------------------------------------------------------------------- |
| \tiny         | ![F-tiny.png](/files/0ecca0984c3eb18c3615acc777c2aae45f57d4ae)         |
| \scriptsize   | ![F-scriptsize.png](/files/8816bbc1f5a6359c23b9aeae7c889c6bef6aa2e1)   |
| \footnotesize | ![F-footnotesize.png](/files/028adeef9496ec54886420163dea26606e6864db) |
| \small        | ![F-small.png](/files/4bc5099356fad54f85d8255ff465566ef61f9895)        |
| \normalsize   | ![F-normalsize.png](/files/6cc304a827348134901c29df370c92d6c2f8027f)   |
| \large        | ![F-large.png](/files/ecc1b24eacc63dc43563f8b1a1ce7f01f91538a7)        |
| \Large        | ![F-large2.png](/files/03f6b63278c71962ee02274dc0a197a1ef3d4ec0)       |
| \LARGE        | ![F-large3.png](/files/2c9e5d8d39a13ccd9d5fff020d4efe8daa179bda)       |
| \huge         | ![F-huge.png](/files/6d7a24fc01b077f7d852cd16f9721d82493d4cc1)         |
| \Huge         | ![F-huge2.png](/files/7238ddfd321847a86d3107719a8940330cca84a8)        |

**預設字型家族**

| 字體 = 字族  | 指令                   | 切換指令        | 輸出                                                               |
| -------- | -------------------- | ----------- | ---------------------------------------------------------------- |
| 襯線（羅馬體）  | `\textrm{範例文字 0123}` | `\rmfamily` | ![F-textrm.png](/files/a03e7506e801d6be41fcee3d1304da166561657a) |
| 無襯線      | `\textsf{範例文字 0123}` | `\sffamily` | ![F-textsf.png](/files/b28186ff1cc4f6ac362629abb9e5116f0b2fb983) |
| 打字機體（等寬） | `\texttt{範例文字 0123}` | `\ttfamily` | ![F-texttt.png](/files/2a39c90ff158304cff1478507aa6fe0bb801f7eb) |

**字型樣式**

| style  | 指令                   | 切換指令        | 輸出                                                                |
| ------ | -------------------- | ----------- | ----------------------------------------------------------------- |
| 中等     | `\textmd{範例文字 0123}` | `\mdseries` | ![F-textmd.png](/files/a59e1be4c9d716c5b876fa90afafb81acf9a4487)  |
| 粗體     | `\textbf{範例文字 0123}` | `\bfseries` | ![F-textbf.png](/files/06ebaf268760090696659f8451657152d0866974)  |
| 直立     | `\textup{範例文字 0123}` | `\upshape`  | ![F-textrm.png](/files/a03e7506e801d6be41fcee3d1304da166561657a)  |
| 斜體     | `\textit{範例文字 0123}` | `\itshape`  | ![F-textit2.png](/files/188f7818dd021a0072421ed7da7c2e649bb260a9) |
| 傾斜     | `\textsl{範例文字 0123}` | `\slshape`  | ![F-textsl.png](/files/1b62527eda2511201d13fd3a434786aedd9a7991)  |
| 小型大寫字母 | `\textsc{範例文字 0123}` | `\scshape`  | ![F-textsc.png](/files/f5a163199a28169c63ec0ae93f2271efbc1348b7)  |

## 延伸閱讀

詳情請見：

* [字型字體](/latex/zh-tw/zi-xing/02-font-typefaces.md)
* [使用 XeLaTeX 支援現代字型](/latex/zh-tw/zi-xing/03-xelatex.md)
* [粗體、斜體與加底線](/latex/zh-tw/latex-ji-chu/03-bold-italics-and-underlining.md)
* [文字對齊](/latex/zh-tw/ge-shi-hua/06-text-alignment.md)
* [多欄排版](/latex/zh-tw/ge-shi-hua/09-multiple-columns.md)
* [段落格式設定](/latex/zh-tw/ge-shi-hua/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [換行與空白](/latex/zh-tw/ge-shi-hua/05-line-breaks-and-blank-spaces.md)
* [國際語言支援](/latex/zh-tw/yu-yan/03-international-language-support.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-tw/zi-xing/01-font-sizes-families-and-styles.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.
