Debian Codegraph @

texmf-dist/doc/latex/hitreport/data/chap02.tex

raw
1 % !TeX root = ../hitreport-example.tex
2
3 \chapter{图表示例}
4
5 \section{插图}
6
7 图片通常在 {figure} 环境中使用 {includegraphics} 插入,如图~\ref{fig:example} 的源代码。
8 建议矢量图片使用 PDF 格式,比如数据可视化的绘图;
9 照片应使用 JPG 格式;
10 其他的栅格图应使用无损的 PNG 格式。
11 注意,LaTeX 不支持 TIFF 格式;EPS 格式已经过时。
12
13 \begin{figure}
14 \centering
15 \includegraphics[width=0.6\linewidth]{example-image-a.pdf}
16 \caption{示例图片}
17 \label{fig:example}
18 \end{figure}
19
20 若图或表中有附注,采用英文小写字母顺序编号,附注写在图或表的下方。
21 % LaTeX 传统上一般将附注的内容同图表的标题写在一起,形成很长的一段文字。
22
23 如果一个图由两个或两个以上分图组成时,各分图分别以(a)、(b)、(c)...... 作为图序,并须有分图题。
24 推荐使用 {subcaption} 宏包来处理, 比如图~\ref{fig:subfig-a} 和图~\ref{fig:subfig-b}。
25
26 \begin{figure}
27 \centering
28 \subcaptionbox{分图 A\label{fig:subfig-a}}
29 {\includegraphics[width=0.45\linewidth]{example-image-a.pdf}}
30 \subcaptionbox{分图 B\label{fig:subfig-b}}
31 {\includegraphics[width=0.45\linewidth]{example-image-b.pdf}}
32 \caption{多个分图的示例}
33 \label{fig:multi-image}
34 \end{figure}
35
36
37
38 \section{表格}
39
40 表应具有自明性。为使表格简洁易读,尽可能采用三线表,如表~\ref{tab:three-line}。
41 三条线可以使用 {booktabs} 宏包提供的命令生成。
42
43 \begin{table}
44 \centering
45 \caption{三线表示例}
46 \begin{tabular}{ll}
47 \toprule
48 文件名 & 描述 \\
49 \midrule
50 thuthesis.dtx & 模板的源文件,包括文档和注释 \\
51 thuthesis.cls & 模板文件 \\
52 thuthesis-*.bst & BibTeX 参考文献表样式文件 \\
53 thuthesis-*.bbx & BibLaTeX 参考文献表样式文件 \\
54 thuthesis-*.cbx & BibLaTeX 引用样式文件 \\
55 \bottomrule
56 \end{tabular}
57 \label{tab:three-line}
58 \end{table}
59
60 表格如果有附注,尤其是需要在表格中进行标注时,可以使用 {threeparttable} 宏包。
61 研究生要求使用英文小写字母 a、b、c……顺序编号,本科生使用圈码 ①、②、③……编号。
62
63 \begin{table}
64 \centering
65 \begin{threeparttable}[c]
66 \caption{带附注的表格示例}
67 \label{tab:three-part-table}
68 \begin{tabular}{ll}
69 \toprule
70 文件名 & 描述 \\
71 \midrule
72 thuthesis.dtx\tnote{a} & 模板的源文件,包括文档和注释 \\
73 thuthesis.cls\tnote{b} & 模板文件 \\
74 thuthesis-*.bst & BibTeX 参考文献表样式文件 \\
75 thuthesis-*.bbx & BibLaTeX 参考文献表样式文件 \\
76 thuthesis-*.cbx & BibLaTeX 引用样式文件 \\
77 \bottomrule
78 \end{tabular}
79 \begin{tablenotes}
80 \item [a] 可以通过 xelatex 编译生成模板的使用说明文档;
81 使用 xetex 编译 {thuthesis.ins} 时则会从 {.dtx} 中去除掉文档和注释,得到精简的 {.cls} 文件。
82 \item [b] 更新模板时,一定要记得编译生成 {.cls} 文件,否则编译论文时载入的依然是旧版的模板。
83 \end{tablenotes}
84 \end{threeparttable}
85 \end{table}
86
87 如某个表需要转页接排,可以使用 {longtable} 宏包,需要在随后的各页上重复表的编号。
88 编号后跟表题(可省略)和“(续)”,置于表上方。续表均应重复表头。
89
90 \begin{longtable}{cccc}
91 \caption{跨页长表格的表题} \\
92 \toprule
93 表头 1 & 表头 2 & 表头 3 & 表头 4 \\
94 \midrule
95 \endfirsthead
96 \caption[]{跨页长表格的表题(续)} \\
97 \toprule
98 表头 1 & 表头 2 & 表头 3 & 表头 4 \\
99 \midrule
100 \endhead
101 \bottomrule
102 \endfoot
103 Row 1 & & & \\
104 Row 2 & & & \\
105 Row 3 & & & \\
106 Row 4 & & & \\
107 Row 5 & & & \\
108 Row 6 & & & \\
109 Row 7 & & & \\
110 Row 8 & & & \\
111 Row 9 & & & \\
112 Row 10 & & & \\
113 Row 11 & & & \\
114 Row 12 & & & \\
115 Row 13 & & & \\
116 Row 14 & & & \\
117 Row 15 & & & \\
118 Row 16 & & & \\
119 Row 17 & & & \\
120 Row 18 & & & \\
121 Row 19 & & & \\
122 Row 20 & & & \\
123 Row 21 & & & \\
124 Row 22 & & & \\
125 Row 23 & & & \\
126 Row 24 & & & \\
127 Row 25 & & & \\
128 Row 26 & & & \\
129 Row 27 & & & \\
130 Row 28 & & & \\
131 Row 29 & & & \\
132 Row 30 & & & \\
133 Row 31 & & & \\
134 Row 32 & & & \\
135 Row 33 & & & \\
136 Row 34 & & & \\
137 Row 35 & & & \\
138 Row 36 & & & \\
139 Row 37 & & & \\
140 Row 38 & & & \\
141 Row 39 & & & \\
142 Row 40 & & & \\
143 Row 41 & & & \\
144 Row 42 & & & \\
145 Row 43 & & & \\
146 Row 44 & & & \\
147 Row 45 & & & \\
148 Row 46 & & & \\
149 Row 47 & & & \\
150 Row 48 & & & \\
151 Row 49 & & & \\
152 Row 50 & & & \\
153 \end{longtable}