Pārlūkot izejas kodu

删除目录中参考文献后的项目的页码 (#2)

* Remove page number in contents after reference
Name1e5s 3 gadi atpakaļ
vecāks
revīzija
8eb418d3cb
4 mainītis faili ar 29 papildinājumiem un 9 dzēšanām
  1. 2 0
      .gitignore
  2. 22 7
      BUPTthesisbachelor.sty
  3. BIN
      main.pdf
  4. 5 2
      main.tex

+ 2 - 0
.gitignore

@@ -28,3 +28,5 @@
 *.synctex.gz(busy)
 *.pdfsync
 
+## VS Code
+.vscode/

+ 22 - 7
BUPTthesisbachelor.sty

@@ -176,20 +176,22 @@ pdfborder=001, linkcolor=black, citecolor=black, urlcolor=black]{hyperref}
 \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}}
-    {\CTEXnumber{\CJKsection}{\thecontentslabel}{第\CJKsection{章}\quad{}}}
-    {}
-    {\hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage}
+\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{}}{}{%
-    \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage}%
+    \ifpagenumber \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage\fi}%
 \titlecontents{subsection}[2em]{\tocsubsectionfont\vspace{0.4mm}}{%
     \thecontentslabel\quad{}}{}{%
-    \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage}%
+    \ifpagenumber \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage\fi}%
 \titlecontents{subsubsection}[3em]{\tocsubsubsectionfont\vspace{0.4mm}}{%
     \thecontentslabel\quad{}}{}{%
-    \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage}%
+    \ifpagenumber \hspace{.5em}\titlerule*[6pt]{$\cdot$}\contentspage\fi}%
 \makeatletter % Content Page style
 \renewcommand\frontmatter{%
     \if@openright\cleardoublepage\else\clearpage\fi%
@@ -359,6 +361,19 @@ pdfborder=001, linkcolor=black, citecolor=black, urlcolor=black]{hyperref}
     \pagestyle{empty}}%
 \makeatother%
 
+% No page number environment for appendix
+\newenvironment{nopagenumber}{%
+    \titleformat{\chapter}[hang]{\textchapterfont}{}{1em}{} %
+    \setcounter{secnumdepth}{0}%
+    \addtocontents{toc}{%
+	\protect\setcounter{tocdepth}{0}%
+	\protect\pagenumberfalse%
+	\ignorespaces}}{%
+    \setcounter{secnumdepth}{3}%
+    \addtocontents{toc}{%
+    \protect\setcounter{tocdepth}{3}%
+	\protect\pagenumbertrue%
+    \ignorespaces}}
 % 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.

BIN
main.pdf


+ 5 - 2
main.tex

@@ -304,14 +304,16 @@ def plusFunc(a, b):
 \section{我对自己要求低的话也不至于想要修订这份模板}
 %%%%%%%%%%%%%%%%%%%%%%% Main Area ENDs Here %%%%%%%%%%%%%%%%%%%%%%%%
 %\let\cleardoublepage=\cleardoublepagebak
+
+\begin{nopagenumber}
 % Reference
 \clearpage\phantomsection\addcontentsline{toc}{chapter}{参考文献}
 \bibliographystyle{buptbachelor}
 \refbodyfont{\bibliography{ref}}
 
 % Thanks to page
-\clearpage\phantomsection\addcontentsline{toc}{chapter}{致\qquad{}谢}
-\chapter*{致\qquad{}谢}
+\clearpage
+\chapter{致\qquad{}谢}
 \normalsize\thankwords
 
 % Appendix
@@ -477,6 +479,7 @@ def minusFunc(a, b):
 新的社交网络技术在使信息的传播速度变快和规模变大的同时,也便利了不实信息(即不准确或有误导性的信息)的传播。然而,尽管我们对信息和新闻的获取越来越多地收到这些新技术的引导,但我们仍然对他们在虚假信息传播上的作用知之甚少。尽管媒体对假新闻传播的轶事分析给予了相当多的关注,但仍然几乎没有针对不实信息扩散或其发布源头的大规模实证调查。目前,虚假信息传播的研究仅仅局限于小的、局部的样本的分析上,而这些分析忽略了两个最重要的科学问题:真实信息和虚假信息的传播有什么不同?哪些人类判断中的因素可以解释这些不同?
 
 \endgroup
+\end{nopagenumber}
 
 % 开题报告
 \blankmatter