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

修复一些格式上的错误及macOS&Linux上存在的问题 #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion HUSTthesis/HUSTthesis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
\setCJKmonofont{SimSun} % monospace font for \texttt
% \punctstyle{kaiming} % Remove the space used by symbols like comma. Special for the mainland students like us HUSTers.
\setCJKfamilyfont{song}{SimSun} % 宋体 song

%----------------If Linux Or macOS-------------------------------%
% use the codes bellow instead
% \setCJKmainfont[BoldFont=SimSun-Bold]{SimSun} % set the mainfont of Chinese as songti. (serif) for
% \setCJKsansfont[BoldFont=SimSun-Bold]{SimSun} % sans serif font for \textsf
% \setCJKmonofont[BoldFont=SimSun-Bold]{SimSun} % monospace font for \texttt
% \setCJKfamilyfont{song}[BoldFont=SimSun-Bold]{SimSun} % 宋体 song for macOS & maybe Linux

\newcommand{\song}{\CJKfamily{song}}
\setCJKfamilyfont{kai}{KaiTi} % 楷体 kai
\newcommand{\kai}{\CJKfamily{kai}}
Expand Down Expand Up @@ -206,6 +214,42 @@
\titlecontents{subsubsection}[4em]{\song\xiaosihao}{\contentslabel{4em}}{\hspace*{-4em}}{\titlerule*[8pt]{.}\contentspage}
\titlecontents{paragraph}[5em]{\song\xiaosihao}{\contentslabel{5em}}{\hspace*{-5em}}{\titlerule*[8pt]{.}\contentspage}

\makeatletter
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ nice, fixed #8!

\let\old@l@section\l@section
\renewcommand{\l@section}[2]{%
\old@l@section{#1}{#2} % Regular setting of \section in ToC
\pagebreak[0] % Add a zero penalty (for possible page break)
\thispagestyle{main}
}
\makeatother

\makeatletter
\let\old@l@subsection\l@subsection
\renewcommand{\l@subsection}[2]{%
\old@l@subsection{#1}{#2} % Regular setting of \subsection in ToC
\pagebreak[0] % Add a zero penalty (for possible page break)
\thispagestyle{main}
}
\makeatother

\makeatletter
\let\old@l@subsubsection\l@subsubsection
\renewcommand{\l@subsubsection}[2]{%
\old@l@subsubsection{#1}{#2} % Regular setting of \subsubsection in ToC
\pagebreak[0] % Add a zero penalty (for possible page break)
\thispagestyle{main}
}
\makeatother

\makeatletter
\let\old@l@paragraph\l@paragraph
\renewcommand{\l@paragraph}[2]{%
\old@l@paragraph{#1}{#2} % Regular setting of \paragraph in ToC
\pagebreak[0] % Add a zero penalty (for possible page break)
\thispagestyle{main}
}
\makeatother

% ---------------------------------------------------------------------------- %
% reference and citation 参考文献
\usepackage{natbib}
Expand Down Expand Up @@ -618,7 +662,7 @@ \section{随机文本测试}
\phantomsection
\addcontentsline{toc}{section}{参考文献}

\bibliographystyle{plain}
\bibliographystyle{gbt7714-numerical} %国标格式,若不使用国标,但是要按顺序引用,可以考虑 \bibliographystyle{unsrt}
\bibliography{HUSTthesis}\label{bibtexref}
\hongzifuzhu{第一个参考文献为使用 Bib\TeX 基于 $ \mathtt{HUSTthesis.bib} $ 生成。 如果不使用 Bib\TeX 可删除,然后只用后一个参考文献。}

Expand Down
Loading