Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

根据 2024 年学校word模板做了一些修改 #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
69 changes: 51 additions & 18 deletions YNUbachelor.cls
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

%简体中文 宋体
%\setCJKmainfont{SimSun.ttf}[Path=fonts/]
\setCJKmainfont{SimSun.ttf}[AutoFakeBold=true, Path=fonts/, Mapping=fullwidth-stop]
\setCJKmainfont{SimSun.ttf}[AutoFakeBold=true, Path=fonts/]

%简体中文 黑体
\setCJKsansfont{SimHei.ttf}[Path=fonts/]
Expand Down Expand Up @@ -68,6 +68,11 @@
Scale = MatchLowercase,
]

\setlength{\parskip}{0bp} %段落间距

% 浮动体和正文的间距
\setlength{\textfloatsep}{22bp}

\RequirePackage{amsmath,amsfonts,amssymb,siunitx}%数学公式扩展,花体,扩展符号的基础字体支持,扩展符号定义成命令,物理量的单位
%\RequirePackage[math-style=ISO, bold-style=ISO]{unicode-math}
%\setmathfont{XITS Math}
Expand All @@ -78,11 +83,16 @@
\newcommand{\otherFontSize}{\zihao{-4} \heiti}%三层及以下标题格式设置

%页边距设置
% 参考 https://github.com/ustctug/ustcthesis/blob/master/ustcthesis.cls 相关设置
\RequirePackage[a4paper,
top=2.5cm,
bottom=2.0cm,
left=3.0cm,
right=2.0cm]{geometry}
% 根据 word 视觉效果调整的页边距,通过 powertoy 的 ruler 工具测量,效果相近
top = 3.0cm,
bottom = 2.7cm,
left = 3.0cm,
right = 2.0cm,
head = 1.6cm,
foot = 0.85cm,
]{geometry}
\addtolength{\oddsidemargin}{0cm}
\addtolength{\evensidemargin}{1cm}

Expand All @@ -93,37 +103,44 @@
punct=quanjiao,%全角标点
autoindent=2,
today=small,
contentsname={目\texorpdfstring{\quad}{}录},
contentsname={目\texorpdfstring{\qquad}{}录},
listfigurename={图目录},
listtablename={表目录},
figurename={图},
tablename={表},
abstractname={摘\texorpdfstring{\quad}{}要},
abstractname={摘\texorpdfstring{\qquad}{}要},
indexname={索引},
appendixname={附录},
bibname={参考文献},
proofname={证明},
}

\ctexset{
% 关于字号和行距,见 https://blog.csdn.net/weixin_43849277/article/details/115201445#:~:text=1%20%E5%B0%8F%E5%9B%9B%E5%AD%97%E4%BD%93%E5%AF%B9%E5%BA%9412%E7%A3%85%EF%BC%8C12%20X%200.03527%20%3D%200.42324%20cm%202,cm%203%20%E6%8D%A2%E4%B8%BAbp%EF%BC%8C0.687765%20%2F%200.0353%20%3D%2019.4834%20bp
section = {
format ={\clearpage\phantomsection\centering\yiCengBiaoTi},
afterindent=true,
beforeskip={0.8em},
afterskip={0.5em},
% beforeskip={0.8em},
beforeskip=16.64bp,
% afterskip={0.5em},
afterskip=10.4bp,
fixskip = {false},
},
subsection = {
format ={\phantomsection\erCengBiaoTi},
afterindent=true,
beforeskip={0.5em},
afterskip={0.0em},
% beforeskip={0.5em},
beforeskip = 10.4bp,
afterskip= 0bp,
fixskip = {false},
},
subsubsection = {
format ={\phantomsection\otherFontSize},
afterindent=true,
beforeskip={0.5em},
% TODO: 这里的0.6 是临时方案,如果设置为0,会导致subsubsection标题和正文之间的间距过小。
% 另,设置为 0.6 em 依然有问题,如果二级标题和三级标题之间的没有正文,那么二级标题和三级标题之间的间距也会过小。
% beforeskip={0.0em},
beforeskip={0.6em},
afterskip={0.0em},
indent= {2\ccwd},
fixskip = {false},
Expand Down Expand Up @@ -183,6 +200,7 @@
%封底
\newcommand{\backcover}{
\AtEndDocument{%
\label{LastContentPage}
\clearpage~\thispagestyle{empty}
\AddToShipoutPicture*{%
\put(0,0){%
Expand Down Expand Up @@ -253,12 +271,12 @@
\fancyhf{}
\fancyhead[OC]{\zihao{5} \leftmark}
\fancyhead[EC]{\zihao{5} \@title}
\fancyfoot[C]{\zihao{5} 第\thepage 页(共~\pageref{LastPage}~页)}
\fancyfoot[C]{\zihao{5} 第\thepage 页(共~\pageref{LastContentPage}~页)}
\renewcommand\headrulewidth{0.5pt}
}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
% \renewcommand{\sectionmark}[1]{\markboth{\CTEXifname{\CTEXthesection\quad}{}#1}{}}
\setlength{\headheight}{12.64723pt}%页眉高度
% \setlength{\headheight}{12.64723pt}%页眉高度

%中英abstract, keywords设置
\renewenvironment{abstract}[1]{%
Expand All @@ -279,7 +297,7 @@
\markboth{\enabstractname}{}
}
#1}
{\thispagestyle{PreContent}}
{\thispagestyle{PreContent}\pagenumbering{Roman}}

\newcommand{\enkeywords}[1]{%
{\textbf{Key Words:} #1}}
Expand All @@ -303,18 +321,20 @@

\renewcommand\tableofcontents{%
\section*{\contentsname%
\addcontentsline{toc}{section}{\contentsname}%
% 将目录页中的目录页码标记去除
% \addcontentsline{toc}{section}{\contentsname}%
\markboth{\contentsname}{}%
}%
\pagestyle{PreContent}
\pagenumbering{Roman}
\@starttoc{toc}%
\thispagestyle{PreContent}%
\afterpage{\pagenumbering{arabic}}%
\pagestyle{Content}%
}

%acknowledgement致谢设置
\newcommand{\acknowledgementname}{致\texorpdfstring{\quad}{}谢}
\newcommand{\acknowledgementname}{致\texorpdfstring{\qquad}{}谢}
\newenvironment{acknowledgement}[1]{%
\section*{\acknowledgementname
\addcontentsline{toc}{section}{\acknowledgementname}
Expand All @@ -323,9 +343,22 @@
#1}
{}

% 总结与展望设置
\newcommand{\conclusionname}{结论}
\newenvironment{conclusion}[1]{
\section*{\conclusionname
\addcontentsline{toc}{section}{\conclusionname}
\markboth{\conclusionname}{}
}
#1}
{}




%参考文献
\RequirePackage[square,numbers,super,sort&compress,sectionbib]{natbib}
%\RequirePackage{gbt7714}
% \RequirePackage{gbt7714}
\bibliographystyle{references/gbt7714-numerical.bst}%gbt7714-author-year,gbt7714-numerical

%natbib.sty
Expand Down
12 changes: 12 additions & 0 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@
引用\cite{2019First}。引用\cite{向守平2008天体物理概论}。引用\cite{BQC_2020}。引用\cite{2019First,向守平2008天体物理概论,BQC_2020}。
\end{latexcode}
\textbf{编译得:}引用\cite{2019First}。引用\cite{向守平2008天体物理概论}。引用\cite{BQC_2020}。引用\cite{2019First,向守平2008天体物理概论,BQC_2020}。

\subsection{总结部分}
总结部分使用如下代码撰写:
\begin{latexcode}
\begin{conclusion}
总结的内容。
\end{conclusion}
\end{latexcode}

\subsection{致谢部分}
致谢部分使用如下代码撰写:
Expand Down Expand Up @@ -525,6 +533,10 @@
\section{PDF转Word}
可使用 \href{https://www.adobe.com/acrobat/online/pdf-to-word.html}{Adobe PDF to Word} 转换 \verb|*.pdf| 文件。第二次转换文件时需要登录 Adobe 账号才能下载,建议在浏览器的“无痕浏览”、“隐私模式”等模式下访问以跳过强制登录。

\begin{conclusion}
总结与展望。
\end{conclusion}

\bibliography{references/references.bib}%参考文献,引入文献的bibtex格式信息,填bib文件

\begin{acknowledgement}
Expand Down
Loading