北航论文格式零失误:BUAAthesis模板中图表、公式与代码块的规范使用
北航论文格式零失误:BUAAthesis模板中图表、公式与代码块的规范使用
【免费下载链接】BUAAthesis北航毕设论文LaTeX模板项目地址: https://gitcode.com/gh_mirrors/bu/BUAAthesis
BUAAthesis是北航毕设论文LaTeX模板,能帮助北航学子轻松搞定论文格式,让你专注于内容创作,避免格式问题影响毕业。
图表规范使用指南 📊
单图插入的最快方法
在BUAAthesis模板中插入单张图片,使用figure环境配合\includegraphics命令即可。只需设置图片路径和宽度,模板会自动处理编号和排版。
\begin{figure}[h!] \centering \includegraphics[width=0.4\textwidth]{figure/image.pdf} \caption{图片} \label{fig-sample} \end{figure}其中[h!]参数确保图片尽量排在当前位置,width=0.4\textwidth表示图片宽度为正文宽度的40%,你可以根据需要调整这个比例。
多图排列的实用技巧
当需要展示多张图片时,BUAAthesis提供了多种排列方式:
- 并排排列:使用
minipage环境实现左右并排
\begin{figure}[h!] \begin{minipage}{.5\textwidth} \centering \includegraphics[width=0.6\textwidth]{figure/image.pdf} \caption{并排的左图} \label{fig-mini-l} \end{minipage} \begin{minipage}{.5\textwidth} \centering \includegraphics[width=0.6\textwidth]{figure/image.pdf} \caption{并排的右图} \label{fig-mini-r} \end{minipage} \end{figure}- 子图排列:使用
subfigure环境创建带共同标题的子图
\begin{figure}[h!] \centering \subfigure[并排小图a]{ \includegraphics[width=0.3\textwidth]{figure/image.pdf} } \hspace{4em} \subfigure[并排小图b]{ \includegraphics[width=0.3\textwidth]{figure/image.pdf} } \caption{子图并排的示例} \end{figure}- 矩阵排列:结合
tabular和subfigure实现多图矩阵排列
\begin{figure}[h!] \centering \begin{tabular}{cc} \subfigure[矩阵子图A]{ \includegraphics[width=0.3\textwidth]{figure/image.pdf} } & \subfigure[矩阵子图B]{ \includegraphics[width=0.3\textwidth]{figure/image.pdf} } \\ \subfigure[矩阵子图C]{ \includegraphics[width=0.3\textwidth]{figure/image.pdf} } & \subfigure[矩阵子图D]{ \includegraphics[width=0.3\textwidth]{figure/image.pdf} } \\ \end{tabular} \caption{矩形的subfig排列} \end{figure}表格规范使用技巧 📑
基础三线表格制作
北航论文推荐使用三线表格,在BUAAthesis中实现非常简单:
\begin{table} \centering \caption{降压损失计算结果} \begin{tabular}{lcr} \toprule 换热器 & 热边压降损失 & 冷边压降损失 \\ \midrule 初级 & 2974.37 & 2931.52 \\ 次级 & 2924.65 & 3789.76 \\ \bottomrule \end{tabular} \end{table}使用\toprule、\midrule和\bottomrule命令创建三线表格,比普通表格更显专业和清晰。
列合并与行合并方法
- 列合并:使用
\multicolumn命令
\begin{tabular}{l|l|l|l} \hline 1.1 & 1.2 & 1.3 & 1.4 \\ \hline 2.1 & \multicolumn{2}{c|}{2.2 \& 2.3} & 2.4 \\ \hline 3.1 & 3.2 & 3.3 & 3.4 \\ \hline \end{tabular}- 行合并:使用
\multirow命令
\begin{tabular}{l|l|l} \hline 1.1 & 1.2 & 1.3 \\ \hline 2.1 & \multirow{2}*{2.2 \& 3.2} & 2.3 \\ \cline{1-1} \cline{3-3} 3.1 & & 3.3 \\ \hline 4.1 & 4.2 & 4.3 \\ \hline \end{tabular}长表格处理方案
当表格内容超过一页时,使用longtable环境:
\begin{longtable}{|l|l|l|} % 表格的首个表头 \caption{长表格示例\label{tab-long-example}} \\ \hline \multicolumn{1}{|c|}{\textbf{Time (s)}} & \multicolumn{1}{c|}{\textbf{Triple chosen}} & \multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline \endfirsthead % 表格的其他表头 \multicolumn{3}{l}{{\bfseries\tablename\ \thetable{} --接\,上\,页}} \\ \hline \multicolumn{1}{|c|}{\textbf{Time (s)}} & \multicolumn{1}{c|}{\textbf{Triple chosen}} & \multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline \endhead % 表格内容行 0 & (1, 11, 13725) & (1, 12, 10980), (1, 13, 8235), (2, 2, 0) \\ 2745 & (1, 12, 10980) & (1, 13, 8235), (2, 2, 0), (2, 3, 0) \\ % ... 更多行 ... \endlastfoot \end{longtable}公式规范编辑方法 🧮
行内公式与独立公式
- 行内公式:使用
$ $包裹
$sin^2{\alpha}+cos^2{\alpha}=1$- 独立公式:使用
equation环境
\begin{equation} \label{equ-sample} E=mc^2 \end{equation}复杂公式排版
对于多行公式,可以使用align环境:
\begin{align} c & = a^2 - b^2\\ & = (a+b)(a-b) \end{align}对于方程组,使用cases环境:
\begin{equation} \left\{ \begin{array}{l} \nabla f(x^*)-\sum\limits_{j=1}^p\lambda_j\nabla g_j(x^*)=0 \\ \lambda_jg_j(x^*)=0,\quad j=1,2,\cdots,p \\ \lambda_j\ge 0,\quad j=1,2,\cdots,p. \end{array} \right. \end{equation}代码块规范展示 💻
使用listings环境展示代码,支持语法高亮和行号:
\begin{lstlisting}[ language={C}, caption={一段C源代码}, label={code-c-sample}, ] #include <stdio.h> void main() { printf("Hello, world!"); } \end{lstlisting}可以通过设置language参数指定不同编程语言,如Python、Java等。
图表公式交叉引用 🔗
在BUAAthesis中,使用\label和\ref命令实现交叉引用:
% 在图表或公式后设置标签 \begin{figure}[h!] ... \label{fig-example} \end{figure} % 在正文中引用 如图\ref{fig-example}所示,这是一个示例图片。快速上手BUAAthesis模板 🚀
首先克隆仓库:
git clone https://gitcode.com/gh_mirrors/bu/BUAAthesis根据学位类型选择对应的示例文件:
- 本科生:sample-bachelor.tex
- 研究生:sample-master.tex
在
data目录下编写论文内容:- 章节文件:data/chapter1-intro.tex
- 参考文献:data/bibs.bib
使用Makefile编译:
make
通过以上步骤,你就能快速使用BUAAthesis模板写出格式规范的北航毕业论文,避免格式问题影响毕业!
常见问题解决 ❓
如果在使用过程中遇到问题,可以参考模板提供的FAQ文档:data/appendix1-faq.tex,里面汇总了常见问题及解决方案。
希望本文能帮助你顺利完成北航毕业论文的格式排版,祝大家毕业顺利!
【免费下载链接】BUAAthesis北航毕设论文LaTeX模板项目地址: https://gitcode.com/gh_mirrors/bu/BUAAthesis
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
