Skip to content
Snippets Groups Projects
njuthesis.dtx 167 KiB
Newer Older
% \iffalse meta-comment
% !TeX program  = XeLaTeX
% !TeX encoding = UTF-8
Yu Xiong's avatar
Yu Xiong committed
% Copyright (C) 2021 - 2022
% by Nanjing University Linux User Group
% <git+nju-lug-email-3104-issue-@yaoge123.cn>
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
Yu Xiong's avatar
Yu Xiong committed
% license or (at your option) any later version. The latest version
% of this license is in the file
%    https://www.latex-project.org/lppl.txt
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Yu Xiong.
%
% This work consists of the files njuthesis.dtx,
%           and the derived files njuthesis.ins,
%                                 njuthesis.cls,
%                                 njuthesis.pdf,
%                             and README.md.
%
% -----------------------------------------------------------------------
% The development version of the template can be found at
%    https://github.com/nju-lug/NJUThesis
%
% for those people who are interested.
%
%<*internal>
\iffalse
%</internal>
%
%<*internal>
\fi
\begingroup
  \def\NameOfLaTeXe{LaTeX2e}
\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else
\csname fi\endcsname
%</internal>
%
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse

\preamble

Yu Xiong's avatar
Yu Xiong committed
Copyright (C) 2021 - 2022
by Nanjing University Linux User Group
<git+nju-lug-email-3104-issue-@yaoge123.cn>

This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3c of this license
or (at your option) any later version.  The latest version of this
license is in:

   http://www.latex-project.org/lppl.txt

and version 1.3 or later is part of all distributions of LaTeX version
2005/12/01 or later.

Yu Xiong's avatar
Yu Xiong committed
To produce the documentation run the original source files ending with
`.dtx' through XeTeX.
\endpreamble

\generate{
  \usedir{tex/latex/njuthesis}
    \file{\jobname.cls}        {\from{\jobname.dtx}{class}}
%<*internal>
  \usedir{source/latex/njuthesis}
    \file{\jobname.ins}        {\from{\jobname.dtx}{install}}
%</internal>
}

\obeyspaces
\Msg{*************************************************************}
\Msg{*                                                           *}
\Msg{* To finish the installation you have to move the following *}
\Msg{* files into a directory searched by TeX:                   *}
\Msg{*                                                           *}
\Msg{* The recommended directory is TDS:tex/latex/njuthesis      *}
\Msg{*                                                           *}
\Msg{*     njuthesis.cls                                         *}
\Msg{*     njuthesis.ins                                         *}
\Msg{*                                                           *}
\Msg{* To produce the documentation, run the file njuthesis.dtx  *}
\Msg{* through XeLaTeX.                                          *}
\Msg{*                                                           *}
\Msg{* Happy TeXing!                                             *}
\Msg{*                                                           *}
\Msg{*************************************************************}

\endbatchfile
%</install>
%
%<*internal>
\fi
%</internal>
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\RequirePackage{expl3}
%<class>\GetIdInfo $Id: njuthesis.dtx 0.14.1 2022-01-17 15:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class> { Thesis template for Nanjing University }
%<class>\ProvidesExplClass{njuthesis}
%<class>{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\ProvidesFile{njuthesis.dtx}
\documentclass{ctxdoc}
\usepackage{listings,njuvisual,tabularray}
\usepackage[firstpage=true]{background}
\backgroundsetup{contents={\njuemblem[white!85!gray]{22cm}{!}},scale=1,angle=0,hshift=-4cm}
Yu Xiong's avatar
Yu Xiong committed
\colorlet{at@guard}{njuviolet}
Yu Xiong's avatar
Yu Xiong committed
\definecolor{olgreen}{HTML}{138a07}
\newcommand\olbutton[1]{\textcolor{olgreen}{\bfseries #1}}
\hypersetup{%
  pdftitle  = {The njuthesis class - LaTeX thesis template for Nanjing University},
  citecolor = njublue,
  linkcolor = njuviolet,
  urlcolor  = njumagenta}
\UseTblrLibrary{booktabs,diagbox,siunitx}
\DefTblrTemplate{caption-tag}{default}{表\hspace{0.25em}\thetable}
\SetTblrStyle{caption-tag}{font=\bfseries}
\DefTblrTemplate{caption-sep}{default}{\quad}
\lstdefinestyle{style@base}
  {
    basewidth       = 0.5 em,
    gobble          = 3,
    lineskip        = 3 pt,
    frame           = l,
    framerule       = 1 pt,
    framesep        = 0 pt,
    xleftmargin     = 2 em,
    xrightmargin    = 3 em,
    escapeinside    = {(*}{*)},
    basicstyle      = \small\ttfamily,
    keywordstyle    = \bfseries\color{njuviolet},
    commentstyle    = \itshape\color{white!50!gray},
    stringstyle     = \color{nju-chem-red},
    backgroundcolor = \color{white!95!gray}
  }
\lstdefinestyle{style@shell}
  {
    style      = style@base,
    rulecolor  = \color{njumagenta},
    language   = bash,
    alsoletter = {-},
    emphstyle  = \color{nju-cs-green}
  }
\lstdefinestyle{style@latex}
  {
    style      = style@base,
    rulecolor  = \color{njublue},
    language   = [LaTeX]TeX,
    alsoletter = {*, -},
    texcsstyle = *\color{njuviolet},
    emphstyle  = [1]\color{nju-ai-orange},
    emphstyle  = [2]\color{nju-cs-green}
  }
\lstnewenvironment{shellexample}[1][]{%
  \lstset{style=style@shell, #1}}{}
\lstnewenvironment{latexexample}[1][]{%
  \lstset{style=style@latex, #1}}{}
\begin{document}
  \DocInput{njuthesis.dtx}
Yu Xiong's avatar
Yu Xiong committed
  \PrintChanges
\end{document}
%</driver>
% \fi
%
Yu Xiong's avatar
Yu Xiong committed
% \title{\color{njuviolet}{The \cls{njuthesis} class\\ \textbf{南京大学学位论文模板}}}
Yu Xiong's avatar
Yu Xiong committed
% \author{^^A
Yu Xiong's avatar
Yu Xiong committed
% 南京大学 Linux 用户组
% \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn}{git+nju-lug-email-3104-issue-@yaoge123.cn}}}
Yu Xiong's avatar
Yu Xiong committed
% \date{v0.14.0 \quad 2022-01-16}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.1}{2021/09/04}{开始开发。}
% \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。}
% \changes{v0.3}{2021/09/09}{使用自动构建工具进行测试。}
% \changes{v0.4}{2021/09/09}{将个人信息使用内置命令输入。}
% \changes{v0.5}{2021/09/10}{新增了对第二导师的支持。}
% \changes{v0.6}{2021/09/10}{封装个人信息}
% \changes{v0.6}{2021/09/10}{实现自动打包发布。}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.7}{2021/09/11}{增加对研究生模板的支持}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.7}{2021/09/12}{将 \cls{njuthesis} 发布在 CTAN。}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.8}{2021/09/12}{修复已知问题,进行公开宣传。}
% \changes{v0.9}{2021/09/15}{使用 DocStrip 合并模板文件。}
% \changes{v0.9}{2021/09/15}{大幅度修改宏名称以符合 \hologo{LaTeX3} 规范。}
% \changes{v0.9}{2021/09/15}{进一步完善文档。}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.10}{2021/09/24}{删除了生成自述文件的代码。}
Loading
Loading full blame...