init repo

This commit is contained in:
jackfiled 2024-11-24 17:46:47 +08:00
commit 5e5275b73b
12 changed files with 3103 additions and 0 deletions

39
.gitignore vendored Normal file
View File

@ -0,0 +1,39 @@
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## VS Code
.vscode/
## macOS
.DS_Store
## Temporary files
temp/
BUPTBachelorThesis.pdf

7
.latexmkrc Normal file
View File

@ -0,0 +1,7 @@
$pdf_mode = 1;
$pdflatex = "xelatex -file-line-error --shell-escape -src-specials -synctex=1 -interaction=nonstopmode %O %S;cp %D %R.pdf";
$recorder = 1;
$clean_ext = "synctex.gz acn acr alg aux bbl bcf blg brf fdb_latexmk glg glo gls idx ilg ind ist lof log lot out run.xml toc dvi";
$bibtex_use = 2;
$out_dir = "temp";
$jobname = "BUPTBachelorThesis";

2593
BUPTBachelor.bst Normal file

File diff suppressed because it is too large Load Diff

258
BUPTBachelorThesis.sty Normal file
View File

@ -0,0 +1,258 @@
\usepackage{ctex} % invole CJKfntef
\usepackage{xeCJKfntef}
\usepackage{setspace} % spacing
\usepackage{xcolor} % color
\usepackage{xltxtra} % print a XeLaTeX
\usepackage{setspace}
\usepackage{subfiles}
% Font family
\setmainfont[Mapping=tex-text]{Times New Roman}
% Normal font size is XiaosiHao
\renewcommand{\normalsize}{\zihao{-4}\songti\normalfont}
% Word spacing
% Usage: \ziju{spacing} spacing can be 1em, 10pt, etc.
%\newcommand{\ziju}[1]{\renewcommand{\CJKglue}{\hskip #1}}
%%%%%% Page Style %%%%%%
% Margin
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,headheight=1.5cm,headsep=0.6cm,footskip=0.5cm]{geometry}
% Header and footer
\usepackage{fancyhdr}
% 正文的页眉页脚格式
\fancypagestyle{mainmatter}{
\fancyhf{} % clear all header and footer fields
\fancyhead[C]{\songti\zihao{-5}{北京邮电大学本科毕业设计(论文)}}
\fancyfoot[C]{\songti\zihao{-5}{\thepage}}
\renewcommand{\headrulewidth}{0.8pt}
}
% 目录页的页眉页脚格式
\fancypagestyle{frontmatter}{
\fancyhf{} % clear all header and footer fields
\fancyhead[C]{\songti\zihao{-5}{北京邮电大学本科毕业设计(论文)}}
\fancyfoot[C]{\songti\zihao{-5}{\thepage}}
\renewcommand{\headrulewidth}{0.8pt}
}
% Bookmark (Chinese bookmark supported)
\usepackage{url}
\def\UrlFont{}
\usepackage[xetex, pdfstartview=FitH,
bookmarksnumbered=true, bookmarksopen=true, bookmarksdepth=2, colorlinks=true,
pdfborder=001, linkcolor=black, citecolor=black, urlcolor=black]{hyperref} % 修改bookmarksdepth指定书签层级
% Deal with line breaking in url
\makeatletter
\def\UrlAlphabet{%
\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j%
\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t%
\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D%
\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N%
\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X%
\do\Y\do\Z}
\def\UrlDigits{\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9\do\0}
\g@addto@macro{\UrlBreaks}{\UrlOrds}
\g@addto@macro{\UrlBreaks}{\UrlAlphabet}
\g@addto@macro{\UrlBreaks}{\UrlDigits}
\makeatother
% Eliminate warnings about non-string commands not shown in PDF bookmarks. If you use more commands in section titles or chapter titles, you can add the commands here.
\pdfstringdefDisableCommands{
\def \quad{}
\def \qquad{}
}
% Line spread
\renewcommand{\baselinestretch}{1.30}
% \setlength{\itemsep}{-5pt} % item seperate too wide
% Footnote
% Usage: \footnote{Your Text}
\usepackage[perpage]{footmisc}
% \usepackage{footnpag} % footnote per page
% \usepackage{footnote}
% \let\ftnt=\footnote
% \renewcommand{\footnote}[1]{\ftnt{\footnotefont{#1}}}
% No Number Footnote
% Especially for stating which project the thesis is supported
% Usage: \blfootnote{Your Text}
\usepackage{lipsum}
\newcommand\blfootnote[1]{
\begingroup
\renewcommand\thefootnote{}\footnote{#1}
\addtocounter{footnote}{-1}
\endgroup
}
%%%%%% Detail style %%%%%%
% Underline
% Usage: \ul[length]{<text>}
\makeatletter
\newcommand\ul[2][4cm]{\hskip1pt\underline{\hb@xt@ #1{\hss#2\hss}}\hskip3pt}
\makeatother
\def\ULthickness{1.1pt}%
% Content style
\setcounter{secnumdepth}{3} % let subsubsection have number
\setcounter{tocdepth}{3} % let subsubsection appear in CONTENTS
\usepackage{titletoc}
\newif{\ifpagenumber}
\pagenumbertrue
\renewcommand\contentsname{\centerline{\toctitlefont{目\qquad{}录}}}
\titlecontents{chapter}[0em]{\tocchapterfont\vspace{0.4mm}} {%
\ifpagenumber \CTEXnumber{\CJKsection}{\thecontentslabel}{第\CJKsection{章}\quad{}} \fi}{%
} {%
\ifpagenumber \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage\fi}
\titlecontents{section}[1em]{\tocsectionfont\vspace{0.4mm}}{%
\thecontentslabel\quad{}}{}{%
\ifpagenumber \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage\fi}%
\titlecontents{subsection}[2em]{\tocsubsectionfont\vspace{0.4mm}}{%
\thecontentslabel\quad{}}{}{%
\ifpagenumber \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage\fi}%
\titlecontents{subsubsection}[3em]{\tocsubsubsectionfont\vspace{0.4mm}}{%
\thecontentslabel\quad{}}{}{%
\ifpagenumber \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage\fi}%
\makeatletter % Content Page style
\renewcommand\frontmatter{%
\if@openright\cleardoublepage\else\clearpage\fi%
\@mainmatterfalse%
\pagenumbering{Roman}% Roman style page number
\pagestyle{frontmatter}
}
\makeatother%
\makeatletter % Content Page style
\renewcommand\mainmatter{%
\if@openright\cleardoublepage\else\clearpage\fi%
\@mainmattertrue%
\pagenumbering{arabic}% Arabic style page number
\pagestyle{mainmatter}
}
\makeatother%
\makeatletter % Translation Page style
\renewcommand\backmatter{%
\if@openright\cleardoublepage\else\clearpage\fi%
\@mainmatterfalse%
\pagestyle{empty}
}
\makeatother%
% Text style
\usepackage{titlesec}
\titleformat{\chapter}[hang]{\heiti\zihao{3}\centering\textbf}{第\chinese{chapter}章}{1em}{}
% 缩短章节标题的上边距
\titlespacing{\chapter}{0pt}{-20pt}{12pt}
\titleformat{\section}{\heiti\zihao{4}\textbf}{\thesection}{1em}{}
\titleformat{\subsection}{\heiti\zihao{-4}\textbf}{\qquad{}\thesubsection}{1em}{}
\titleformat{\subsubsection}{\heiti\zihao{-4}\textbf}{\qquad{}\thesubsubsection}{1em}{}
% Reference style
% \usepackage[numbers,sort&compress]{natbib}
\usepackage[super,numbers,sort&compress]{natbib}
%\usepackage[backend=biber,texencoding=utf8,bibencoding=utf8]{biblatex}
\renewcommand\bibname{\centerline{\heiti\zihao{3}\textbf{参考文献}}}
\setcitestyle{square}
\setlength{\bibsep}{0.2em}
% Appendix
\usepackage{appendix}
%% Some tweaking/features/styles
% Figure & Table
\usepackage{caption}
\usepackage[position=t,singlelinecheck=off]{subfig}
\renewcommand{\captionfont}{\kaishu\zihao{5}}
\renewcommand{\captionlabelfont}{\kaishu\zihao{5}}
\DeclareCaptionLabelSeparator{twospace}{ ~}
\captionsetup{labelsep=twospace} %去掉图1后冒号
\renewcommand{\tablename}{表}
\renewcommand{\thetable}{~\arabic{chapter}-\arabic{table}~}
\renewcommand{\figurename}{图}
\renewcommand{\thefigure}{~\arabic{chapter}-\arabic{figure}~}
\renewcommand{\theequation}{\arabic{chapter}-\arabic{equation}~}
% 外文文献中表、图、公式、代码编号重置
\newcommand{\newtranschapter}{\thispagestyle{empty}\addtocounter{chapter}{1}\setcounter{table}{0}\setcounter{equation}{0}\setcounter{figure}{0}\setcounter{lstlisting}{0}}
% equation tweaking
\usepackage{amssymb}
\usepackage{bm} % 加粗使用
\usepackage{amsmath,delarray,bm,mathtools}
\newtagform{newtag}[]{式(}{} %定义公式编号样式
\usetagform{newtag}
% \usepackage{amsthm}
\newtheorem{definition}{定义}[chapter]
\newtheorem{theorem}{定理}[chapter]
\newtheorem{axiom}{公理}[chapter]
\newtheorem{lemma}{引理}[chapter]
\newtheorem{proposition}{命题}[chapter]
\newtheorem{corollary}{推论}[chapter]
% Algorithm
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
% Code
\usepackage{listings}
\usepackage{xcolor}
\lstset{
basicstyle=\ttfamily\wuhao, %五号等宽字体
extendedchars=true,
keywordstyle=\color{blue},
commentstyle=\color{green!30!black},
showspaces=false, % 显示空格
showstringspaces=true, % 字符串中显示空格
showtabs=false, % 显示 TAB
tabsize=2, % TAB 被当作两个空格
captionpos=t, % 标题位置
breaklines=true, % 自动断行
breakatwhitespace=true,
basewidth={0.5em,0.35em},
frame=single, %单线边框,注释掉则无边框
numbers=left, %行号位于左侧
numberbychapter=true,
% xleftmargin=.5em,
% xrightmargin=.5em,
% aboveskip=1ex,
% columns=flexible, % 如果不指定等宽字体用这个
% mathescape,
escapeinside={\%*}{*)}
}
\renewcommand{\lstlistingname}{\kaishu{代码}}
\makeatletter
\AtBeginDocument{%
\renewcommand \thelstlisting
{\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@lstlisting}%
}
\makeatother
% insert PDF
\usepackage[final]{pdfpages}
% insert blank page
\makeatletter
\newcommand\blankmatter{%
\if@openright\cleardoublepage\else\clearpage\fi%
\@mainmatterfalse%
\pagestyle{empty}}%
\makeatother%
% List environment config
\usepackage[inline]{enumitem}
% Uncomment the two lines below if you want an list environment to share the same indent
% with a paragraph and no extra blank before, in or after the list.
%\setlist[itemize]{labelindent=\parindent,leftmargin=*,noitemsep,topsep=0pt}
% Modify the label format by yourself if you do not like 1), 2), ... here.
%\setlist[enumerate]{labelindent=\parindent,leftmargin=*,noitemsep,topsep=0pt,label={\arabic*)}}

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 sqyx008
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

0
README.md Normal file
View File

32
appendix/appendix1.tex Normal file
View File

@ -0,0 +1,32 @@
\documentclass[../main.tex]{subfiles}
\begin{document}
\section*{附录1\quad{}缩略语表}
\phantomsection\addcontentsline{toc}{section}{附录1\quad{}缩略语表}
\begin{table}[!htbp]
\centering
\begin{tabular}{l|l|l|l}
\hline
\multicolumn{1}{c|}{\multirow{2}{*}{\textbf{类别}}} & \multicolumn{1}{c|}{\multirow{2}{*}{\textbf{特征}}} & \multicolumn{2}{c}{\textbf{不知道叫什么的表头}} \\
\cline{3-4}
& & \multicolumn{1}{c|}{\textbf{描述}} & \multicolumn{1}{c}{\textbf{形式与理论范围}} \\
\hline
\multirow{3}{*}{正常互动} & 点赞量 & 微博的点赞数量 & 数值,$\mathbb{N}$ \\
\cline{2-4}
& 评论量 & 微博的评论数量 & 数值,$\mathbb{N}$ \\
\cline{2-4}
& 转发量 & 微博的转发数量 & 数值,$\mathbb{N}$ \\
\hline
非正常互动 & 羡慕量 & 微博的羡慕数量 & 数值,$\mathbb{N}$ \\
\hline
\end{tabular}
\renewcommand{\arraystretch}{1.38}%
\setlength{\abovecaptionskip}{0pt}%
\setlength{\belowcaptionskip}{10pt}%
\caption{缩略语表}
\label{tab:1}
\end{table}
\end{document}

79
chapters/abstract.tex Normal file
View File

@ -0,0 +1,79 @@
\documentclass[../main.tex]{subfiles}
\begin{document}
% 中文摘要
\begin{titlepage}
\pagestyle{empty}
\begin{spacing}{1.05}
\centering
\parbox[c]{.75\textwidth}{
\centering
\heiti\zihao{3}\textbf{\thesistitle}
}
\end{spacing}
\begin{spacing}{1.5}
\centering
\zihao{-3}\quad{} \\
\heiti\zihao{-3}\textbf{\quad{}} \\
\end{spacing}
\zihao{-3}\quad{}
\normalsize
这里撰写摘要大概500字左右。
\quad{}
\par\noindent\heiti\zihao{-4}\textbf{关键词}\quad{}
{
\songti\zihao{-4}
关键词一\quad
关键词二\quad
}
\end{titlepage}
\thispagestyle{empty}
% 英文摘要
\begin{titlepage}
\pagestyle{empty}
\begin{spacing}{1.05}
\centering
% 如果你的标题太长,可能会换行;如果你对换行位置不满意,请调节下面第一个{}的参数
\parbox[c]{.75\textwidth}{
\centering
\zihao{3}\textbf{\thesisenglishtitle}
}
\end{spacing}
\begin{spacing}{1.5}
\centering
\zihao{-3}\quad \\
\zihao{-3}\textbf{ABSTRACT} \\
\end{spacing}
\zihao{-3}\quad
\normalsize
This is the english abstract, and the content should be the same as the chinese abstract.
\quad{}
\par\noindent\zihao{-4}\textbf{KEY WORDS}\quad{}%
{
\zihao{-4}
Keyword1\quad
Keyword2\quad
}
\end{titlepage}
\thispagestyle{empty}
\end{document}

7
chapters/chapter1.tex Normal file
View File

@ -0,0 +1,7 @@
\documentclass[../main.tex]{subfiles}
\begin{document}
\chapter{设计模板的背景和意义}
\end{document}

0
docs/.gitkeep Normal file
View File

67
main.tex Normal file
View File

@ -0,0 +1,67 @@
%不需要区分奇偶页的请使用下面一行
\documentclass[a4paper,AutoFakeBold,oneside,12pt]{book}
%需要区分奇偶页的(即每一章第一页一定在奇数页上)请使用下面一行
%\documentclass[a4paper,AutoFakeBold,openright,12pt]{book}
\usepackage{BUPTBachelorThesis}
% 定义某些在论文中重复使用的字段
\def\thesistitle{一种本科毕业设计论文模板的设计与实现}
\def\thesisenglishtitle{Design and Implementation of a Bachelor Thesis Template}
\begin{document}
% 封面
\blankmatter
\includepdf[pages=-]{docs/cover.pdf}
% 诚信声明
\blankmatter
\includepdf[pages=-]{docs/statement.pdf}
% 摘要
\subfile{chapters/abstract}
% 目录
\fancypagestyle{plain}{\pagestyle{frontmatter}}
\frontmatter
\tableofcontents
% 正文
\newpage
\mainmatter
\fancypagestyle{plain}{\pagestyle{mainmatter}}
\subfile{chapters/chapter1}
% 参考文献
\clearpage
\phantomsection\addcontentsline{toc}{chapter}{参考文献}
\bibliographystyle{BUPTBachelor}
\songti\zihao{5}{\bibliography{ref}}
% 致谢
\clearpage
\chapter*{\qquad{}}
\phantomsection\addcontentsline{toc}{chapter}{\qquad{}}
Thanks to everyone who helps me when finishing my bachelor thesis.
% 附录
\setcounter{figure}{0}
\renewcommand{\thefigure}{~附-\arabic{figure}~}
\setcounter{equation}{0}
\renewcommand{\theequation}{~附-\arabic{equation}~}
\setcounter{table}{0}
\renewcommand{\thetable}{~附-\arabic{table}~}
\setcounter{lstlisting}{0}
\makeatletter
\renewcommand \thelstlisting
{附-\@arabic\c@lstlisting}
\makeatother
\chapter*{\qquad{}}
\phantomsection\addcontentsline{toc}{chapter}{\qquad{}}
\subfile{appendix/appendix1}
\end{document}

0
ref.bib Normal file
View File