% !TeX root = ../main.tex % 本LaTeX模板的使用示例 \chapter{模板使用说明} \section{算法、表格和插图} 根据北航学位论文撰写规范要求,本模板重写了部分图表浮动体环境,但使用方法与官方宏包一致,使用者可查看各宏包的官方文档获取详细使用说明。 需要注意的是图表浮动体与正文之间的距离是弹性的,撰写论文时可以根据内容进行调整。 \subsection{算法环境} 本模板使用 \texttt{algorithm2e} 宏包实现算法环境。下面是四种算法环境示例。 \begin{algorithm}[htp] %\SetAlgoLined %\SetAlgoVlined \caption{A How to (plain).} \KwData{this text} \KwResult{how to write algorithm with \LaTeX2e{} } initialization\; \While{not at end of this document}{ read current\; \eIf{understand}{ go to next section\; current section becomes this one\; }{ go back to the beginning of current section\; } } \end{algorithm} \RestyleAlgo{ruled} \begin{algorithm}[htp] \caption{A How to (ruled).} \KwData{this text} \KwResult{how to write algorithm with \LaTeX2e{} } initialization\; \While{not at end of this document}{ read current\; \eIf{understand}{ go to next section\; current section becomes this one\; }{ go back to the beginning of current section\; } } \end{algorithm} \RestyleAlgo{boxed} \begin{algorithm}[htp] \caption{A How to (boxed).} \KwData{this text} \KwResult{how to write algorithm with \LaTeX2e{} } initialization\; \While{not at end of this document}{ read current\; \eIf{understand}{ go to next section\; current section becomes this one\; }{ go back to the beginning of current section\; } } \end{algorithm} \RestyleAlgo{boxruled} \begin{algorithm}[htp] \caption{A How to (boxruled).} \KwData{this text} \KwResult{how to write algorithm with \LaTeX2e{} } initialization\; \While{not at end of this document}{ read current\; \eIf{understand}{ go to next section\; current section becomes this one\; }{ go back to the beginning of current section\; } } \end{algorithm} \vspace{5em} \subsection{三线表} 学位论文中的表格推荐使用三线表形式,如表~\ref{tab:exampletable}。 \begin{table}[!h] \centering \caption{表的标题} \label{tab:exampletable} \begin{tabular}{>{\centering\arraybackslash}p{4cm}>{\centering\arraybackslash}p{4cm}} \toprule 操作系统 & TeX 发行版 \\ \midrule 所有 & TeX Live \\ macOS & MacTeX \\ Windows & MikTeX \\ \bottomrule \end{tabular} \end{table} 当表题较长时,本模板会自适应换行处理,如表~\ref{tab:example_long_table}。 \begin{table}[!h] \centering \caption{长表题示例\upcite{zhudaoqian}:考虑到实验中使用到的面内磁场的大小,以及得到的磁矩稳定翻转条件,在计算中使$\alpha$固定,其余参数则与实验中相同} \label{tab:example_long_table} \begin{tabular}{c c c c c c c} \toprule \multirow{2}{*}{\textbf{材料体系}} & \multicolumn{6}{c}{\textbf{参数}} \\ & $t_F$ & $\mu_0H_{K,eff}$ & $M_s(A\cdot m^(-1))$ & $|\Theta_SH|$ & $\iota$ & $\mu_0H_x$ \\ \midrule W/CoFeB & 1 nm & 0.29T & $9\times 10^5$ & 0.32 & 0.31 & 24mT \\ Ta/CoFeB & 1.2 nm & 0.25T & $1\times 10^6$ & 0.03 & 2 & 20mT \\ \bottomrule \end{tabular} \end{table} \vspace{-1pt} \subsection{长表格} 超过一页的表格要使用专门的 \texttt{longtable} 环境(表~\ref{tab:longtable})。\\ \begin{longtable}[h]{ccc} % 首页表头 \caption[长表格演示]{长表格演示} \label{tab:longtable}\\ \toprule 名称 & 说明 & 备注\\ \midrule \endfirsthead % 续页表头 \caption[]{长表格演示(续)} \\ \toprule 名称 & 说明 & 备注 \\ \midrule \endhead % 首页表尾 \hline \multicolumn{3}{r}{\small 续下页} \endfoot % 续页表尾 \bottomrule \endlastfoot AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ AAAAAAAAAAAA & BBBBBBBBBBB & CCCCCCCCCCCCCC \\ \end{longtable} \subsection{插图} 本模板支持插入pdf、eps、jpg和png等格式的图片。 \begin{figure}[!h] \centering \includegraphics[width=.5\textwidth]{pic/logo-buaa} \caption{测试图片\\第二行题注} \label{fig:logo} \end{figure} 模板使用了subcaption子图宏包,使用者也可自行替换惯用的宏包,一个简单的子图环境如图所示。 \begin{figure}[!h] \centering \subcaptionbox{子图1}{\includegraphics[width = 0.45\linewidth]{pic/logo-buaa.eps}\vspace{50pt}} \hfill \subcaptionbox{子图2}{\includegraphics[width = 0.3\linewidth]{pic/buaa-mark.jpg}} \caption{测试图片} \end{figure} \section{数学环境} \subsection{数学符号} 模板定义了一些正体(upright)的数学符号: \begin{center} \begin{tabular}{>{\centering\arraybackslash}p{4cm}>{\centering \arraybackslash}p{4cm}} \toprule 符号 & 命令 \\ \midrule 常数$\eu$ & \verb|\eu| \\ 复数单位$\iu$ & \verb|\iu| \\ 微分符号$\diff$ & \verb|\diff| \\ $\argmax$ & \verb|\argmax| \\ $\argmin$ & \verb|\argmin| \\ \bottomrule \end{tabular} \end{center} 更多的例子: \begin{equation} \eu^{\iu\pi} + 1 = 0 \end{equation} \begin{equation} \frac{\diff^2u}{\diff t^2} = \int f(x) \diff x \end{equation} \begin{equation} \argmin_x f(x) \end{equation} \subsection{定理、引理和证明} 模板中使用amsmath和amsthm宏包配置了定理、引理和证明等环境。举例如下。 \begin{definition} 如果函数$f$的积分是可测的且非负的,我们通过以下方式定义其(扩展)\textbf{Lebesgue积分}: \begin{equation} \int f = \sup_g \int g, \end{equation} 其中,上确界是在所有满足 $0 \leq g \leq f$ 的可测函数 $g$ 上取得的,且 $g$ 是有界的,并且其支撑集具有有限测度。 \end{definition} \begin{example} $\mathbf{R}^d$ 上的可积(或不可积)函数的简单示例如下: \begin{equation} f_a(x) = \begin{cases} |x|^{-a} & \text{if } |x| \leq 1,\\ 0 & \text{if } x > 1. \end{cases} \end{equation} \begin{equation} F_a(x) = \frac{1}{1 + |x|^a}, \qquad \text{对所有~} x \in \mathbf{R}^d. \end{equation} 那么 $f_a$ 在 $a < d$ 时恰好是可积的,而 $F_a$ 在 $a > d$ 时恰好是可积的。 \end{example} \begin{lemma}[Fatou] 假设 $\{f_n\}$ 是一列满足 $f_n \geq 0$ 的可测函数。如果对几乎处处的 $x$ 都有 $\lim_{n \to \infty} f_n(x) = f(x)$,那么 \begin{equation} \int f \leq \liminf_{n \to \infty} \int f_n. \end{equation} \end{lemma} \begin{remark} 我们不排除 $\int f = \infty$ 或 $\liminf_{n \to \infty} f_n = \infty$ 的情况。 \end{remark} \begin{corollary} 假设 $f$ 是一个非负可测函数,$\{f_n\}$ 是一列非负可测函数,满足对几乎处处的 $x$ 有 $f_n(x) \leq f(x)$ 且 $f_n(x) \to f(x)$。那么 \begin{equation} \lim_{n \to \infty} \int f_n = \int f. \end{equation} \end{corollary} \begin{proposition} 假设 $f$ 在 $\mathbf{R}^d$ 上可积。那么对于每一个 $\epsilon > 0$: \begin{enumerate} \renewcommand{\theenumi}{\roman{enumi}} \item 存在一个有限测度的集合 $B$(例如一个球),使得 \begin{equation} \int_{B^c} |f| < \epsilon. \end{equation} \item 存在一个 $\delta > 0$,使得 \begin{equation} \int_E |f| < \epsilon \qquad \text{每当~} m(E) < \delta. \end{equation} \end{enumerate} \end{proposition} \begin{theorem} 假设 $\{f_n\}$ 是一列可测函数,满足当 $n$ 趋向无穷时,$f_n(x)$ 几乎处处收敛于 $f(x)$。如果 $|f_n(x)| \leq g(x)$,其中 $g$ 是可积函数,那么 \begin{equation} \int |f_n - f| \to 0 \qquad \text{当~} n \to \infty, \end{equation} 因此 \begin{equation} \int f_n \to \int f \qquad \text{当~} n \to \infty. \end{equation} \end{theorem} \begin{proof} 略。 \end{proof} \subsection{自定义} \newtheorem*{axiomofchoice}{选择公理} \begin{axiomofchoice} 假设 $E$ 是一个集合,${E_\alpha}$ 是 $E$ 的一组非空子集。那么存在一个函数 $\alpha \mapsto x_\alpha$(一个“选择函数”),使得 \begin{equation} x_\alpha \in E_\alpha,\qquad \text{对所有 }\alpha. \end{equation} \end{axiomofchoice} \newtheorem{observation}{定理}[chapter] \begin{observation} 假设一个偏序集 $P$ 具有这样的性质,即每个链在 $P$ 中都有一个上界。那么集合 $P$ 至少包含一个最大元素。 \end{observation} \begin{proof}[证明] 略。 \end{proof} \newtheorem{observationvar2}[observation]{定理2} \begin{observationvar2} 假设一个偏序集 $P$ 满足每个链在 $P$ 中都有一个上界。那么集合 $P$ 至少包含一个最大元素。 \end{observationvar2} \begin{proof}[证明] 略。 \end{proof} \clearpage