Skip to content
Snippets Groups Projects
njuthesis.dtx 189 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-undergraduate.def,
%                                 njuthesis-graduate.def,
%                                 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}}
    \file{\jobname-undergraduate.def} {\from{\jobname.dtx}{definition-ug}}
    \file{\jobname-graduate.def}      {\from{\jobname.dtx}{definition-g}}
%<*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-graduate.def                                *}
\Msg{*     njuthesis-undergraduate.def                           *}
\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}
%<*!(driver|install)>
%<+!driver>\GetIdInfo $Id: njuthesis.dtx 0.16.0 2022-02-23 10:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class>  {Thesis template for Nanjing University}
%<class>\ProvidesExplClass{njuthesis}
%<definition-ug>  {Undergraduate definition file for njuthesis}
%<definition-ug>\ProvidesExplFile{njuthesis-undergraduate.def}
%<definition-g>  {Graduate definition file for njuthesis}
%<definition-g>\ProvidesExplFile{njuthesis-graduate.def}
%<!driver>  {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
%</!(driver|install)>
\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}
\definecolor{agrd}{HTML}{2E3191}
Yu Xiong's avatar
Yu Xiong committed
\newcommand\olbutton[1]{\textcolor{olgreen}{\bfseries #1}}
\newcommand\agrd[1]{\textcolor{agrd}{\sffamily 〈#1〉}}
\newcommand\bgrd[1]{\textcolor{at@guard}{\sffamily #1}}
\newcommand\tikzlogo{Ti\emph{k}Z}
\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}}}
% \date{v0.16.0 \quad 2022-02-23}
Loading
Loading full blame...