重庆邮电大学毕业论文latex模板使用笔记

全程在overleaf上使用XeLatex编译,使用官方letex模板2.0。主要是记录一下自己遇到的问题,以下遇到的问题也均在overleaf上遇到并完成修改,加粗部分为解决方案
本人也很菜,以下内容并不一定是最佳解决方案,遇到问题之后会继续更新。三角形是可以点击的,里面有代码

  1. 引用文献,模板里使用了\textsuperscript{\cite{ref1}}来完成上标。
    但实际上在custom里面已经定义了\supercite{}来做上标的引用,直接用就行

  2. 如果图名称超过一行,word模板里要求中英文题目同时左右缩进4字符:“题名超过一行时,两端对齐,左右缩进4字符,必要时可适当调整左右缩进,避免末行只有1、2个字符的情况。”Latex模板里是只有中文左缩进了一个quad,如果中文超过一行的话编译会超过边界:

学校的latex模板的内容
\vspace{0.3cm}

\begin{figure}[!h]
	\centering
	\subfigure[]{
		\label{fig:DE_J}
		\includegraphics[width=12cm]{chapters/DE_J.pdf}}
	\subfigure[]{
		\label{fig:DE_CF}
		\includegraphics[width=12cm]{chapters/DE_CF.pdf}}
	\begin{itemize}[leftmargin=1.6cm,rightmargin=1.6cm]
		\item[\quad] \bicaption[\xiaosi 理论效率与$\gamma$和$\varphi$的关系,测试测试测试测试测试测试测试]{\wuhao 理论效率与$\gamma$和$\varphi$的关系,测试测试测试测试测试测试测试 (a) $\alpha=1$; (b) $\alpha=2/\sqrt{3}$}{\wuhaob Theoretical DE versus $\gamma$ and $\varphi$. (a) $\alpha=1$; (b) $\alpha=2/\sqrt{3}$Theoretical DE versus $\gamma$ and $\varphi$. (a) $\alpha=1$; (b) $\alpha=2/\sqrt{3}$}
	\end{itemize}
\vspace{-1cm}


实际上使用caption包后在环境里面加入\captionsetup{margin=4em}就可以达到要求了。

  1. 如果在图名字中使用了\supercite,那么在图索引中,由于图名出现的更早,会导致该引用在顺序排序时靠前。
    直接把图索引表、表索引表、缩写和符号表全注释掉了,反正也不是必须的。

  2. 不喜欢bibitem
    换成了bibtex并使用\bibliographystyle{gbt7714-2005-numerical}按照引用顺序排序

  3. 参考文献的人名,学校要求全部大写,但编译出来很多是只有首字母大写
    部分文献库导出时信息过于丰富,比如ADS,会使用{}保护作者的姓,被{}保护的部分不会被强制大写,删掉即可。如果情况和我一致,可以使用以下的程序进行修改。

清除author中的{}
import re
import os

def process_author_line(line):
    # 如果该行包含 "author =" 则进行处理
    if re.search(r'^\s*author\s*=', line):
        # 正则匹配
        m = re.search(r'^(.*author\s*=\s*)(.*?)(\s*,\s*)$', line, re.IGNORECASE)
        if m:
            prefix = m.group(1)   # author =
            content = m.group(2)  # 作者
            suffix = m.group(3)   # 包含逗号以及空白字符

            # 去掉作者内容中的所有 { 和 }
            new_content = content.replace('{', '').replace('}', '')
            # 去除前后空白后,在前后添加新的花括号包围整个作者列表
            new_content = '{' + new_content.strip() + '}'
            # 返回修改后的行
            return prefix + new_content + suffix
    return line

def process_file(file_content):
    # 按行处理文件内容
    lines = file_content.splitlines()
    new_lines = [process_author_line(line) for line in lines]
    return "\n".join(new_lines)

def main():
    # 将下面的路径修改为你的BibTeX文件路径
    input_file = r"G:\WORK\test\references.bib"

    with open(input_file, 'r', encoding='utf-8') as f:
        content = f.read()

    new_content = process_file(content)

    dir_name = os.path.dirname(input_file)
    base_name, ext = os.path.splitext(os.path.basename(input_file))
    output_file = os.path.join(dir_name, base_name + "_cleaned" + ext)

    # 将处理后的内容写入输出文件
    with open(output_file, 'w', encoding='utf-8') as f:
        f.write(new_content)

    print(f"处理后的文件已保存到: {output_file}")

if __name__ == '__main__':
    main()
  1. word版里要求脚标使用“①”的样式,并要求每一页都从1开始重新排序,latex模板里完全没涉及到脚标相关内容,默认的脚标不符合要求。
    加几个包,在custom里定义一下新脚标:
脚注
\usepackage{pifont} 
\usepackage{footmisc}
\usepackage{setspace} 
\usepackage[perpage]{footmisc}

\makeatletter
% 设定脚注格式
\renewcommand\footnoterule{%  
  \kern-3\p@
  \hrule width 0.4\columnwidth height 0.4pt
  \kern 2.6\p@}
\renewcommand{\@makefntext}[1]{% 
  \noindent
  \footnotesize 
  \hangindent=1.5em \hangafter=1 
  \thefootnote\hspace{0.5em} 
  #1 
}
\makeatother

  1. 在\bicaption里无法引用。
    用\protect\supercite{}保护一下,保持bicaption的中文内容一致
posted @   AmeryWMW  阅读(77)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 写一个简单的SQL生成工具
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
点击右上角即可分享
微信分享提示