## 浮动体是会移动的文本框

\documentclass{article}
\usepackage{mwe}
\begin{document}
Foo
\begin{figure}[htb]
\blindtext
\end{figure}
bar
\end{document}

## 多个元素

\documentclass{article}
\usepackage{mwe}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]
\end{figure}
bar
\end{document}

geometry 宏包的辅助下，可以看到，浮动体中摆放了 4 个黑色的标尺（\rule{<width>}{<height>}）。这 4 个标尺是对图表的模拟——若是将 \rule 命令换成 \includegraphics，则得到 4 张图片；若是将 \rule 命令换成 tabular 等环境，则得到 4 个表格。前文说，TeX 排版时不关心内容，只关心尺寸，因此可以把图表都想像为特别大的字符，而后套用正常的排版逻辑即可。此处，在浮动体内，同一行有 4 个「字符」；由于宽度不够摆放 4 个字符，所以 TeX 在第三个字符之后折行，在下一行排版第四个字符。因此得到这样的排版结果。

## 题注是有一定格式的编号文本

\documentclass{article}
\usepackage{mwe}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]

\caption{Foo bar.}
\end{figure}
bar
\end{document}

• 居中：\centering
• 罗马字族：\rmfamily
• 直立字形：\upshape;
• 标准字体大小：\normalsize
• 标准字重：\mdseries

### 插入一个手工题注

\documentclass{article}
\usepackage{mwe}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]

\centering
{\rmfamily\upshape\normalsize\mdseries Figure 1: Foo bar.}
\end{figure}
bar
\end{document}

### 使用多个 \caption

\documentclass{article}
\usepackage{mwe}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]

\caption{Foo.}
\caption{Bar.}
\end{figure}
bar
\end{document}

### 关于图表题注位置的区别

It has to do with the way people absorb printed information or, more accurately, how readers of Western texts are acculturated into this.

Tables are textual devices and are, to some or other approximate degree, structured to be read in the same left->right, top->bottom order (*). To this degree, they therefore do not differ in important information processing ways from the body text. Normal text (not, e.g., poetry or other intentionally disruptive forms) is ordinarily structured in a "pyramidal" form: general and introductory concepts are best placed at the beginning, with increasingly fleshed-out details placed later on. The reading eye that saccades across text and the brain that controls it has learnt beginning at the age of two or whatever to most efficiently gather (Western) textual information in this way. By our age, we cannotnot process text this way.

Graphics, on the other hand, are iconic. The eye does not scan pictures for information in remotely the same way (in fact entirely different cerebral systems are in charge of gathering and interpreting textual and graphical information - you can knock out one part of the brain and impair one system without noticeably affecting the performance of the other; see, e.g., almost any popular writing by Oliver Sachs). It would be almost impossible to prevent the normal human brain from scanning and interpreting, no matter how briefly, a picture on the page before forcing it to reading the caption (no matter where the caption is placed because by that time the attentional mechanisms in the part of the brain that is now switched on is directing the eye to saccade in non-linear sequences).

So, to answer your question, good typesetting sets out to provide readers the most productive (rate of information processing for expended effort) reading experience that it can. For text: the caption summary is placed above the details to fit in with linear eye saccades and the pyramid principle of text interpretation; for graphics: the graphic is placed first to fit in with quite different attentional control mechanisms, non-linear eye saccading and non-linear information processing.

(_) Factor in acculturation. Good typesetting for R->L or bottom->top reading orders will follow these general principles (for biologically human species (*_)) , leading however to different outcomes.

(**) The point is that it's our brain biology that has ultimately led to the development of these rules. Here's something to think about: what are the optimal typesetting rules for non-human species, e.g., maybe sapient machines, or echo-locating information gatherers like bats or porpoises. Where would they like to "see" their captions? :))

graphics - Why should a table caption be placed above the table?

## 多个元素与题注

• 并排摆放，无题注
• 并排摆放，共享题注
• 并排摆放，各自题注
• 纵向摆放，无题注
• 纵向摆放，共享题注
• 纵向摆放，各有题注（无用，因为可以分割成两个浮动体）

### 并排摆放，无题注

\documentclass{article}
\usepackage{graphicx}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]
\centering
\includegraphics[width = .48\linewidth]{example-image-a}\hfill
\includegraphics[width = .48\linewidth]{example-image-b}
\end{figure}
bar
\end{document}

### 并排摆放，共享题注

\documentclass{article}
\usepackage{graphicx}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]
\centering
\includegraphics[width = .48\linewidth]{example-image-a}\hfill
\includegraphics[width = .48\linewidth]{example-image-b}
\caption{Dummy Caption.}
\end{figure}
bar
\end{document}

### 并排摆放，各自题注

\documentclass{article}
\usepackage{graphicx}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]
\centering
\begin{minipage}{0.48\linewidth}
\centering
\includegraphics[width = \linewidth]{example-image-a}
\caption{Dummy Caption A.}
\end{minipage}\hfill
\begin{minipage}{0.48\linewidth}
\centering
\includegraphics[width = \linewidth]{example-image-b}
\caption{Dummy Caption B.}
\end{minipage}
\end{figure}
bar
\end{document}

### 纵向摆放，无题注

\documentclass{article}
\usepackage{graphicx}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]
\centering
\includegraphics[width = .6\linewidth]{example-image-a}\\[2ex]
\includegraphics[width = .6\linewidth]{example-image-b}
\end{figure}
bar
\end{document}

## 多个元素与子题注

### 使用 subfig 宏包

subfig 宏包的核心即是 \subfloat 命令；\subfloat 命令为其中的内容（图片或表格）创建了一个盒子，并支持设置子题注。具体用法如下。

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]
\centering
\subfloat[Subcaption A]{\includegraphics[width = .48\linewidth]{example-image-a}}\hfill
\subfloat[Subcaption B]{\includegraphics[width = .48\linewidth]{example-image-b}}
\caption{Two figures.}
\end{figure}
bar
\end{document}

### 使用 subcaption 宏包

subcaption 宏包适合与 caption 宏包联用。因此，若文档中已经使用了 caption 调整题注的样式，首先应考虑 subcaption 宏包来实现子题注。

subcaption 提供的 \subcaption 命令是实现子题注最简便的方式：只需要在上述「并排摆放，各有标题」的基础上，将 \caption 命令替换成 \subcaption 命令即可。

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]
\centering
\begin{minipage}{0.48\linewidth}
\centering
\includegraphics[width = \linewidth]{example-image-a}
\subcaption{Dummy Subcaption A.}
\end{minipage}\hfill
\begin{minipage}{0.48\linewidth}
\centering
\includegraphics[width = \linewidth]{example-image-b}
\subcaption{Dummy Subcaption B.}
\end{minipage}
\caption{Dummy Caption.}
\end{figure}
bar
\end{document}

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[showframe]{geometry}
\begin{document}
Foo
\begin{figure}[htb]
\centering
\subcaptionbox{Dummy Subcaption A.}{\includegraphics[width = .48\linewidth]{example-image-a}}\hfill
\subcaptionbox{Dummy Subcaption B.}{\includegraphics[width = .48\linewidth]{example-image-b}}
\caption{Dummy Caption.}
\end{figure}
bar
\end{document}