这个提交包含在:
2026-01-03 14:57:45 +08:00
当前提交 36118f201f
共有 15 个文件被更改,包括 543 次插入 和 0 次删除

19
.gitignore vendored 普通文件
查看文件

@ -0,0 +1,19 @@
.git
.svn
.hg
.DS_Store
Thumbs.db
*.aux
*.bcf
*.log
*.out
*.blg
*.bbl
*.run.xml
*.synctex.gz
*.pdf
*.toc
*.lof
*.nav
*.snm
*.vrb

83
.vscode/settings.json vendored 可执行文件
查看文件

@ -0,0 +1,83 @@
{
"latex-workshop.latex.recipes": [
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "pdflatex -> biber -> pdflatex (x2)",
"tools": [
"pdflatex",
"biber",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.latex.tools": [
{
"name": "texify",
"command": "texify",
"args": [
"--synctex",
"--pdf",
"--tex-option=\"-interaction=nonstopmode\"",
"--tex-option=\"-file-line-error\"",
"%DOC%.tex"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
},
{
"name": "biber",
"command": "biber",
"args": ["%DOCFILE%"]
}
],
"latex-workshop.latex.clean.fileTypes": [
"*.aux", "*.bbl", "*.blg", "*.bcf", "*.run.xml"
],
"latex.linter.enabled": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**.aux":true,
"**.bcf":true,
"**.log":true,
"**.out":true,
"**.blg":true,
"**.bbl":true,
"**.run.xml":true,
"**.synctex.gz":true
}
}

3
README.MD 普通文件
查看文件

@ -0,0 +1,3 @@
# 说明
通过修改config目录下的配置文件来启用或者关闭功能。
content目录下是相应的主要功能。

二进制
assets/MUC.jpg 可执行文件

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 30 KiB

66
builtin/abstract.tex 可执行文件
查看文件

@ -0,0 +1,66 @@
\makeatletter
\def\muckeywords{} % @符号变量需包裹
\def\mucenglishkeywords{} % @符号变量需包裹
\makeatother
\newcommand{\keywords}[1]{%
\makeatletter
\def\muckeywords{#1}%
\makeatother
}
% 关键词生成
\newcommand{\makekeywords}{%
\makeatletter
\par\noindent
{\heiti\sihao 关键词:}%
\songti\sihao\space
\muckeywords
\makeatother
}
\newcommand{\englishkeywords}[1]{%
\makeatletter
\def\mucenglishkeywords{#1}%
\makeatother
}
% 关键词生成
\newcommand{\makeenglishkeywords}{%
\makeatletter
\par\noindent
{\textbf{Key Words: }}%
\space
\mucenglishkeywords
\makeatother
}
\newenvironment{textarea}[1]{
\phantomsection % 创建超链接锚点
\addcontentsline{toc}{section}{#1}
\begin{center}
\textbf{\heiti\sanhao {#1}}
\end{center}
\par{}
\obeylines{}
\ignorespaces{}
\songti\sihao
}{
\par{}
}
% 摘要环境
\newenvironment{MUCAbstract}{%
\begin{textarea}{摘要}
}{%
\makekeywords
\end{textarea}
}
% 摘要环境
\newenvironment{MUCENAbstract}{%
\begin{textarea}{Abstract}
}{%
\makeenglishkeywords{}
\end{textarea}
}

90
builtin/config.tex 可执行文件
查看文件

@ -0,0 +1,90 @@
\makeatletter
\def\mucdoctitle{}
\makeatother
\newcommand{\doctitle}[1]{%
\makeatletter
\def\mucdoctitle{#1}%
\makeatother
}
\newcommand{\makedoctitle}{%
\makeatletter
{\fontsize{18pt}{20pt} \selectfont \heiti{} \mucdoctitle }\\
\makeatother
}
\makeatletter
\def\mucdocsubtitle{}
\makeatother
\newcommand{\docsubtitle}[1]{%
\makeatletter
\def\mucdocsubtitle
{#1}%
\makeatother
}
\newcommand{\makedocsubtitle}{%
\makeatletter
{\fontsize{16pt}{18pt} \selectfont \heiti{}%
\ifx\mucdocsubtitle\empty\else ——\mucdocsubtitle\fi}
\makeatother
}
\makeatletter
\def\varmucprojectid{}
\makeatother
\newcommand{\mucprojectid}[1]{%
\makeatletter
\def\varmucprojectid{#1}%
\makeatother
}
\makeatletter
\def\varmucprojecttype{}
\makeatother
\newcommand{\mucprojecttype}[1]{%
\makeatletter
\def\varmucprojecttype{#1}%
\makeatother
}
\makeatletter
\def\varmucprojectteacher{}
\makeatother
\newcommand{\mucprojectteacher}[1]{%
\makeatletter
\def\varmucprojectteacher{#1}%
\makeatother
}
\makeatletter
\def\varmucprojectmembers{}
\makeatother
\newcommand{\mucprojectmembers}[1]{%
\makeatletter
\def\varmucprojectmembers{#1}%
\makeatother
}
\makeatletter
\def\varmucprojectunit{}
\makeatother
\newcommand{\mucprojectunit}[1]{%
\makeatletter
\def\varmucprojectunit{#1}%
\makeatother
}
\newcommand{\mucprojectdate}[1]{%
\makeatletter
\def\varmucprojectdate{#1}%
\makeatother
}

47
builtin/cover.tex 可执行文件
查看文件

@ -0,0 +1,47 @@
\newcommand{\fontstxs}{\fontsize{15pt}{17pt} \selectfont \songti{}}
\newcommand{\fontstsh}{\fontsize{14pt}{16pt} \selectfont \songti{}}
\newcommand{\fonthtxe}{\fontsize{18pt}{20pt} \selectfont \heiti{}}
\newcommand{\makecover}{
\thispagestyle{empty}
\begin{center}
\vspace*{1cm}
\noindent
%% 这里两个minipage的作用是让Logo与标题对齐
\begin{minipage}[c]{2.17cm}
\includegraphics[width=\linewidth]{assets/MUC.jpg}
\end{minipage}
\hspace{0.5cm}
\begin{minipage}[c]{0.8\textwidth}
{\fontsize{18pt}{20pt}\selectfont \heiti{}
中央民族大学大学生创新训练计划结题论文\\[0.3cm]}
{\fontsize{12pt}{14pt}\fontfamily{phv} \selectfont \bfseries
URTP Final Thesis of Minzu University of China}
% 中文黑体小二,英文Arial小四加粗
\end{minipage}
%% 下方是正式的内容
\vspace{4cm}
\makedoctitle{}
\vspace{0.5cm}
\makedocsubtitle{}
\vspace{6cm}
\begin{tabular}{ll}
{\fontstxs{} 计划编号:} & \underline{\fontstxs{} \makebox[6cm][c]{\varmucprojectid}}\\
{\fontstxs{} 项目类型:} & \underline{\fontstxs{} \makebox[6cm][c]{\varmucprojecttype}}\\
{\fontstxs{} 指导教师:} & \underline{\fontstxs{} \makebox[6cm][c]{\varmucprojectteacher}}\\
{\fontstxs{} 项目成员:} & \underline{\fontstxs{} \makebox[6cm][c]{\varmucprojectmembers}}\\
{\fontstxs{} 依托单位:} & \underline{\fontstxs{} \makebox[6cm][c]{\varmucprojectunit}}\\
\end{tabular}
\vspace{3cm}
{\fontstsh{} \varmucprojectdate{}}
\end{center}
\clearpage
}

14
builtin/header.tex 可执行文件
查看文件

@ -0,0 +1,14 @@
\newcommand{\setupHeader}{
\renewcommand{\baselinestretch}{1.25}
\setlength{\parindent}{2em}
\titleformat{\section}{\bfseries\heiti}{\thesection}{1em}{}
\titlespacing*{\section}{0pt}{12pt}{6pt}
\pagestyle{fancy}
\setlength{\headheight}{14.5pt} % 建议值=基础值+2pt缓冲
\setlength{\headsep}{15pt} % 页眉与正文间距
\fancyhf{}
\fancyhead[C]{\songti\zihao{5}中央民族大学大学生创新训练计划结题论文}
\renewcommand{\headrulewidth}{1pt} % 页眉线粗细
\fancyfoot[C]{\thepage}
}

108
complie.sh 可执行文件
查看文件

@ -0,0 +1,108 @@
#!/bin/bash
# 增强版编译脚本
# 支持:自动检测编译器、错误重试、PDF预览
set -e # 遇到错误立即退出
TEX_FILE=${1:-main.tex}
BASE_NAME="${TEX_FILE%.*}"
# 检测编译器
detect_compiler() {
if grep -q "documentclass.*{ctex" "$TEX_FILE" || \
grep -q "usepackage.*{xeCJK" "$TEX_FILE" || \
grep -q "usepackage.*{fontspec" "$TEX_FILE"; then
COMPILER="xelatex"
elif grep -q "usepackage.*{luatex" "$TEX_FILE"; then
COMPILER="lualatex"
else
COMPILER="pdflatex"
fi
echo "检测到使用 $COMPILER 编译器"
}
# 编译函数
compile_tex() {
local attempt=1
local max_attempts=3
while [ $attempt -le $max_attempts ]; do
echo "编译尝试 $attempt/$max_attempts ..."
$COMPILER -synctex=1 -interaction=nonstopmode -file-line-error "$TEX_FILE"
if [ $? -eq 0 ]; then
return 0
fi
attempt=$((attempt + 1))
sleep 1
done
return 1
}
# 主流程
main() {
echo "📄 编译文档: $TEX_FILE"
detect_compiler
# 第一次编译
echo "🔄 第一次编译..."
if ! compile_tex; then
echo "❌ 编译失败,请检查错误信息"
exit 1
fi
# 处理参考文献
if [ -f "$BASE_NAME.bcf" ] || [ -f "$BASE_NAME.aux" ]; then
if command -v biber &> /dev/null; then
echo "📚 处理参考文献 (Biber)..."
biber "$BASE_NAME" || true
elif command -v bibtex &> /dev/null; then
echo "📚 处理参考文献 (BibTeX)..."
bibtex "$BASE_NAME" || true
fi
# 后续编译
echo "🔄 第二次编译..."
compile_tex
echo "🔄 第三次编译..."
compile_tex
fi
# 清理文件
echo "🧹 清理中间文件..."
cleanup
echo "✅ 编译成功: $BASE_NAME.pdf"
# 自动打开PDF
if [ "$2" == "--view" ] || [ "$2" == "-v" ]; then
open_pdf
fi
}
# 清理函数
cleanup() {
rm -f "$BASE_NAME".{aux,log,bbl,bcf,blg,run.xml,toc,out,lof,lot,nav,snm,vrb} 2>/dev/null || true
rm -f _minted-* 2>/dev/null || true
}
# 打开PDF
open_pdf() {
if [ -f "$BASE_NAME.pdf" ]; then
if command -v xdg-open &> /dev/null; then
xdg-open "$BASE_NAME.pdf" &
elif command -v open &> /dev/null; then
open "$BASE_NAME.pdf" &
else
echo "⚠️ 无法自动打开PDF,请手动查看"
fi
fi
}
# 运行主函数
main "$@"

10
config/configure.tex 普通文件
查看文件

@ -0,0 +1,10 @@
\doctitle{论文标题}
\docsubtitle{副标题}
\keywords{结题论文;模板;教务处;服务}
\englishkeywords{Eassy; Template}
\mucprojectid{项目编号甲乙丙丁戊己庚辛}
\mucprojecttype{青苗计划}
\mucprojectteacher{指导教师}
\mucprojectmembers{甲同学、乙同学、丙同学}
\mucprojectunit{理学院}
\mucprojectdate{2026年1月1日}

10
content/abstract.tex 可执行文件
查看文件

@ -0,0 +1,10 @@
\begin{MUCAbstract}
这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。
这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。这里是摘要。
\end{MUCAbstract}
\newpage{}
\begin{MUCENAbstract}
This is the English abstract.
\end{MUCENAbstract}

14
content/attach.tex 可执行文件
查看文件

@ -0,0 +1,14 @@
%% 附录与致谢
\begin{textarea}{附录}
附录主要列入正文内容过分冗长、或重复性的内容,或者提供查阅方便所需的辅助性表格、计算程序及说明等,如没有相关内容则本部分可以略去。以下是一个附录实例:
\end{textarea}
\newpage{}
\begin{textarea}{致谢}
此处可以将你在做项目的感受写上,特别是致谢,如:“感谢我的指导老师、我的父母、我的同学,以及所有帮助过我的人们,没有他们我是无法完成我的结题论文的,谢谢”。
\end{textarea}
\newpage{}
\phantomsection % 创建超链接锚点
\addcontentsline{toc}{section}{参考文献}
\printbibliography{}

13
content/body.tex 可执行文件
查看文件

@ -0,0 +1,13 @@
% 正文区
\section{什么是LaTeX}
\LaTeX{}是一个让你的文档看起来更专业的排版系统,而不是文字处理器。它尤其适合处理篇幅较长、结构严谨的文档,并且十分擅长处理公式表达。它是免费的软件,对大多数操作系统都适用。
\LaTeX{} 基于 TeX(Donald Knuth 在 1978 年为数字化排版设计的排版系统)。TeX 是一种电脑能够处理的低级语言,但大多数人发现它很难使用。\LaTeX{} 正是为了让它变得更加易用而设计的。目前 \LaTeX{} 的版本是 \LaTeX{} 2e。
如果你习惯于使用微软的 Office Word 处理文档,那么你会觉得 \LaTeX{} 的工作方式让你很不习惯。Word 是典型的「所见即所得」的编辑器,你可以在编排文档的时侯查看到最终的排版效果。但使用 \LaTeX{} 时你并不能方便地查看最终效果,这使得你专注于内容而不是外观的调整。
一个 \LaTeX{} 文档是一个以 .tex 结尾的文本文件,可以使用任意的文本编辑器编辑,比如 Notepad,但对于大多数人而言,使用一个合适的 \LaTeX{} 编辑器会使得编辑的过程容易很多。在编辑的过程中你可以标记文档的结构。完成后你可以进行编译——这意味着将它转化为另一种格式的文档。它支持多种格式,但最常用的是 PDF 文档格式。\cite{latexTemplate}
\section{为什么要使用LaTeX}
123
这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文这是正文

58
main.tex 可执行文件
查看文件

@ -0,0 +1,58 @@
%!TeX encoding = UTF-8
%!BIB program = biber
\documentclass[12pt,a4paper,UTF8]{ctexart}
\usepackage[top=2.5cm,bottom=2.5cm,left=2cm,right=2cm,bindingoffset=0.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{indentfirst}
\usepackage{amsmath}
\usepackage{url}
\usepackage[hidelinks]{hyperref}
\usepackage[backend=biber, style=gb7714-2015]{biblatex}
\addbibresource{ref.bib}
% 内建的功能 %
\input{builtin/cover.tex}
\input{builtin/header.tex}
\input{builtin/config.tex}
\input{builtin/abstract.tex}
\setupHeader{}
\newcommand{\sanhao}{\fontsize{15.6pt}{\baselineskip}\selectfont} % 三号
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont} % 四号
\titleformat{\subsection}{\bfseries\songti\xiaosi}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\songti\xiaosi}{\thesubsubsection}{1em}{}
\setlist[enumerate,1]{label=(\arabic*),leftmargin=2em}
\setlist[enumerate,2]{label=\alph*.,leftmargin=4em}
\input{config/configure.tex}
\begin{document}
% 封面和目录%
\makecover{}
\tableofcontents{}
\newpage{}
% 摘要%
\input{content/abstract.tex}
\newpage{}
% 文章主题%
\par{} \indent{}
\obeylines{}
\ignorespaces{}
\input{content/body.tex}
\par{}
\newpage{}
% 附录、感谢和参考文献%
\input{content/attach.tex}
\end{document}

8
ref.bib 可执行文件
查看文件

@ -0,0 +1,8 @@
@thesis{latexTemplate,
title = {基于LaTeX的中央民族大学论文模版},
author = {岚椿桦},
type = {undergraduate},
school = {中央民族大学},
year = {2025},
langid = {zh}
}