Newer
Older
{
\hypersetup
{
bookmarksnumbered = true,
psdextra = true,
unicode = true,
% \end{macrocode}
% 填写 PDF 元信息。
% \begin{macrocode}
pdftitle = \l_@@_info_title_tl,
pdfauthor = \l_@@_info_author_tl,
pdfcreator = \c_@@_name_pdf_creator_tl
}
}
% \end{macrocode}
%
\floatsetup[figure]{ % Captions for figures
capposition=bottom,%
margins=centering,%
floatwidth=\textwidth%
}
\floatsetup[table]{ % Captions for tables
capposition=above,%
margins=centering,%
floatwidth=\textwidth%
}
%
% 图表标题样式
% \begin{macrocode}
\DeclareCaptionFont{songticap}{\zihao{5}\bf\songti}
\captionsetup{
font=small,%
labelfont=songticap,
textfont=songticap,
strut=no,%
hypcap=true, % Links point to the top of the figure
% indention=0pt, % Suppress indentation
% % parindent=0pt, % Suppress space between paragraphs
aboveskip=6pt, % Increase the space between the figure and the caption
belowskip=6pt, % Increase the space between the caption and the table
}
% \end{macrocode}
\floatsetup[lstlisting]{ % Captions for lstlistings
capposition=above,%
margins=centering,%
floatwidth=\textwidth%
}
\lstset{
basicstyle=\ttfamily\linespread{1}\small\selectfont,
keywordstyle=\bfseries,% use bold style for keywords
commentstyle=\rmfamily\itshape,% use italic style for comments
stringstyle=\ttfamily,% 字符串风格
flexiblecolumns,% ?
numbers=left,% left-aligned numbering
showspaces=false,% hide markers for spaces
showstringspaces=false,
captionpos=t,% place the caption at the top
% frame=lrtb,% show all four sides of the frame
% linewidth=.8\textwidth,
% breakatwhitespace=true,
breaklines=true,
xleftmargin=2em,xrightmargin=2em,% set the width of the code environment
}
morekeywords={
begin, caption, label, mathrm, frac,
toprule, midrule, bottomrule, includegraphics}
\renewcommand{\labelitemi}{\tiny$\blacktriangleright$}
\renewcommand{\labelitemii}{\textbullet}
\setlist[itemize]{noitemsep}
\setlist[enumerate]{noitemsep}
\setlist[description]{noitemsep}
%
% \begin{macro}{\mathbi}
% Math bold italic letters
% \begin{macrocode}
\declaretheoremstyle[
%spaceabove=.5\thm@preskip,
%spacebelow=.5\thm@postskip,
headfont=\bf\songti,%\scshape,
notefont=\songti,% notebraces={ (}{)},
bodyfont=\songti,
%headformat={\NAME\space\NUMBER\space\NOTE},
headpunct={},
%postheadspace={.5em plus .1em minus .1em},
%prefoothook={\hfill\qedsymbol}
]{njuthm}
\theoremstyle{njuthm}
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
\declaretheorem[
name=算法,
style=njuthm,
refname={算法,算法},
Refname={算法,算法},
% numberwithin=section,
]{algorithm}
\declaretheorem[
name=假设,
style=njuthm,
refname={假设,假设},
Refname={假设,假设},
% numberwithin=section,
]{assumption}
\declaretheorem[
name=公理,
style=njuthm,
refname={公理,公理},
Refname={公理,公理},
% numberwithin=section,
]{axiom}
\declaretheorem[
name=结论,
style=njuthm,
refname={结论,结论},
Refname={结论,结论},
% numberwithin=section,
]{conclusion}
\declaretheorem[
name=条件,
style=njuthm,
refname={条件,条件},
Refname={条件,条件},
% numberwithin=section,
]{condition}
\declaretheorem[
name=推论,
style=njuthm,
refname={推论,推论},
Refname={推论,推论},
% numberwithin=section,
]{corollary}
\declaretheorem[
name=定义,
style=njuthm,
refname={定义,定义},
Refname={定义,定义},
% numberwithin=section,
]{definition}
\declaretheorem[
name=例,
style=njuthm,
refname={例,例},
Refname={例,例},
% numberwithin=section,
]{example}
\declaretheorem[
name=引理,
style=njuthm,
refname={引理,引理},
Refname={引理,引理},
% numberwithin=section,
]{lemma}
\declaretheorem[
name=性质,
style=njuthm,
refname={性质,性质},
Refname={性质,性质},
% numberwithin=section,
]{property}
\declaretheorem[
name=命题,
style=njuthm,
refname={命题,命题},
Refname={命题,命题},
% numberwithin=section,
]{proposition}
\declaretheorem[
name=注解,
style=njuthm,
refname={注解,注解},
Refname={注解,注解},
% numberwithin=section,
]{remark}
\declaretheorem[
name=定理,
style=njuthm,
refname={定理,定理},
Refname={定理,定理},
numberwithin=section,
]{theorem}
{
\l_@@_info_title_a_tl
\l_@@_info_title_b_tl
\l_@@_info_title_c_tl
}
%
% \begin{variable}{\l_@@_info_supv_full_tl,\l_@@_info_supv_full_en_tl}
% 用于存储导师姓名加职称的变量,旧版编译器不支持字符串中含有|\hspace{.5em}|这样的空白空间命令
\tl_new:N \l_@@_info_supv_full_tl
\tl_new:N \l_@@_info_supv_full_en_tl
% \end{macrocode}
% \end{variable}
%
% \begin{macrocode}
\tl_set:Nn \l_@@_info_supv_full_tl
\l_@@_info_supv_a_tl\
\l_@@_info_supv_a_title_tl\ \
\l_@@_info_supv_b_tl\
\l_@@_info_supv_b_title_tl
\l_@@_info_supv_a_title_en_tl\
\l_@@_info_supv_a_en_tl\ \
\l_@@_info_supv_b_title_en_tl\
\l_@@_info_supv_b_en_tl
%
% \begin{variable}{\l_@@_name_degree_tl,\l_@@_name_degree_en_tl}
\tl_new:N \l_@@_name_degree_tl
\tl_new:N \l_@@_name_degree_en_tl
\tl_const:Nn \c_@@_name_title_tl { 题\hfill 目 }
\tl_const:Nn \c_@@_cover_uline_len_a_tl { 250pt }
\tl_const:Nn \c_@@_cover_uline_len_b_tl { 90pt }
\tl_const:Nn \c_@@_cover_uline_font_tl { \songti }
\tl_const:Nn \c_@@_cover_uline_style_tl { \bf }
\tl_const:Nn \c_@@_cover_uline_bskip_tl {}
\tl_const:Nn \c_@@_cover_box_len_tl { 4.2em }
\tl_const:Nn \c_@@_name_title_tl { 论\hfill 文\hfill 题\hfill 目 }
\tl_const:Nn \c_@@_cover_uline_len_a_tl { 250pt }
\tl_const:Nn \c_@@_cover_uline_len_b_tl { 14em }
\tl_const:Nn \c_@@_cover_uline_font_tl { \kaishu }
\tl_const:Nn \c_@@_cover_uline_bskip_tl { \hspace{1em} }
% 研究生学位名称
\str_if_eq:NNTF { \l_@@_info_degree_tl } { phd }
{
\tl_set:Nn \l_@@_name_degree_tl { 博士 }
\tl_set:Nn \l_@@_name_degree_en_tl { Doctor~of~Philosophy }
{ \tl_set:Nn \l_@@_name_degree_tl { 硕士 } }
{ \tl_set:Nn \l_@@_name_degree_tl { 硕士专业 } }
% \begin{macro}{\@@_spread_box:nn}
% 来自\cls{fduthesis}:分散对齐的水平盒子。
% \begin{arguments}
% \item 宽度
% \item 内容
% \end{arguments}
% 利用 \cs{tl_map_inline:nn} 在字符间插入 \tn{hfil};紧随其后的 \tn{unskip}
% 将会去掉最后一个 \tn{hfil}。见 \url{https://tex.stackexchange.com/q/169689}。
% |#2| 需要完全展开以避免 underfull 警告。
% \begin{macrocode}
\cs_new_protected:Npn \@@_spread_box:nn #1#2
{
\mode_leave_vertical:
\hbox_to_wd:nn {#1}
{ \tl_map_inline:xn {#2} { ##1 \hfil } \unskip }
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_cover_uline_a:n}
% 在封面绘制下划线
\cs_new:Npn \@@_cover_uline_a:n #1
{
\uline{\makebox[\c_@@_cover_uline_len_a_tl]
{\rm\c_@@_cover_uline_font_tl #1 }}
}
\cs_new:Npn \@@_cover_uline_b:n #1
{
\uline{\makebox[\c_@@_cover_uline_len_b_tl]
{\rm\c_@@_cover_uline_font_tl #1 }}
}
\cs_new:Npn \@@_cover_uline_nl:nn #1 #2
{
\uline{\makebox[#1]
{\rm\c_@@_cover_uline_font_tl #2 }}
}
% \end{macrocode}
\cs_new:Npn \@@_cover_box:n #1
{
\makebox[\c_@@_cover_box_len_tl][s]{
#1\c_@@_cover_uline_bskip_tl}
}
% \end{macrocode}
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_title_breakline:
{
\@@_cover_box:n {\c_@@_name_title_tl}
& \@@_cover_uline_a:n
{ \c_@@_cover_uline_style_tl \l_@@_info_title_a_tl } \\
\tl_if_empty:NF \l_@@_info_title_b_tl
{
\tl_if_empty:NTF \l_@@_info_title_c_tl
{
& \@@_cover_uline_a:n
{\c_@@_cover_uline_style_tl \l_@@_info_title_b_tl } \\
}
{
& \@@_cover_uline_a:n
{ \c_@@_cover_uline_style_tl \l_@@_info_title_b_tl } \\
& \@@_cover_uline_a:n
{ \c_@@_cover_uline_style_tl \l_@@_info_title_c_tl } \\
}
}
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_covertab:
{%
\str_if_eq:NNTF { \l_@@_info_degree_tl } { ug }
{
\begin{tabular}{p{4.2em}c}
\@@_cover_box:n {院\hfill 系}
& \@@_cover_uline_a:n {\l_@@_info_dept_tl} \\
\@@_cover_box:n {专\hfill 业}
& \@@_cover_uline_a:n {\l_@@_major_tl} \\
\@@_cover_title_breakline:
\end{tabular}\\
\begin{tabular}{p{4.2em}cp{4.2em}c}
\@@_cover_box:n {年\hfill 级}
& \@@_cover_uline_b:n {\l_@@_info_grade_tl}
& \@@_cover_box:n {学\hfill 号}
& \@@_cover_uline_b:n {\l_@@_info_id_tl}\\
\end{tabular}\\
\begin{tabular}{p{4.2em}c}
\@@_cover_box:n {学\hfill 生\hfill 姓\hfill 名}
& \@@_cover_uline_a:n {\l_@@_info_author_tl}
\end{tabular}\\
\begin{tabular}{p{4.2em}cp{4.2em}c}
\@@_cover_box:n {导\hfill 师}
& \@@_cover_uline_b:n {\l_@@_info_supv_a_tl}
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
& \@@_cover_uline_b:n {\l_@@_info_supv_a_title_tl}\\
% 第二导师
\tl_if_empty:NF \l_@@_info_supv_b_tl
{
\@@_cover_box:n {第\hfill 二\hfill 导\hfill 师}
& \@@_cover_uline_b:n {\l_@@_info_supv_b_tl}
& \@@_cover_box:n {职\hfill 称}
& \@@_cover_uline_b:n {\l_@@_info_supv_b_title_tl}\\
}
\end{tabular}\\
\begin{tabular}{p{4.2em}c}
\@@_cover_box:n {提\hfill 交\hfill 日\hfill 期}
& \@@_cover_uline_a:n {\l_@@_submit_date_tl}\\
\end{tabular}
}
{
\begin{tabular}{p{6em}c}
\@@_cover_title_breakline:
\@@_cover_box:n {作\hfill 者\hfill 姓\hfill 名}
& \@@_cover_uline_a:n {\@@_spread_box:nn {4em}{\l_@@_info_author_tl}}\\
\@@_cover_box:n {专\hfill 业\hfill 名\hfill 称}
& \@@_cover_uline_a:n {\l_@@_major_tl}\\
\@@_cover_box:n {研\hfill 究\hfill 方\hfill 向}
& \@@_cover_uline_a:n {\l_@@_field_tl}\\
\@@_cover_box:n {指\hfill 导\hfill 教\hfill 师}
& \@@_cover_uline_a:n {\l_@@_info_supv_full_tl}\\
\end{tabular}
}
\thispagestyle{empty}
\pdfbookmark[0]{国家图书馆封面}{nl}
\hfill
\makebox[40pt][l]{密级}
\@@_cover_uline_b:n {\l_@@_info_seclv_tl}
\vskip 10pt \hskip -15mm
\@@_cover_uline_b:n {\l_@@_info_udc_tl}
}
% 中部
\vskip\stretch{2}
\begin{center}
\def\ULthickness{1pt}
{\kaishu\zihao{-0} 学\hspace{0.5em}位\hspace{0.5em}论\hspace{0.5em}文}
\kaishu\zihao{1}
\vskip \stretch{1}
\@@_cover_uline_b:n {\l_@@_info_title_a_tl}\\
\@@_cover_uline_b:n {\l_@@_info_title_b_tl}\\
\@@_cover_uline_b:n {\l_@@_info_title_c_tl}\\
\vskip \stretch{1}
{\kaishu\zihao{4}(题名和副题名)}
\vskip \stretch{1} \vskip 5mm
{\kaishu\zihao{1}\uline{\makebox{\l_@@_info_author_tl}}}
\vskip \stretch{1}
{\kaishu\zihao{4}(作者姓名)}
\end{center}
% 底部
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
\vskip\stretch{1}\kaishu\zihao{4}
\noindent 指导教师姓名、职务、职称、学位、单位名称及地址%
\@@_cover_uline_nl:nn {94pt}{\l_@@_info_supv_a_tl}\par
\noindent \@@_cover_uline_nl:nn {\textwidth}{%
\l_@@_info_supv_cont_tl}\par
\noindent 申请学位级别%
\@@_cover_uline_nl:nn {9em}{\l_@@_name_degree_tl}%
\noindent 专业名称%
\uline{\hfill\l_@@_major_tl\hfill}\par
\noindent 论文提交日期%
\@@_cover_uline_nl:nn {9em}{\l_@@_submit_date_tl}%
\noindent 论文答辩日期%
\uline{\hfill\l_@@_defend_date_tl\hfill}\par
\noindent 学位授予单位和日期\uline{\hfill}\par
\begin{flushright}
答辩委员会主席:
\@@_cover_uline_nl:nn {9em}{ \l_@@_info_chairman_tl }\par
评阅人:
\@@_cover_uline_nl:nn {9em}
{ \clist_item:Nn \l_@@_info_reviewer_clist {1} }\par
\@@_cover_uline_nl:nn {9em}
{ \clist_item:Nn \l_@@_info_reviewer_clist {2} }\par
\@@_cover_uline_nl:nn {9em}
{ \clist_item:Nn \l_@@_info_reviewer_clist {3} }\par
\@@_cover_uline_nl:nn {9em}
{ \clist_item:Nn \l_@@_info_reviewer_clist {4} }\par
\end{flushright}
\begin{center}
\kaishu\zihao{3}\hspace{2em} 年\hspace{1em} 月\hspace{1em} 日
\end{center}
\vskip -10mm
{
\thispagestyle{empty}
\pagenumbering{Roman}
% Start
{\zihao{1}\bf\songti\@@_spread_box:nn {9em}{\l_@@_info_type_tl_name}}
\vfill
\vskip\stretch{0}
{\bgroup
\kaishu\zihao{3}
\def\tabcolsep{1pt}
\def\arraystretch{1.5}
\egroup}
\vfill
\end{center}
\end{spacing}
\cleardoublepage
}
{
\thispagestyle{empty}
\pagenumbering{Roman}
% Start
\bgroup
\zihao{1}\bf\kaishu
\@@_spread_box:nn {10em}{\l_@@_info_type_tl_name}
\vskip 5mm
{(申请\l_@@_name_degree_tl 学位)}
\egroup
\par\vfill\vskip\stretch{0}
\bgroup
\bf\kaishu\zihao{3}
\def\tabcolsep{1pt}
\def\arraystretch{1.5}
\vskip 10mm
\@@_print_covertab:
\egroup
\vskip 15mm
\end{center}
\end{spacing}
\newpage % 封面背面
\thispagestyle{empty}
\begin{spacing}{1.625}
% TODO: 等待调整格式
\makebox[6em][s]{\bf\kaishu 学\hfill 号}:\MakeUppercase{\l_@@_info_id_tl}
\makebox[6em][s]{\bf\kaishu 论文答辩日期}:\l_@@_defend_date_tl
\par
\makebox[6em][s]{\bf\kaishu 指\hfill 导\hfill 教\hfill 师}:\hspace{50mm}(签字)
\par
\egroup}
\vskip 15mm
\end{spacing}
\cleardoublepage
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_print_cover_en:}
% 研究生英文封面
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_cover_en:
{
\thispagestyle{empty}
\bf\sffamily\zihao{2}\l_@@_info_title_en_tl
\vskip \stretch{1}
\normalfont\rmfamily\zihao{4}{by}
\vskip 3pt
\bf\sffamily\zihao{4}\l_@@_info_author_en_tl
\vskip\stretch{1}
\normalfont\sffamily\zihao{4}
\l_@@_info_supv_a_title_en_tl
\hspace{.5em}\l_@@_info_supv_a_en_tl\\
\l_@@_info_supv_b_title_en_tl
\hspace{.5em}\l_@@_info_supv_b_en_tl
A~dissertation~submitted~to\\
the~graduate~school~of~Nanjing~University\\
in~partial~fulfilment~of~the~requirements~for~the~degree~of\\
in\\
{\l_@@_major_en_tl}
}
\vskip\stretch{2}
\vskip 30pt
\normalfont\normalsize\l_@@_submit_date_en_tl
\end{center}
\normalfont
\cleardoublepage
}
\bool_if:NT \g_@@_nlcover_bool { \@@_print_cover_nl: } % 国家图书馆封面
\@@_print_cover_g: % 研究生封面
% \begin{macro}{\@@_print_keywords:,\@@_print_keywords_en:}
\cs_new_protected:Npn \@@_print_keywords:
{
\par\vspace{2ex}
\bgroup
\noindent
\c_@@_name_keywords_tl
\clist_use:Nn \l_@@_info_keywords_clist {;}
\par
\egroup
\cs_new_protected:Npn \@@_print_keywords_en:
{
\par\vspace{2ex}
\bgroup
\noindent
\c_@@_name_keywords_en_tl\hspace{0.5em}
\clist_use:Nn \l_@@_info_keywords_en_clist {;}
\par
\egroup
% \begin{macro}{\@@_print_abstract_ug:,\@@_print_abstract_en_ug:}
% 输出本科摘要格式。
\thispagestyle{plain}
\pdfbookmark[0]{中文摘要}{abstract-zh}
\begin{center}
\kaishu\zihao{-2}{\textbf{
\uuline{南京大学本科生毕业论文(设计、作品)中文摘要}}}
\end{center}
题目: \l_@@_info_title_tl \\
院系: \l_@@_info_dept_tl \\
专业: \l_@@_major_tl \\
本科生姓名: \l_@@_info_author_tl \\
指导教师(姓名、职称):\l_@@_info_supv_full_tl \\
摘要:
\kaishu\zihao{-4}\par%
}
\cs_new_protected:Npn \@@_print_abstract_en_ug:
{
\thispagestyle{plain}
\pdfbookmark[0]{英文摘要}{abstract-en}
\begin{center}
\kaishu\zihao{-2}{\textbf{\uuline{
南京大学本科生毕业论文(设计、作品)英文摘要}}}
\end{center}
{
\bgroup
THESIS: ~~\l_@@_info_title_en_tl \\
DEPARTMENT: ~~\l_@@_info_dept_en_tl \\
SPECIALIZATION: ~~\l_@@_major_en_tl \\
UNDERGRADUATE:~~\l_@@_info_author_en_tl \\
MENTOR:~~\l_@@_info_supv_full_en_tl \\
ABSTRACT:
\egroup
% \begin{macro}{\@@_print_abstract_g:,\@@_print_abstract_en_g:}
% 输出研究生摘要格式。
\thispagestyle{plain}
\pdfbookmark[0]{中文摘要}{abstract-zh}
\begin{center}
\kaishu\zihao{-2}{\textbf{\uuline{
南京大学研究生毕业论文中文摘要首页用纸}}}
\end{center}
\bgroup
\noindent\kaishu\zihao{4}
毕业论文题目:\hspace{0.5em}\njuline{\l_@@_info_title_tl\hfill}\\
\njuline{\makebox[11em]{\l_@@_major_tl}}专业
\njuline{\makebox[4em]{\l_@@_info_grade_tl}}级
\str_if_eq:NNTF {\l_@@_info_degree_tl} { phd } {博}{硕}
士生姓名:\njuline{\hfill\l_@@_info_author_tl\hfill}\\
指导教师(姓名、职称):\njuline{\hfill\l_@@_info_supv_full_tl\hfill}\par
\egroup
\kaishu\zihao{4}\par%
}
\cs_new_protected:Npn \@@_print_abstract_en_g:
{
\thispagestyle{plain}
\pdfbookmark[0]{英文摘要}{abstract-en}
\zihao{4}
THESIS: ~~\l_@@_info_title_en_tl \\
SPECIALIZATION: ~~\l_@@_major_en_tl \\
POSTGRADUATE:~~\l_@@_info_author_en_tl \\
MENTOR:~~\l_@@_info_supv_full_en_tl\par
%
%
% 判断学位
%
% \begin{macrocode}
\str_if_eq:NNTF {\l_@@_info_degree_tl} { ug }
{
\NewDocumentEnvironment{abstract} {}
{\@@_print_abstract_ug:}{\@@_print_keywords:\newpage}
\NewDocumentEnvironment{abstract*} {}
{\@@_print_abstract_en_ug:}{\@@_print_keywords_en:\cleardoublepage}
{\@@_print_abstract_g:}{\@@_print_keywords:\newpage}
\NewDocumentEnvironment{abstract*} {}
{\@@_print_abstract_en_g:}{\@@_print_keywords_en:\cleardoublepage}