> 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/wen-da/24-how-do-i-adjust-the-font-size.md).

# 如何调整字体大小？

## 简介

本文回顾了若干更改字体大小的方法——可使用以下链接跳转到感兴趣的文章部分：

* [使用文档类设置字体大小](#setting-document-font-sizes)
* [使用 LaTeX 字体大小命令](#latex-font-size-commands)
* [使用 LaTeX 字体大小环境](#latex-font-size-environments)
* [使用 `\\fontsize` 和 `\\selectfont` 命令](#the-fontsize-and-selectfont-commands)
* [使用宏包更改字体大小](#other-packages-for-changing-font-size-relsize-and-scalefnt)
* [使用 tex.stackexchange 查找有用示例](#examples-from-texstackexchange)

## 设置文档字体大小

LaTeX 使用通过 `\documentclass` 命令加载的文档类，为脚注和章节标题等文档内容的一部分设置默认字体大小。文档类还支持显式设置主文档正文（以及其他组件）字体大小的选项：

```latex
\\documentclass[options]{class}
```

例如，article 类支持为正文使用 10pt、11pt 和 12pt：

```latex
\\documentclass[11pt]{article}
```

正文将设置为 11pt，并相应地将合适的值应用于其他文档元素。

### extsizes 类

该 [extsizes 类](https://ctan.org/pkg/extsizes?lang=en) 其中包括 extarticle、extreport、extbook、extletter 和 extproc，支持 8pt、9pt、10pt、11pt、12pt、14pt、17pt 和 20pt 的字体大小。

#### 示例：使用 extarticle 类

下一个示例使用 `extarticle` 类将文档字体大小设置为 9pt。

```latex
\\documentclass[9pt]{extarticle} % 注意 extarticle 文档类
% 使用 geometry 宏包配合较小的
% 页面尺寸来创建文章图形
\\usepackage[paperheight=6in,
   paperwidth=5in,
   top=10mm,
   bottom=20mm,
   left=10mm,
   right=10mm]{geometry}
\\usepackage{lipsum}
\begin{document}
\section{Introduction}
\\lipsum[1]
\\subsection{更多细节}
\\lipsum[1]
\end{document}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+the+extarticle+class\&snip=%5Cdocumentclass%5B9pt%5D%7Bextarticle%7D+%25+Note+the+extarticle+document+class%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Blipsum%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0A%5Clipsum%5B1%5D%0A%5Csubsection%7BMore+details%7D%0A%5Clipsum%5B1%5D%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![extarticle 类演示](/files/6ffaed6b9d5ba00dfafaa5638e8b0382ca2cd23a)

## LaTeX 字体大小命令

LaTeX 提供了一组 10 个标准（预定义）命令来更改字体大小——请注意，文档类或 LaTeX 宏包可能会重新定义这些命令以改变实际的磅值。下表列出了这些命令及其对应的磅值，适用于正文主字体使用 10pt、即 article 类默认设置的文档：

```latex
\documentclass{article}
```

![标准 LaTeX 字体大小命令](/files/80c4fa0ae3f54cb8e2e1ee55cd430a8daa93714d)

有关由 `\\documentclass[11pt]{article}` 和 `\documentclass[12pt]{article}` 生成的对应磅值，请参见 [字体大小图表](https://tug.org/texinfohtml/latex2e.html#Font-sizes) 中 [LaTeX2e：非官方参考](https://tug.org/texinfohtml/latex2e.html#SEC_Overview).

下表列出了附加命令 `\\HUGE` 和 `\\ssmall` 由 [`moresize` 包](https://ctan.org/pkg/moresize?lang=en)。对应的字体大小是当 `moresize` 与 [`extarticle` 文档类](https://ctan.org/pkg/extsizes):

```latex
\\documentclass{extarticle}
\\usepackage{moresize}
```

![extarticle 类字体大小命令](/files/3abbcc479fa1e972e32b2458ab8fbc8d8064e2c8)

### 示例：使用字体大小命令

下一个示例演示如何使用这些命令。

```latex
\\documentclass{extarticle} % 注意 extarticle 文档类
% 使用 geometry 宏包配合较小的
% 页面尺寸来创建文章图形
\\usepackage[paperheight=6in,
   paperwidth=5in,
   top=10mm,
   bottom=20mm,
   left=10mm,
   right=10mm]{geometry}
\\usepackage{moresize}
\begin{document}

{这段文本的大小是 \\verb=\\normalsize=，但现在它是 \\tiny 微小
，直到我们通过 moresize 宏包将其改为 \\small 小号或 \\ssmall “ssmall”。
让我们恢复到 \\normalsize 正常大小，然后 {\\ttfamily \\scriptsize 在分组中使用等宽
\\verb=\\scriptsize= 文本}，然后再回到正常大小。现在，试试
\\verb=\\large= \\large 文本，然后 {\\sffamily \\Large \\verb=\\Large= 无衬线文本}
 最后 {\\HUGE 非常大（\\verb=\\HUGE=）且 {\\bfseries 加粗} 的文本}
\end{document}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+font+size+commands\&snip=%5Cdocumentclass%7Bextarticle%7D+%25+Note+the+extarticle+document+class%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bmoresize%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%7BThe+size+of+this+text+is+%5Cverb%3D%5Cnormalsize%3D+but+now+it+is+%5Ctiny+tiny%0Auntil+we+make+it+%5Csmall+small+or+%5Cssmall+%60%60ssmall%27%27+via+the+moresize+package.%0ALet%27s+revert+to+%5Cnormalsize+normal+size+then+%7B%5Cttfamily+%5Cscriptsize+use+monospaced%0A%5Cverb%3D%5Cscriptsize%3D+text+in+a+group%7D+then+back+to+normal.+Now%2C+try+%0A%5Cverb%3D%5Clarge%3D+%5Clarge+text+then+%7B%5Csffamily+%5CLarge+%5Cverb%3D%5CLarge%3D+sans+serif+text%7D%0A+and+finally+%7B%5CHUGE+really+big+%28%5Cverb%3D%5CHUGE%3D%29+and+%7B%5Cbfseries++bold%7D+text%7D%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![演示标准 LaTeX 字体大小命令的示例](/files/0d69515da398c991f55c38306329eb30cea78aa6)

## LaTeX 字体大小环境

上面列出的大小更改命令名称也可作为环境使用，用来包裹您希望更改大小的文本；例如：

```latex
\\begin{Large}
要排版为 \\texttt{\\string\\Large} 的文本
字体大小放在这里...
\\end{Large}%
```

下一个示例展示这些环境如何嵌套。

### 示例：使用字体大小环境

```latex
\\documentclass{extarticle} % 注意 extarticle 文档类
% 使用 geometry 宏包配合较小的
% 页面尺寸来创建文章图形
\\usepackage[paperheight=6in,
   paperwidth=5in,
   top=10mm,
   bottom=20mm,
   left=10mm,
   right=10mm]{geometry}
\\usepackage{moresize}
\begin{document}
\\noindent 我们将从正常大小的文本开始，然后添加
\\begin{tiny}
一些 {\\ttfamily \\string\\tiny} 文本
\\begin{Large}
与 {\\ttfamily\\string\\Large} 混合，并且
\\begin{HUGE}\\ttfamily \\string\\HUGE{} 文本
\\end{HUGE}%
\\end{Large}%
\\end{tiny}%
然后回到正常大小的文本。
\end{document}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+font+size+environments\&snip=%5Cdocumentclass%7Bextarticle%7D+%25+Note+the+extarticle+document+class%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bmoresize%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cnoindent+We%27ll+start+with+normal-sized+text+then+add%0A%5Cbegin%7Btiny%7D%0Asome+%7B%5Cttfamily+%5Cstring%5Ctiny%7D+text%0A%5Cbegin%7BLarge%7D%0Amixed+with+%7B%5Cttfamily%5Cstring%5CLarge%7D+and+%0A%5Cbegin%7BHUGE%7D%5Cttfamily+%5Cstring%5CHUGE%7B%7D+text%0A%5Cend%7BHUGE%7D%25%0A%5Cend%7BLarge%7D%25%0A%5Cend%7Btiny%7D%25%0Athen+back+to+normal-sized+text.%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![演示标准 LaTeX 字体大小环境的示例](/files/685ab362f49df7622fc69681b3f6671964962f70)

## \\\fontsize 和 \\\selectfont 命令

上面表格中列出的 [字体大小命令](#latex-font-size-commands) 是使用 LaTeX 命令实现的 `\\fontsize` 和 `\\selectfont` ，它也可用于直接选择一个 `字体大小` 以及相应的 `基线跳距` 设置：

```latex
\\fontsize{font-size}{baseline-skip}\\selectfont
```

该 `基线跳距` 值决定了使用 `字体大小`排版的段落中各行基线之间的距离；它也存储在名为 `\baselineskip`的参数命令中——更多细节请参见 Overleaf 文章 [如何在 LaTeX 中更改段落间距](/latex/zh-cn/ge-shi-hua/04-articles-how-to-change-paragraph-spacing-in-latex.md#5cbaselineskip-28tex-primitive29).

### 示例：使用 \\\fontsize 和 \\\selectfont

下一个示例演示 `\\fontsize` 和 `\\selectfont` 对于一系列 `字体大小` 和 `基线跳距` 值：

* `\\fontsize{6}{8}\\selectfont`：使用 6pt 文本，基线间距为 8pt
* `\\fontsize{8}{9}\\selectfont`：使用 8pt 文本，基线间距为 9pt
* `\\fontsize{12}{13.5}\\selectfont`：使用 12pt 文本，基线间距为 13.5pt

在美学上令人愉悦的 `字体大小` 和 `基线跳距` 间距组合可能取决于所用字体的设计。

```latex
\documentclass{article}
% 使用 geometry 宏包配合较小的
% 页面尺寸来创建文章图形
\\usepackage[paperheight=6in,
   paperwidth=5in,
   top=8mm,
   bottom=20mm,
   left=10mm,
   right=8mm]{geometry}
\usepackage{blindtext}
\begin{document}

\\fontsize{6}{8}\\selectfont\\blindtext

\\fontsize{8}{9}\\selectfont\\blindtext

\\fontsize{12}{13.5}\\selectfont\\blindtext
\end{document}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+fontsize+and+selectfont\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D8mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D8mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cfontsize%7B6%7D%7B8%7D%5Cselectfont%5Cblindtext%0A%0A%5Cfontsize%7B8%7D%7B9%7D%5Cselectfont%5Cblindtext%0A%0A%5Cfontsize%7B12%7D%7B13.5%7D%5Cselectfont%5Cblindtext%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![在 Overleaf 上演示 fontsize 和 selectfont](/files/c49f74486614d937dca34927308c4eee58233946)

## 更改字体大小的其他宏包：relsize 和 scalefnt

本节简要回顾以下 LaTeX 宏包：

* 该 [`relsize` 包](https://ctan.org/pkg/relsize?lang=en) 它提供命令将字体大小设置为相对于 *当前* 大小；
* 该 [`scalefnt` 包](https://ctan.org/pkg/scalefnt) 它允许您“将字体缩放到任意大小”。

### relsize 宏包

该 `relsize` 宏包提供命令将字体大小设置为相对于 *当前* 字体大小——即您想要更改大小的位置所使用的字体大小；例如，在排版脚注时，当前（字体）大小比正文中的更小。

由于历史原因，这里不展开说明（但请参见 [这里](https://tex.stackexchange.com/a/24600)） ，许多 TeX/LaTeX 的字体设定/缩放操作都涉及数值 $$\text{1.2}$$；例如， [上表](#latex-font-size-commands) 显示 `\\Large` 是 $$\text{14.4pt}$$ ，而下一个更大的大小 `\\LARGE`是 $$\text{17.28pt}$$ 因为 $$\text{14.4pt} \times 1.2 = \text{17.28pt}$$。我们还可以看到 $$\texttt{(\LARGE) } \text{17.28pt} \times 1.2 = \text{20.74pt}\texttt{ (\huge)}$$

该 `relsize` 宏包在表格中列出的字体大小之间移动时使用“步数”这一说法；例如， [下面所示代码](#relsizeexample) 演示了从 10pt 文本移动到 17.28pt 需要 3 个“步数”，每一步都使用 1.2 的乘数： $$\text{10pt} \times 1.2 \times 1.2 \times 1.2 = \text{17.28pt}$$

* 命令 `\\relsize{*n*}` 将尝试使用 `*n*` 个“步数”缩放当前字体；但是，如果请求的（缩放后）大小过小或过大：
  * 会发出警告信息，并且
  * 缩放后的大小会被限制在命令 `\\RSsmallest` 设定的范围内（通常是 `\\tiny`）以及 `\\RSlargest` 设定的范围内（通常是 `\\Huge`)
* 使用 `\\renewcommand` 来为 `\\RSlargest` 和 `\\RSsmallest`:

  ```latex
  \\renewcommand\\RSlargest{75pt}
  \\renewcommand\\RSsmallest{5pt}
  ```

#### relsize 宏包的其他命令

该 `relsize` 宏包文档列出了以下命令，这些命令专为文本设计，不适用于数学内容。

| 命令                         | 用途                           |
| -------------------------- | ---------------------------- |
| `\\relsize{*n*}`           | 按 `*n*` 步更改字体大小。             |
| `\\larger[*n*]`            | 将字体大小增加（可选） `*n*` 步（默认 1 步）。 |
| `\\smaller[*n*]`           | 将字体大小减小（可选） `*n*` 步（默认 1 步）。 |
| `\\relscale{*f*}`          | 按缩放因子更改字体大小 `*f*`.           |
| `\\textlarger[*n*]{text}`  | 文本大小增大（可选） `*n*` 步更改字体大小。    |
| `\\textsmaller[*n*]{text}` | 文本大小减小（可选） `*n*` 步更改字体大小。    |
| `\\textscale[*f*]{text}`   | 文本大小按因子缩放 `*f*`.             |

* **注意**：该 `relsize` 命令 `\\mathsmaller` 和 `\\mathlarger` 专为数学内容使用而设计——请参见 [宏包文档](http://mirrors.ctan.org/macros/latex/contrib/relsize/relsize-doc.pdf) 以获取更多细节。

#### 示例：使用 relsize 宏包

下一个示例演示 `relsize` 宏包提供的各种命令。请注意以下几点：

* 使用分组 {...} 将字体大小更改的影响局部化；
* 通过写入以下内容将最大缩放字体大小固定为 75pt

```latex
\\renewcommand\\RSlargest{75pt}
```

```latex
% article 类以默认 10pt 文本大小加载
\documentclass{article}
% 使用 geometry 宏包配合较小的
% 页面尺寸来创建文章图形
\\usepackage[paperheight=6in,
   paperwidth=5in,
   top=10mm,
   bottom=20mm,
   left=10mm,
   right=10mm]{geometry}
\\usepackage{relsize}
% 定义我们的简单宏
\\bgroup
\\catcode`@=11
\\gdef\\getfontsize{\\f@size pt}
\\egroup
% 将最大缩放字体大小设为 75pt
\\renewcommand\\RSlargest{75pt}
\begin{document}
你好，在这一段中，正常字体大小是 \\getfontsize。
现在使用 3 个“步数”缩放当前字体：{\\verb=\\relsize{3}=\\relsize{3}
这会将当前大小设置为 \\getfontsize}。在分组外
字体大小再次变为 \\getfontsize。

另一段包含一些{\\larger[2] 较大文本}以及
{\\smaller[1] 较小文本}——请注意分组 \\{...\\} 的使用。还可使用
\\textlarger[3]{较大文本} 和一些 \\textscale{2}{缩放文本}。
\\vskip12pt
使用更大的步数：

\\vskip12pt
\\textlarger[11]{11 步（\\getfontsize）}
\\vskip12pt
\\textlarger[20]{20 步（\\getfontsize）}——已达到大小上限并给出警告：
\\vskip12pt
“Package relsize Warning: Font size 383.35397pt is too large. Using 75pt instead...”
\end{document}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+the+relsize+package\&snip=%25+article+class+is+loaded+with+default+10pt+text+size%0A%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Brelsize%7D%0A%25+Define+our+simple+macro%0A%5Cbgroup%0A%5Ccatcode%60%40%3D11%0A%5Cgdef%5Cgetfontsize%7B%5Cf%40size+pt%7D%0A%5Cegroup%0A%25+Set+the+maximum+scaled+font+size+to+75pt%0A%5Crenewcommand%5CRSlargest%7B75pt%7D%0A%5Cbegin%7Bdocument%7D%0AHello%2C+in+this+paragraph+the+normal+font+size+is+%5Cgetfontsize.+%0ANow+scale+the+current+font+using+3+%60%60steps%27%27%3A+%7B%5Cverb%3D%5Crelsize%7B3%7D%3D%5Crelsize%7B3%7D%0Awhich+sets+the+current+size+to+%5Cgetfontsize%7D.+Outside+the+group+%0Athe+font+size+is+once+again+%5Cgetfontsize.%0A%0AAnother+paragraph+with+some%7B%5Clarger%5B2%5D+larger+text%7D+and+%0A%7B%5Csmaller%5B1%5D+smaller+text%7D---note+the+use+of+groups+%5C%7B...%5C%7D.+Also+using+%0A%5Ctextlarger%5B3%5D%7Blarge+text%7D+and+some+%5Ctextscale%7B2%7D%7Bscaled+text%7D.%0A%5Cvskip12pt%0AUsing+a+larger+number+of+steps%3A%0A%0A%5Cvskip12pt%0A%5Ctextlarger%5B11%5D%7B11+steps+%28%5Cgetfontsize%29%7D%0A%5Cvskip12pt%0A%5Ctextlarger%5B20%5D%7B20+steps+%28%5Cgetfontsize%29%7D---size+limit+reached+and+a+warning+is+given%3A%0A%5Cvskip12pt%0A%60%60Package+relsize+Warning%3A+Font+size+383.35397pt+is+too+large.+Using+75pt+instead...%27%27%0A%5Cend%7Bdocument%7D)

上面的 LaTeX 代码通过一个名为 `\\f@size`的内部 LaTeX 变量访问当前字体大小， `\\getfontsize`，它可以按如下方式定义：

```latex
\\bgroup
\\catcode`@=11
\\gdef\\getfontsize{\\f@size pt}
\\egroup
```

上面的示例产生以下输出：

![演示各种 relsize 宏包命令的示例](/files/f600ec4c345e9fb5316bc7667ed25b545180918f)

### scalefnt 宏包

该 `scalefnt` 宏包定义了 `\\scalefont` 命令

```latex
\\scalefont{factor}
```

其中 `因子` 将缩放当前字体的大小以及当前的 `\baselineskip`值——它用于 [计算排版段落中各行之间的间距](/latex/zh-cn/ge-shi-hua/04-articles-how-to-change-paragraph-spacing-in-latex.md#5cbaselineskip-28tex-primitive29).

#### 示例：使用 scalefnt 宏包

下一个示例演示 `\\scalefont` 命令，并且还使用了我们的 [`\\getfontsize` 宏](#getfontsize).

```latex
% article 类以默认 10pt 文本大小加载
\documentclass{article}
% 使用 geometry 宏包配合较小的
% 页面尺寸来创建文章图形
\\usepackage[paperheight=6in,
   paperwidth=5in,
   top=10mm,
   bottom=20mm,
   left=10mm,
   right=10mm]{geometry}
\\usepackage{scalefnt}
% 定义我们的简单宏 \\getfontsize
\\bgroup
\\catcode`@=11
\\gdef\\getfontsize{\\f@size pt}
\\egroup
\begin{document}
对于这一段，当前字体大小是 \\getfontsize{}，而 \\verb=\\baselineskip= 的值是 \\the\\baselineskip。

如果我们使用 \\verb=\\scalefont{1.5}= \\scalefont{1.5}，那么字体大小现在是  \\getfontsize{}，而 \\verb=\\baselineskip= 是 \\the\\baselineskip。
\end{document}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+the+scalefnt+package\&snip=%25+article+class+is+loaded+with+default+10pt+text+size%0A%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bscalefnt%7D%0A%25+Define+our+simple+macro+%5Cgetfontsize%0A%5Cbgroup%0A%5Ccatcode%60%40%3D11%0A%5Cgdef%5Cgetfontsize%7B%5Cf%40size+pt%7D%0A%5Cegroup%0A%5Cbegin%7Bdocument%7D%0AFor+this+paragraph%2C+the+current+font+size+is+%5Cgetfontsize%7B%7D+and+the+value+of+%5Cverb%3D%5Cbaselineskip%3D+is+%5Cthe%5Cbaselineskip.%0A%0AIf+we+use+%5Cverb%3D%5Cscalefont%7B1.5%7D%3D+%5Cscalefont%7B1.5%7D+the+font+size+is+now++%5Cgetfontsize%7B%7D+and+%5Cverb%3D%5Cbaselineskip%3D+is+%5Cthe%5Cbaselineskip.%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![演示 scalefnt 宏包的示例](/files/21223da90ca146b22f4b3a2a05a750af1abbfc69)

## 来自 tex.stackexchange 的示例

在 tex.stackexchange 上搜索 [带有标签的提问 `fontsize`](https://tex.stackexchange.com/questions/tagged/fontsize) 会得到一长串结果，其中包含与更改字体大小相关的解释、代码和解决方案。有些问题相当专门，而另一些则更通用；以下是一些可能有兴趣的小部分示例：

* [更改图注的字体大小](https://tex.stackexchange.com/questions/187429/change-font-size-of-labels-in-figures-to-any-font-size)
* [调整所有图注的字体大小](https://tex.stackexchange.com/questions/527772/adjusting-font-size-of-all-captions-with-prefered-font-size)
* [更改章、节、小节的字体大小](https://tex.stackexchange.com/questions/234546/chapter-section-subsections-title-font-size)
* [使用 `fontspec` 包](https://tex.stackexchange.com/questions/309712/change-font-size-with-fontspec-package)
* [更改字体大小 `\\ttfamily`](https://tex.stackexchange.com/questions/158778/all-ttfamily-font-change-font-size)


---

# 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/wen-da/24-how-do-i-adjust-the-font-size.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.
