Skip to content

Commit c9f757e

Browse files
committed
fix some bugs
1 parent aca632a commit c9f757e

File tree

5 files changed

+174
-50
lines changed

5 files changed

+174
-50
lines changed

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ example.pdf: example.tex *.sty *.cls *.tex Makefile
1212
$(TEX) -shell-escape $<
1313
$(OPEN) $@
1414

15+
demo.pdf: demo.tex *.sty *.cls *.tex Makefile
16+
$(TEX) -shell-escape $<
17+
$(BIBTEX) demo.aux
18+
$(TEX) -shell-escape $<
19+
$(TEX) -shell-escape $<
20+
$(OPEN) $@
1521

1622
.PHONY: clean
1723

cugthesis.cls

+120-19
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
\newif\ifcug@bib@style@sec\cug@bib@style@secfalse
2323

24+
\newif\ifcug@toc@fig@show\cug@toc@fig@showfalse
25+
\newif\ifcug@toc@tab@show\cug@toc@tab@showfalse
26+
2427
\DeclareOption{doctor}{\cug@doctortrue\cug@masterfalse\cug@masterprofulltimefalse\cug@masterpronofulltimefalse\cug@bachelorfalse}
2528
\DeclareOption{master}{\cug@mastertrue\cug@doctorfalse\cug@masterprofulltimefalse\cug@masterpronofulltimefalse\cug@bachelorfalse}
2629
\DeclareOption{masterprofulltime}{\cug@masterprofulltimetrue\cug@doctorfalse\cug@masterfalse\cug@masterpronofulltimefalse\cug@bachelorfalse}
@@ -29,6 +32,9 @@
2932
%\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}} % I don't want you to pass options to the ctexbook class
3033

3134
\DeclareOption{bibsec}{\cug@bib@style@sectrue}
35+
36+
\DeclareOption{figtoc}{\cug@toc@fig@showtrue}
37+
\DeclareOption{tabtoc}{\cug@toc@tab@showtrue}
3238
\ProcessOptions\relax
3339

3440
\LoadClass[ scheme=chinese, heading=true, %nofonts,
@@ -361,8 +367,10 @@
361367

362368
\newcommand{\cug@make@abstract}{%
363369
\cleardoublepage
364-
\AppChapterNoToc{摘\quad 要}
365-
\setcounter{page}{1}
370+
\vspace*{2ex}%
371+
\begin{center}
372+
{\sffamily\bfseries\cug@sanhao\quad 要}
373+
\end{center}\par
366374
{\cug@xiaosi
367375
\the\cug@abstract
368376
}
@@ -373,7 +381,10 @@
373381
}
374382
\newcommand{\cug@make@enabstract}{%
375383
\cleardoublepage
376-
\AppChapterNoToc{Abstract}
384+
\vspace*{2ex}%
385+
\begin{center}
386+
{\sffamily\bfseries\cug@sanhao Abstract}
387+
\end{center}\par
377388
{\cug@xiaosi
378389
\the\cug@enabstract
379390
}
@@ -384,7 +395,7 @@
384395
}
385396
%%%%%%%%%%%%%%%% List of Contents Format %%%%%%%%%%%%%%%%%%
386397
\RequirePackage[titles]{tocloft}
387-
\tocloftpagestyle{cug@pagestyle}
398+
\tocloftpagestyle{empty}
388399
\setlength{\cftbeforechapskip}{0pt}
389400
\setlength{\cftbeforesecskip}{0pt}
390401
\setlength{\cftbeforesubsecskip}{0pt}
@@ -413,10 +424,18 @@
413424
\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X%
414425
\do\Y\do\Z\do\*\do\-\do\~\do\'\do\"\do\-}
415426

427+
\fancypagestyle{cug@frontmatter}{%
428+
\pagestyle{fancy}
429+
\fancyhf{}
430+
\fancyhead[CO]{}
431+
\fancyhead[RO, LE]{\cug@wuhao \thepage}
432+
\fancyhead[CE]{}
433+
\renewcommand{\headrulewidth}{0.4pt}
434+
}
416435
\fancypagestyle{cug@pagestyle}{%
417436
\pagestyle{fancy}
418437
\fancyhf{}
419-
\fancyhead[CO]{\cug@wuhao 中国地质大学(武汉)\cug@@titlelogo}
438+
\fancyhead[CO]{\cug@wuhao 中国地质大学\cug@@titlelogo}
420439
\fancyhead[RO, LE]{\cug@wuhao \thepage}
421440
\fancyhead[CE]{\cug@wuhao \@author: \@title}
422441
\renewcommand{\headrulewidth}{0.4pt}
@@ -430,12 +449,13 @@
430449
\renewcommand{\frontmatter}{%
431450
\clearpage
432451
\pagenumbering{Roman}
433-
\pagestyle{cug@pagestyle}
452+
\pagestyle{cug@frontmatter}
434453
}
435454
\renewcommand{\mainmatter}{%
436455
\clearpage
437456
\setcounter{chapter}{0}
438457
\pagenumbering{arabic}
458+
\pagestyle{cug@pagestyle}
439459
}
440460

441461
\let\cug@appendix = \appendix
@@ -445,13 +465,13 @@
445465
\@mainmattertrue
446466
}
447467

448-
\newcommand{\AppChapter}[1]{%
468+
\newcommand{\AddChapter}[1]{%
449469
\phantomsection
450470
\addcontentsline{toc}{chapter}{#1}
451471
\chapter*{#1}
452472
}
453473

454-
\newcommand{\AppChapterNoToc}[1]{%
474+
\newcommand{\AddChapterNoToc}[1]{%
455475
\phantomsection
456476
\chapter*{#1}
457477
}
@@ -501,24 +521,105 @@
501521
\cug@make@enabstract
502522
\fi
503523
}
524+
525+
\renewcommand{\@cftmaketoctitle}{%
526+
\addpenalty\@secpenalty
527+
\vspace*{2ex}%
528+
\@cftpagestyle
529+
{\interlinepenalty\@M
530+
\begin{center}
531+
{\sffamily\bfseries\cug@sanhao\contentsname}{\cftaftertoctitle}%
532+
\end{center}
533+
\cftmarktoc
534+
\par\nobreak
535+
\vskip 2ex
536+
\@afterheading}%
537+
}
538+
539+
\renewcommand{\tableofcontents}{%
540+
\@cfttocstart
541+
\par
542+
\begingroup
543+
\parindent\z@ \parskip\cftparskip
544+
\@cftmaketoctitle
545+
\if@cfttocbibind
546+
\@cftdobibtoc
547+
\fi
548+
\@starttoc{toc}%
549+
\endgroup
550+
\@cfttocfinish
551+
}
552+
553+
\renewcommand{\@cftmakeloftitle}{%
554+
\addpenalty\@secpenalty
555+
\vspace*{2ex}
556+
\pagestyle{cug@frontmatter}
557+
{\interlinepenalty\@M
558+
\begin{center}
559+
{\sffamily\bfseries\cug@sanhao\listfigurename}{\cftafterloftitle}
560+
\end{center}
561+
\cftmarklof
562+
\par\nobreak
563+
\vskip 2ex
564+
\@afterheading}}
565+
\renewcommand{\listoffigures}{%
566+
\@cfttocstart
567+
\par
568+
\begingroup
569+
\parindent\z@ \parskip\cftparskip
570+
\@cftmakeloftitle
571+
\if@cfttocbibind
572+
\@cftdobiblof
573+
\fi
574+
\@starttoc{lof}%
575+
\endgroup
576+
\@cfttocfinish}%
577+
\renewcommand{\@cftmakelottitle}{%
578+
\addpenalty\@secpenalty
579+
\vspace*{2ex}
580+
\pagestyle{cug@frontmatter}
581+
{\interlinepenalty\@M
582+
\begin{center}
583+
{\sffamily\bfseries\cug@sanhao\listtablename}{\cftafterlottitle}
584+
\end{center}
585+
\cftmarklot
586+
\par\nobreak
587+
\vskip 2ex
588+
\@afterheading}}
589+
\renewcommand{\listoftables}{%
590+
\@cfttocstart
591+
\par
592+
\begingroup
593+
\parindent\z@ \parskip\cftparskip
594+
\@cftmakelottitle
595+
\if@cfttocbibind
596+
\@cftdobiblot
597+
\fi
598+
\@starttoc{lot}%
599+
\endgroup
600+
\@cfttocfinish}%
601+
504602
\newcommand{\makefrontpages}{%
505603
\maketitle
506604
\emptymatter
507605
\makeextrapages
508606
\makeauthorcv
509-
\frontmatter
510607
\makeabstract
511608
\tableofcontents
512-
{
513-
\listoffigures
514-
\addcontentsline{toc}{chapter}{插 \quad 图}
515-
\let\cleardoublepage\relax
516-
\let\clearpage\relax
517-
\listoftables
518-
\addcontentsline{toc}{chapter}{表 \quad 格}
519-
}
520-
%\listoffigures
521-
%\listoftables
609+
\thispagestyle{empty}
610+
\frontmatter
611+
\ifcug@toc@fig@show
612+
\listoffigures
613+
\addcontentsline{toc}{chapter}{插 \quad 图}
614+
\ifcug@toc@tab@show
615+
\let\cleardoublepage\relax
616+
\let\clearpage\relax
617+
\fi
618+
\fi
619+
\ifcug@toc@tab@show
620+
\listoftables
621+
\addcontentsline{toc}{chapter}{表 \quad 格}
622+
\fi
522623
\clearpage
523624
\mainmatter
524625
}

demo.pdf

-3.62 MB
Binary file not shown.

demo.tex

+48-31
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\documentclass[bibsec, doctor]{cugthesis}
1+
\documentclass[bibsec, doctor, tabtoc]{cugthesis}
22

33
\usepackage{ttools}
44
\usepackage{tcode}
@@ -156,67 +156,67 @@ \section{在线编译器 Overleaf 使用方法}
156156
然后打开 Overleaf 网站注册一个账号, 如图\ref{fig:overleaf_usage_1}所示,
157157
进入首页, 点击右边的注册按钮.
158158

159-
\begin{tfig}{Overleaf 注册账号1}{fig:overleaf_usage_1}
160-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/2.png}
161-
\end{tfig}
159+
%\begin{tfig}{Overleaf 注册账号1}{fig:overleaf_usage_1}
160+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/2.png}
161+
%\end{tfig}
162162

163163
在接下来的页面中输入邮箱和密码, 点击绿色按钮进行注册,
164164
如图\ref{fig:overleaf_usage_2} 所示.
165165

166-
\begin{tfig}{Overleaf 注册账号2}{fig:overleaf_usage_2}
167-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/3.png}
168-
\end{tfig}
166+
%\begin{tfig}{Overleaf 注册账号2}{fig:overleaf_usage_2}
167+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/3.png}
168+
%\end{tfig}
169169

170170
注册完成后, 在接下来的页面中点击创建一个项目, 选择上传项目,
171171
如图\ref{fig:overleaf_usage_3} 所示.
172172

173-
\begin{tfig}{Overleaf 创建项目1}{fig:overleaf_usage_3}
174-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/5.png}
175-
\end{tfig}
173+
%\begin{tfig}{Overleaf 创建项目1}{fig:overleaf_usage_3}
174+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/5.png}
175+
%\end{tfig}
176176

177177
在弹出的窗口中点击绿色按钮, 选择之前下载的模板文件,
178178
如图\ref{fig:overleaf_usage_4},\ref{fig:overleaf_usage_5}所示.
179179

180-
\begin{tfig}{Overleaf 创建项目2}{fig:overleaf_usage_4}
181-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/6.png}
182-
\end{tfig}
180+
%\begin{tfig}{Overleaf 创建项目2}{fig:overleaf_usage_4}
181+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/6.png}
182+
%\end{tfig}
183183

184-
\begin{tfig}{Overleaf 创建项目3}{fig:overleaf_usage_5}
185-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/7.png}
186-
\end{tfig}
184+
%\begin{tfig}{Overleaf 创建项目3}{fig:overleaf_usage_5}
185+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/7.png}
186+
%\end{tfig}
187187

188188
点击打开, 进入上传页面, 如图\ref{fig:overleaf_usage_6}所示, 静静等待上传完毕.
189189

190-
\begin{tfig}{Overleaf 创建项目4}{fig:overleaf_usage_6}
191-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/8.png}
192-
\end{tfig}
190+
%\begin{tfig}{Overleaf 创建项目4}{fig:overleaf_usage_6}
191+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/8.png}
192+
%\end{tfig}
193193

194194
上传完成后, 进入项目页面, 如图\ref{fig:overleaf_usage_7} 所示. 在上传完成后,
195195
Overleaf 会进行一次编译尝试, 因为其默认编译方式与本模板不匹配,
196196
所以如右侧窗口显示, 有很多错误. 这是点击图中左上角的 Menu 按钮,
197197
对本项目进行设置. 如图\ref{fig:overleaf_usage_8}所示, 将编译器设置为 xelatex, 将
198198
主文档设置为 demo.tex .
199199

200-
\begin{tfig}{Overleaf 项目设置1}{fig:overleaf_usage_7}
201-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/9.png}
202-
\end{tfig}
200+
%\begin{tfig}{Overleaf 项目设置1}{fig:overleaf_usage_7}
201+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/9.png}
202+
%\end{tfig}
203203

204-
\begin{tfig}{Overleaf 项目设置 2}{fig:overleaf_usage_8}
205-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/10.png}
206-
\end{tfig}
204+
%\begin{tfig}{Overleaf 项目设置 2}{fig:overleaf_usage_8}
205+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/10.png}
206+
%\end{tfig}
207207

208208
对项目设置完毕后, 接下来点击左侧文件浏览器中的 demo.tex 文件, 然后点击右侧重新
209209
编译, 如图\ref{fig:overleaf_usage_9} 所示.
210210

211-
\begin{tfig}{Overleaf 编译}{fig:overleaf_usage_9}
212-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/11.png}
213-
\end{tfig}
211+
%\begin{tfig}{Overleaf 编译}{fig:overleaf_usage_9}
212+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/11.png}
213+
%\end{tfig}
214214

215215
静静等待一段时间后, 编译成功, 如图\ref{fig:overleaf_usage_10}所示.
216216

217-
\begin{tfig}{Overleaf 编译结果}{fig:overleaf_usage_10}
218-
\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/12.png}
219-
\end{tfig}
217+
%\begin{tfig}{Overleaf 编译结果}{fig:overleaf_usage_10}
218+
%\includegraphics[width=.5\textwidth]{./imgs/overleaf_usage/12.png}
219+
%\end{tfig}
220220

221221
至此, 即可开始自己的写论文之旅了.
222222

@@ -367,6 +367,9 @@ \section{模板基本使用}
367367
master & 硕士 \\
368368
masterprofulltime & 全日制专硕 \\
369369
masterpronofulltime & 非全日制专硕 \\
370+
bibsec & 第二种 bib style, 这种更符合中国地质大学要求 \\
371+
figtoc & 显示图清单 \\
372+
tabtoc & 显示表清单 \\
370373
\bottomrule
371374
\end{tabular}
372375
\end{ttab}
@@ -703,6 +706,20 @@ \section{Versino 0.4}
703706
704707
添加在线编译器 overleaf 的使用方法.
705708
709+
\section{Versino 0.5}
710+
\label{sec:versino_0_5}
711+
712+
2022-02-14 22:26
713+
714+
1. 奇数页页眉去掉(武汉)
715+
716+
2. 增加figtoc, tabtoc 用于控制图清单和表清单,默认都为 false, 即不输出图表清单目录,
717+
如果设置 figtoc,则输出图清单目录,如果设置tabtoc,则输出表清单目录
718+
719+
3. 页眉从第一章开始
720+
721+
4. 图表清单页页眉只提供页码
722+
706723
\backmatter{}
707724
\cugthesisacknowledgements
708725

example.pdf

-4.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)