├── .gitignore ├── build.lua ├── example ├── hduthesis-bachelor.tex ├── hduthesis-beamer.tex ├── hduthesis-exam.tex ├── hduthesis-mphil.tex └── hduthesis-stationery.tex ├── hdu-graphics.pdf ├── hduthesis.pdf └── source ├── hdu-graphics.dtx ├── hduthesis.dtx └── hduthesis.ins /.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /resource 3 | *.tds.zip 4 | *.zip 5 | *.tar.gz 6 | *.curlopt 7 | .DS_Store 8 | .xample -------------------------------------------------------------------------------- /build.lua: -------------------------------------------------------------------------------- 1 | --[==========================[-- 2 | L3BUILD FILE FOR HDUTHESIS 3 | --]==========================]-- 4 | 5 | function copyctan() 6 | local pkgdir = ctandir .. "/" .. ctanpkg 7 | mkdir(pkgdir) 8 | 9 | -- Handle pre-formed sources: do two passes to avoid any cleandir() issues 10 | for _,dest in pairs(tdsdirs) do 11 | mkdir(pkgdir .. "/" .. dest) 12 | end 13 | for src,dest in pairs(tdsdirs) do 14 | cp("*",src,pkgdir .. "/" .. dest) 15 | end 16 | 17 | -- Now deal with the one-at-a-time files 18 | local function copyfiles(files,source) 19 | if source == currentdir or flatten then 20 | for _,filetype in pairs(files) do 21 | cp(filetype,source,pkgdir) 22 | end 23 | else 24 | for _,filetype in pairs(files) do 25 | for _,p in ipairs(tree(source,filetype)) do 26 | local path = dirname(p.src) 27 | local ctantarget = pkgdir .. "/" 28 | .. source .. "/" .. path 29 | mkdir(ctantarget) 30 | cp(p.src,source,ctantarget) 31 | end 32 | end 33 | end 34 | end 35 | for _,tab in pairs( 36 | {bibfiles,demofiles,docfiles,pdffiles,scriptmanfiles,typesetlist}) do 37 | copyfiles(tab,docfiledir) 38 | end 39 | copyfiles(sourcefiles,sourcefiledir) 40 | for _,file in pairs(textfiles) do 41 | cp(file, textfiledir, pkgdir) 42 | end 43 | 44 | end 45 | 46 | module = "hduthesis" 47 | packtdszip = true 48 | flatten = false 49 | flattentds = false 50 | sourcefiledir = "source" 51 | typesetexe = "xelatex" 52 | installfiles = {"*.sty", "*.cls", "*.code.tex", "*.pdf"} 53 | typesetdemofiles = {"./example/*.tex"} 54 | specialtypesetting = specialtypesetting or {} 55 | specialtypesetting["hduthesis-stationery.tex"] = 56 | {cmd = "pdflatex --shell-escape -interaction=nonstopmode"} 57 | specialtypesetting["hduthesis-beamer.tex"] = 58 | {cmd = "pdflatex --shell-escape -interaction=nonstopmode"} 59 | 60 | uploadconfig = { 61 | pkg = module, 62 | version = "v1.1.0 2025-03-21", 63 | author = "Mingyu Xia", 64 | uploader = "Mingyu Xia", 65 | email = "myhsia@outlook.com", 66 | summary = [[ 67 | LaTeX class for bachelor and MPhil theses in Hangzhou Dianzi University 68 | ]], 69 | description = [[ 70 | This package provides a LaTeX template for graduation theses in Hangzhou Dianzi University. It supports the formatting of bachelor and MPhil degree theses. 71 | ]], 72 | license = "lppl1.3c", 73 | ctanPath = "/macros/latex/contrib/" .. module, 74 | announcement = [[ 75 | Version 1.1.1 released 76 | - Fixed the lost of graphics files when installing by tlmgr (x2). 77 | - Updated the l3build workflow. 78 | - Reconstructed hdu-graphicx.dtx. 79 | ]], 80 | home = "https://github.com/myhsia/" .. module, 81 | bugtracker = "https://github.com/myhsia/" .. module .. "/issues", 82 | support = "https://qm.qq.com/q/RGFmHwBecC", 83 | repository = "https://github.com/myhsia/" .. module, 84 | development = "https://github.com/myhsia", 85 | update = true, 86 | } -------------------------------------------------------------------------------- /example/hduthesis-bachelor.tex: -------------------------------------------------------------------------------- 1 | \documentclass 2 | [ 3 | math-font = STIX Two Math, agreed, 4 | CJKmain-font = { {Songti SC}[AutoFakeBold = 2.5, AutoFakeSlant] }, 5 | CJKsans-font = { {STHeiti}[AutoFakeBold = 2] } 6 | ] {hduthesis} 7 | \tikzset{ > = stealth } 8 | \usetikzlibrary{positioning, shapes.geometric} 9 | 10 | \hduset 11 | { 12 | title = HDU 学士学位论文 \hologo{LaTeX} 模板示例文档/ 13 | 本科毕业设计, 14 | department = 理学院, 15 | major = 物理学, 16 | class = 英才班, 17 | stdntid = C668668E, 18 | author = 申智能, 19 | supervisor = 教授:葉芷晴, 20 | % bibsource = xampl 21 | } 22 | 23 | \begin{document} 24 | 25 | \maketitle 26 | \commitment [ example-image-a/2024-05-31 ] 27 | 28 | \begin{abstract}[cn] 29 | \keywords{杭州电子科技大学, 毕业论文, \hologo{LaTeX3}, } 30 | \end{abstract} 31 | 32 | \begin{abstract}[en] 33 | \keywords{HDU, thesis, \hologo{LaTeX3}, } 34 | \end{abstract} 35 | 36 | \tableofcontents 37 | 38 | \chapter{引言} 39 | 1 40 | 41 | \cite{whole-journal} 42 | 43 | \zhlipsum[2] 44 | \cite{inbook-crossref,whole-set,booklet-full,incollection-crossref,whole-collection,manual-full,mastersthesis-full} 45 | 46 | \chapter{公式与插图测试} 47 | 48 | \begin{equation} 49 | (i\gamma^\mu\partial_\mu - m)\psi = 0 50 | \label{2-1} 51 | \end{equation} 52 | 其中 \eqref{2-1} 为Dirac 方程. 53 | \[ 54 | S_x = \frac12\sigma_1 = \frac12 55 | \begin{pmatrix} 56 | 0 & 1\\ 57 | 1 & 0 58 | \end{pmatrix}, \quad 59 | S_y = \frac12\sigma_1 = \frac12 60 | \begin{pmatrix} 61 | 0 & -i\\ 62 | i & 0 63 | \end{pmatrix}, \quad 64 | S_z = \frac12\sigma_1 = \frac12 65 | \begin{pmatrix} 66 | 1 & 0\\ 67 | 0 & -1 68 | \end{pmatrix} 69 | \] 70 | 上式为 Pauli 矩阵. 71 | 72 | \printbibliography 73 | 74 | \appendix 75 | \chapter*{附录} 76 | \addcontentsline{toc}{chapter}{附录} 77 | 78 | \end{document} 79 | -------------------------------------------------------------------------------- /example/hduthesis-beamer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[ mode = beamer, handout ]{hduthesis} 2 | 3 | \usepackage[mono = false]{libertine} 4 | \hduset 5 | { 6 | title = Beamer Theme for Hangzhou Dianzi University 7 | Based on \LaTeX3, 8 | subtitle = hdu Undergraduate Thesis Proposal, 9 | author = SAN Chi Nan (C668668E0), 10 | date = {\today{} / Xiasha Campus}, 11 | supervisor = Prof. YIP Tsz Ching, 12 | % bibsource = xampl.bib, 13 | } 14 | 15 | \begin{document} 16 | 17 | \maketitle 18 | 19 | \section{Research Methods} 20 | 21 | \begin{frame}{Landau-Lifshitz-Gilbert Equation} 22 | \pause 23 | Landau-Lifshitz-Gilbert (LLG) equation describes the microkinetics of magnetization in ferromagnetic materials. It combines the Landau-Lifshitz (LL) equation and the Gilbert damping term $\alpha$, which is used to simulate and understand the micro-magnetic dynamics phenomena such as the motion of magnetic domain walls and magnetization reversal. 24 | \pause 25 | \begin{equation} 26 | \odv{\mathbf m}{t} = -\gamma \mathbf m \times \mathbf H_\text{eff} - 27 | \boxed{\alpha \mathbf m \times \odv{\mathbf m}{t}} 28 | \end{equation} 29 | \pause 30 | To process the term $\alpha \mathbf m \times \odv{\mathbf m}/{t}$, 31 | we left multiply the LLG equation by $\mathbf m$ and use the identity 32 | $\mathbf m \cdot \odv{\mathbf m}/{t} = 0$ to generate LL equation. 33 | \pause 34 | \begin{equation} 35 | \odv{\mathbf m}{t} = -\frac{\gamma}{1 + \alpha^2} \mathbf m \times \mathbf H - \frac{\gamma\alpha}{1 + \alpha^2} \mathbf m \times \mathbf m \times \mathbf H 36 | \end{equation} 37 | \pause 38 | \alert{The LLG equation is more convenient for numerical calculation, while the LL equation can introduce the dissipation term more physically.} 39 | \end{frame} 40 | 41 | \begin{frame}{Applications} 42 | \pause 43 | \begin{block}{Magnetic Memory} 44 | Magnetic memory is a type of non-volatile memory that uses magnetic fields to store data. It is a type of computer memory that does not require power to maintain the information stored in the memory. 45 | \end{block} 46 | \pause 47 | \begin{exampleblock}{Magnetic Logic} 48 | Magnetic logic is a type of logic gate that uses magnetic fields to perform logical operations. It is a promising technology for future computing systems. 49 | \end{exampleblock} 50 | \pause 51 | \begin{alertblock}{Magnetic Sensor} 52 | Magnetic sensors are devices that detect magnetic fields. They are used in a wide range of applications, including automotive, industrial, and consumer electronics. 53 | \end{alertblock} 54 | Lorem, 55 | Ipsum, 56 | dummy, 57 | text 58 | \cite{whole-journal} 59 | \cite{inbook-crossref,whole-set,booklet-full,incollection-crossref,whole-collection,manual-full,mastersthesis-full} 60 | \end{frame} 61 | 62 | \begin{frame}{The NEGF Method} 63 | \pause 64 | The Nonequilibrium Green Function (NEGF) method can be used to study the quantum transport properties of nanoscale devices, such as quantum dots, nanowires, and molecular junctions. The four important Green's functions in the NEGF method are 65 | \pause 66 | \begin{equation} 67 | \begin{cases*} 68 | G^r = -i\theta(t - t') \ab\big<\{a_i(t), a_j^\dagger(t)\}> & Retarded Green's function\\ 69 | G^a = i\theta(t' - t) \ab\big<\{a_i(t), a_j^\dagger(t')\}> & Ahead Green's function\\ 70 | G^< = i\ab\big<\{a_j^\dagger(t'), a_i(t)\}> & Lesser Green's function\\ 71 | G^> = -i\ab\big<\{a_j^\dagger(t'), a_i(t)\}> & Greater Green's function 72 | \end{cases*} 73 | \end{equation} 74 | \pause 75 | And sometimes we need multiply anchors on the contour of time. 76 | \begin{center} 77 | \begin{tikzpicture} 78 | \draw [->] (-3.6,0) -- (3,0) node [anchor=south] {$t$} node [anchor=north] {$+\infty$} node [at start,anchor=north] {$-\infty$}; 79 | \draw [densely dashed, red,thick] (-3,0.75) -- (1.5,0.75) node [at start,anchor=north] {$C_1$} arc (90:0:0.25); 80 | \draw [densely dashed, green, thick] (1.75,0.5) arc (0:-90:0.25) node [at start] {$\times$} node [at start, anchor=west] {$t_1$} -- (-3.2,0.25) arc (90:270:0.25) -- (2.1,-0.25) arc (90:0:0.25); 81 | \draw [densely dashed, ->, blue, thick] (2.35,-0.5) arc (0:-90:0.25) node [at start] {$\times$} node [at start,anchor=west] {$t_1'$} -- (-3,-0.75) node [anchor=south] {$C_2$}; 82 | \end{tikzpicture} 83 | \end{center} 84 | \end{frame} 85 | 86 | \printbibliography 87 | 88 | \end{document} 89 | -------------------------------------------------------------------------------- /example/hduthesis-exam.tex: -------------------------------------------------------------------------------- 1 | \documentclass[mode = exam, twocolumn]{hduthesis} 2 | 3 | \usepackage[fontset = fandol]{ctex} 4 | \usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math} 5 | \usepackage{libertine} 6 | \title{\bfseries 24Fall \textsc{Hdu} 「模拟电子技术」期末试题} 7 | \author{} \date{} 8 | 9 | \ctikzset 10 | { 11 | amplifiers/fill = cyan!20, 12 | resistors/fill = violet!20, 13 | sources/fill = yellow!20, 14 | diodes/fill = red!20, 15 | resistors/scale = .6, 16 | capacitors/scale = .6, 17 | diodes/scale = .6, 18 | sources/scale = .8, 19 | inductors/scale = .6, 20 | } 21 | \tikzset {every node/.style = {font = \small}} 22 | 23 | \begin{document} 24 | 25 | \maketitle 26 | 27 | \begin{problem}[12 pt] 28 | 如图所示为加减运算电路,求输出电压 $v_o$ 的表达式. 29 | 30 | \centering 31 | \begin{circuitikz} 32 | \draw (0,0) node [ right ] {$v_o$} to [ short, o- ] ++ (-1,0) 33 | node [ op amp, anchor = out ] (A) {$\mathrm A$}; 34 | \draw (-6.5,2) node [ left ] {$v_{i_1}$} coordinate (vi1) 35 | to [ short, o-, european resistor, l = {$R_1 = \qty{30}\kohm$}] ++ 36 | (2.5,0) coordinate (R1) 37 | to [ european resistor, l = {$R_3 = \qty{60}\kohm$} ] 38 | (R1 -| A.out) to [ short, -* ] (A.out); 39 | \draw (A.- -| vi1) node [ left ] {$v_{i_2}$} 40 | to [ short, o-, european resistor, l = ${R_2 = \qty{60}\kohm}$ ] ++ 41 | (2.5,0) coordinate (R2) -- (A.-); 42 | \draw (A.+ -| vi1) node [ left ] {$v_{i_3}$} 43 | to [ short, o-, european resistor, l = ${R_4 = \qty{20}\kohm}$ ] ++ 44 | (2.5,0) coordinate (R4) -- (A.+); 45 | \draw (R1) to [ short, *-* ] (R2) node [ above right ] {$v_n$} 46 | (R4) node [ below right ] {$v_p$} to [ short, *- ] ++ (0,-.5) 47 | to [ european resistor, l_ = $R_5$ ] ++ (0,-1) node [ rground ] {}; 48 | \end{circuitikz} 49 | \end{problem} 50 | \begin{solution} 51 | 52 | \end{solution} 53 | 54 | \begin{problem}[12 pt] 55 | 如图所示放大电路 56 | \begin{enumerate} 57 | \item 请判断反馈放大电路的反馈组态. 58 | \item 在深度负反馈条件下,求反馈系数和闭环增益表达式. 59 | \end{enumerate} 60 | 61 | \centering 62 | \begin{circuitikz} 63 | \draw (0,0) node (ground) [ rground ] {} 64 | to [ european resistor, l = $R_1$] ++ (0,1.25) --++ (0,.25) 65 | node [ anchor = S, nigfete, solderdot ] (fet) {$T_1$} 66 | (fet.G) to [ short, -o ] ++ (-2,0) node [ left ] (vi) {$v_i$}; 67 | \draw ([xshift = -1cm]fet.G) 68 | to [ short, *-, european resistor, l_ = $R_g$ ] ++ (0,-2) coordinate (Rg) to (Rg |- ground) node [ rground ] {}; 69 | \draw (fet.S) to [ short, *-, european resistor, l_ = $R_2$ ] ++ 70 | (2,0) to [ short, -o ] ++ (.5,0) node [ right ] (vo) {$v_o$}; 71 | \draw (fet.D) to [ european resistor, l = $R_d$ ] ++ 72 | (0,2) to [ short, -o ] ++ (2.5,0) node [ right ] (VDD) {$V_\text{DD}$}; 73 | \draw (fet.D) to [ short, *- ] ++ (1,0) 74 | node [ pnp, anchor = B ] (pnp) {$T_2$}; 75 | \draw (pnp.E) to [ european resistor, l = $R_e$ ] ++ (0,1) coordinate (Re) 76 | (Re) to [ short, -* ] (VDD -| Re); 77 | \draw (pnp.C) to [ short, -* ] (vo -| pnp.C); 78 | \end{circuitikz} 79 | \end{problem} 80 | \begin{solution} 81 | 82 | \end{solution} 83 | 84 | \newpage 85 | 86 | \begin{problem}[12 pt] 87 | 如图电路,D 为硅二极管,$V_\text{DD} = \qty2\V$,$R = \qty1\kohm$,正弦信号 $v_s = 100 \sin(2\pi \times 50t) \unit\mV$,求输出电压 $v_o$. 88 | 89 | \centering 90 | \begin{circuitikz}[american] 91 | \draw (0,0) node [ below ] {$+$} to [ short, o- ] ++ (-1.5,0) 92 | to [ stroke diode, invert, l_ = D ] ++ (-3,0) 93 | to [ european voltage source, l_ = $v_s$ ] ++ (0,-2) 94 | to [ battery1, l_ = $V_\text{DD}$] ++ (0,-1) to [ short, -o ] ++ (4.5,0) 95 | node [ above ] {$-$}; 96 | \draw (-1.5,0) to [ short, *-*, european resistor, l_ = $R$ ] ++ (0,-3); 97 | \node at (0,-1.5) {$v_o$}; 98 | \end{circuitikz} 99 | \end{problem} 100 | \begin{solution} 101 | 102 | \end{solution} 103 | 104 | \begin{problem}[15 pt] 105 | 电路如下图所示,硅 BJT 三极管的 $\beta = 100$,$C_1$ 和 $C_2$ 为隔直耦合电容. 106 | \begin{enumerate} 107 | \item 发射极静态电流 $I_\text{BQ} = \qty1\mA$,求 $R_e$ 的值. 108 | \item 集电极电压 $V_\text{CQ} = \qty5\V$,求 $R_c$ 的值. 109 | \item $R_L = \qty5\kohm$,求电压增益 $A_\text{VB}$. 110 | \end{enumerate} 111 | 112 | \centering 113 | \begin{circuitikz} 114 | \draw (0,0) node [ npn, anchor = B ] (npn) {$T$} 115 | to [ european resistor, l_ = {$R_b = 500$} ] ++ (-2,0) 116 | to [ european voltage source, l_ = $V_s$ ] ++ (0,-2) 117 | coordinate (ground) node [ rground ] {}; 118 | \draw (npn.C) to [ european resistor, l_ = $R_c$] ++ (0,1.5) 119 | node [ vcc ] {$+\qty{15}\V$} (npn.E) 120 | to [ european resistor, l = $R_e$] ++ (0,-1.5) 121 | node [ vee ] {$-\qty{15}\V$}; 122 | \draw (npn.E) to [ short, *-, C = $C_2$ ] ++ (1.75,0) coordinate (C2) 123 | (C2 |- ground) node [ rground ] {} -- (C2); 124 | \draw (npn.C) to [ short, *-, C = $C_1$ ] ++ (2.5,0) 125 | node [ below left ] {$+$} to [ european resistor, l = $R_L$] ++ 126 | (0,-1.75) coordinate (RL) node [ above left ] {$V_0$}(RL |- ground) 127 | node [ rground ] {} node [ left ] {$-$} -- (RL); 128 | \end{circuitikz} 129 | \end{problem} 130 | \begin{solution} 131 | 132 | \end{solution} 133 | 134 | \newpage 135 | 136 | \begin{problem}[15 pt] 137 | 电路如图所示,设 MOSFET 的参数为 $V_\text{TN} = \qty1\V$, 138 | $K_n = \qty{0.8}{\mA/\V^2}$,$\lambda = 0$. 139 | \begin{enumerate} 140 | \item 试判断场效应管类型,及其工作区. 141 | \item 求静态工作点. 142 | \item 画出电路的微变等效电路,求电路的电压增益 $A_v$,输入电阻 $R_i$ 和输出电阻 $R_o$. 143 | \end{enumerate} 144 | 145 | \centering 146 | \begin{circuitikz} 147 | \draw (0,0) node [ below ] {$+$} 148 | to [ short, o-, C = $C_1$ ] ++ (1.75,0) --++ (.75,0) 149 | node (fet) [ anchor = G, nigfete ] {$T$} (fet.S) --++ (0,-2) 150 | node [ rground ] (ground) {}; 151 | \draw (fet.D) to [ european resistor, l_ = {$R_d = \qty{3}\kohm$} ] ++ (0,2) 152 | node [ vdd ] (vdd) {$+\qty5\V$}; 153 | \draw (0,-2) node [ above ] {$-$} coordinate (negative) 154 | to [ short, o-* ] (negative -| ground); 155 | \draw (1.75,-2) 156 | to [ short, *-*, european resistor, l_ = ${R_{g_2} = \qty{20}\kohm}$ ] 157 | (1.75,0) to [ european resistor, l_ = ${R_{g_1} = \qty{20}\kohm}$ ] 158 | ++ (0,2.5) --++ (0,.5) coordinate (Rg1) to [ short, -* ] (Rg1 -| vdd); 159 | \draw (fet.D) to [ short, *-o, C = $C_2$ ] ++ (2.5,0) 160 | node [ below ] {$v_o$}; 161 | \end{circuitikz} 162 | \end{problem} 163 | \begin{solution} 164 | 165 | \end{solution} 166 | 167 | \begin{problem}[12 pt] 168 | 双电源互补对称电路如图所示,设 $V_\text{CC} = \qty{12}\V$,$R_L = \qty{12}\ohm$, 169 | $v_i$ 为正弦波,求 170 | \begin{enumerate} 171 | \item 忽略 BJT 的饱和压降,负载上可能得到的最大输出功率 $P_\text{om}$. 172 | \item 直流电源供给的功率 $P_v = \frac2\pi \cdot \frac{V_\text{CC}}{R_L}$, 173 | 求放大器的效率 $\eta$. 174 | \end{enumerate} 175 | 176 | \centering 177 | \begin{circuitikz} 178 | \draw (0,0) node [ vee ] {$-V_\text{CC}$} --++ (0,.25) 179 | node [ pnp, anchor = C ] (pnp) {$T_2$} (pnp.E) 180 | node [ npn, anchor = E ] (npn) {$T_1$} (npn.C) --++ (0,.25) 181 | node [ vcc ] {$+V_\text{CC}$}; 182 | \draw (pnp.E) to [ short, *-o ] ++ (.9,0) --++ (.6,0) 183 | node [ right ] {$+$} to [ european resistor, l_ = $R_L$ ] ++ (0,-1.5) 184 | node [ right ] {$-$} node [ rground ] {}; 185 | \draw ([xshift = -1.5cm]pnp.E) coordinate (vi) to [ short, *-o ] 186 | ([xshift = -2.5cm]pnp.E) node [ left ] {$v_i$}; 187 | \draw (npn.B) -| (vi) |- (pnp.B); 188 | \end{circuitikz} 189 | 190 | \end{problem} 191 | \begin{solution} 192 | 193 | \end{solution} 194 | 195 | \newpage 196 | 197 | \begin{problem}[14 pt] 198 | 已知如图所示电路,设硅三极管 BJT 的 $\beta = 100$. 199 | \begin{enumerate} 200 | \item 计算电路的静态工作点. 201 | \item 计算双端输入、双端输出时的差模电压增益. 202 | \end{enumerate} 203 | 204 | \centering 205 | \begin{circuitikz} 206 | \draw (0,0) node [ vee ] {VEE $-\qty6\V$} 207 | to [ european resistor, l_ = {$R_e = \qty{5.3}\kohm$} ] ++ (0,1) 208 | to [ short, -* ] ++ (0,.25) coordinate (base); 209 | \draw (base) -| (-1,2) node (npn1) [ npn, anchor = E ] {$T_1$} 210 | (npn1.B) to [ short, -o ] ++ (-.25,0) node [ left ] {$V_{i_1}$} 211 | (npn1.C) to [ european resistor, l = {$R_{e_1} = \qty{6.2}\kohm$} ] ++ 212 | (0,2) --++ (1,0) coordinate (top); 213 | \draw (base) -| (1,2) 214 | node (npn2) [ npn, xscale = -1, anchor = E, reversed ] 215 | {\ctikzflipx{$T_2$}} 216 | (npn2.B) to [ short, -o ] ++ (.25,0) node [ right ] {$V_{i_2}$} 217 | (npn2.C) to [ european resistor, l_ = {$R_{e_2} = \qty{6.2}\kohm$} ] ++ 218 | (0,2) to [ short, -* ] ++ (-1,0); 219 | \draw (top) --++ (0,.25) node [ vcc ] {VCC $+\qty{6}\V$}; 220 | \draw (npn1.C) to [ short, *-o ] ++ (.25,0) node [ right ] {$V_{e_1}$} 221 | (npn2.C) to [ short, *-o ] ++ (-.25,0) node [ left ] {$V_{e_2}$}; 222 | \end{circuitikz} 223 | \end{problem} 224 | \begin{solution} 225 | 226 | \end{solution} 227 | 228 | \begin{problem}[8 pt] 229 | 电路如图所示,试用相位平衡条件判断能不能振荡. 如果能,请说明理由; 230 | 如果不能,也请说明理由,并最少程度上修改电路使其能产生振荡. 231 | 232 | \centering 233 | \begin{circuitikz}[american] 234 | \draw (0,0) to [ short, *-] ++ (.25,0) 235 | node [ npn, anchor = B ] (npn) {$T$} 236 | node [ transformer, anchor = A2 ] (trans) at (npn.C) {$L$} 237 | node [ circ ] at (npn.C) {} 238 | node [ circ ] at (trans.outer dot A2) {} 239 | node [ circ ] at (trans.outer dot B1) {} 240 | node [ rground ] at (trans.B2) {}; 241 | \draw (trans.A1) --++ (-.5,0) to [ C = $C$ ] 242 | ([xshift = -.5cm]trans.A2) -- (trans.A2); 243 | \draw (npn.B) to [ C = $C_b$] ++ (-1.5,0) |- (3,-3) |- 244 | ([xshift = .25cm]trans.B1) -- (trans.B1); 245 | \draw (trans.A1) --++ (0,.5) coordinate (vcc) to [ short, -o ] ++ (-2,0) 246 | node [ below ] {$V_\text{CC}$}; 247 | \draw (npn.E) to [ short, *-*, european resistor, l_ = $R_E$ ] ++ 248 | (0,-1.5) node [ rground ] (ground) {}; 249 | \draw (npn.E) --++ (1,0) coordinate (Ce) 250 | to [ C = $C_e$ ] (Ce |- ground) -- (ground) 251 | to (ground -| npn.B) --++ (-.25,0) 252 | to [ short, -*, european resistor, l = $R_{b_2}$] ([xshift = -.25cm]npn.B) 253 | coordinate (Rb2) 254 | to [ short, -*, european resistor, l = $R_{b_1}$] (Rb2 |- vcc); 255 | \end{circuitikz} 256 | \end{problem} 257 | 258 | \end{document} -------------------------------------------------------------------------------- /example/hduthesis-mphil.tex: -------------------------------------------------------------------------------- 1 | \documentclass 2 | [ 3 | math-font = STIX Two Math, agreed, 4 | CJKmain-font = { {Songti SC}[AutoFakeSlant] }, 5 | CJKsans-font = { {STHeiti}[AutoFakeBold = 2] } 6 | ] {hduthesis} 7 | 8 | \tikzset{ > = stealth } 9 | \usetikzlibrary{positioning,shapes.geometric} 10 | 11 | \hduset 12 | { 13 | title = 基于 \hologo{LaTeX3} 开发的 14 | 杭州电子科技大学硕士学位论文 \hologo{LaTeX} 模板/ 15 | \hologo{LaTeX} Template for Master's Thesis at Hangzhou Dianzi University that was Developed Based on \hologo{LaTeX3}, 16 | major = 凝聚态物理, 17 | stdntid = C668668E0, 18 | author = 申智能/SAN Chi Nan, 19 | supervisor = 教授:葉芷晴/Prof.:YIP Tsz Ching, 20 | % bibsource = xampl 21 | } 22 | 23 | \begin{document} 24 | 25 | \maketitle 26 | \commitment 27 | [ 28 | example-image-a/2025-05-31, example-image-a/2025-05-31, 29 | example-image-b/2025-06-01 30 | ] 31 | 32 | \begin{abstract}[cn] 33 | 34 | 设计模式被广泛用于解决软件设计和开发过程中反复出现的设计问题。设计模式在软件源码中的使用信息(即设计模式实例)能够在较大程度上反映软件系统的设计思路。准确地从软件源码中识别和挖掘设计模式实例能够帮助软件开发和维护人员快速理解软件系统的原始设计和实现,从而对软件系统的维护、升级 35 | 更新和二次开发等工作提供方便。 36 | 37 | 近些年来软件工程领域提出了多种自动化或半自动化地挖掘设计模式实例的方法。其中部分方法将设计模式和软件源码转化为某种特定的图的形式,然后通过挖掘同构子图的方式挖掘设计模式实例。然而,由于同构子图挖掘问题是一个NP完全问题,这些方法的执行效率通常较低。 38 | 39 | 为了有效解决基于子图同构的设计模式挖掘方法的效率低下问题,本文提出了一种高效的基于快速搜索序列和行为模板的结构型设计模式挖掘方法。该方法首先将设计模式和软件源码转化为一种带权有向图,即类关系图,然后从软件源码的类关系图中找出所有与设计模式的类关系图相同构的子图,每个子图的顶点所表示的类组成了一个候选设计模式实例。在挖掘过程中,本文方法为每种设计模式构建了一个快速搜索序列,该快速搜索序列描述了设计模式的结构信息并指定了一个高效的搜索设计模式角色的次序,从而大大减少了挖掘过程的搜索空间。此外,本文为每种设计模式制定了一个特定的行为模板,用于过滤候选实例集合中不满足行为特征的错误实例,进一步提高了本文方法的准确率。最后,本文选取4个常用的开源软件系统进行验证实验。实验结果表明,针对本文制定的结果基准,该方法不仅能够达到100\%的召回率和相对较高的准确率和F-measure值,而且显著提高了执行效率。 40 | 41 | \keywords{设计模式, 设计模式挖掘, 快速搜索序列, 行为模板, 子图同构} 42 | \end{abstract} 43 | 44 | \begin{abstract}[en] 45 | 46 | \setstretch{1.3} 47 | Design patterns are widely used to address the recurring design problems during the process of software design and development. The information about design patterns used in software source code-design pattern instances reveal much about the high-level abstract design ideas. Accurately identifying and detecting design pattern instances in a software system can help developers and maintainers to understand its original design and implementation, facilitating maintenance, update and re-development. 48 | 49 | In recent years, many approaches have been proposed to automatically or semi-automatically detecting design pattern instances from software source code. Among these approaches, some approaches transform software source code and design patterns into certain graphs, and then exploit subgraph isomorphism techniques to detect design pattern instances. However, as mining isomorphic subgraphs is an NP-complete problem, those approaches usually fail to achieve satisfactory efficiency. 50 | 51 | In order to effectively solve the inefficiency of the approaches which are based on subgraph isomorphism, we propose an efficient approach to detect structural design pattern instances based on quick-search sequences and behavior templates. In the proposed approach, we transform software source code and design patterns into a certain form of weighted and directed graph namely Class Relationship Graph, and then detect all the subgraphs from the source code graph which are isomorphic to the Class Relationship Graph of a certain design pattern. The classes that each isomorphic subgraph's vertices represent then consist of a candidate instance. During the process of detecting design pattern instances, we construct a quick-search sequence for each design pattern, which describes the structural characteristics of design pattern and specify an order to efficiently search the roles of each design pattern. According to the quick-search sequence, we can greatly reduce the search space. Afterwards, we construct a specific behavior template, which is used to filter the false positives in the candidate instance set and further improve the processing efficiency. Finally, we exploit our approach on four well-known open-source software systems. The results demonstrate that our approach not only achieves nearly 100\% recall and relatively high precision and F-measure on the benchmark we construct, but also significantly. 52 | 53 | \keywords 54 | { 55 | Design Pattern, Design Pattern Detection, Quick-Search Sequence, 56 | Behavior Template, Sub-graph Isomorphism 57 | } 58 | \end{abstract} 59 | 60 | \tableofcontents 61 | 62 | \chapter{绪论} 63 | 64 | \section{研究背景与意义} 65 | 66 | 随着信息技术的飞速发展和广泛应用,各行各业都积累了大量的软件系统。 67 | 68 | \section{国内外研究现状} 69 | 70 | 设计模式挖掘的相关研究工作伴随着设计模式在软件工程领域的提出而应运而生,并得到了广泛的关注和研究。正如 Apostolos Ampatzoglou 的描述,关于挖掘软件源码中设计模式实例的研究是设计模式相关的所有研究工作中最受关注的一项研究课题。 71 | 72 | \subsection{结构分析} 73 | 74 | 结构分析方法是最常见的挖掘设计模式实例的方法。 75 | 76 | \end{document} 77 | -------------------------------------------------------------------------------- /example/hduthesis-stationery.tex: -------------------------------------------------------------------------------- 1 | \documentclass[mode = stationery]{hduthesis} 2 | 3 | \usepackage{lipsum} 4 | \usepackage [ mono = false ] {libertine} 5 | 6 | \hduset 7 | { 8 | title = Recommendation Letter for SAN Chi Nan, 9 | author = YIP Tsz Ching, 10 | mail = email@server.domain, 11 | date = \today, 12 | watermark = true 13 | } 14 | 15 | \begin{document} 16 | 17 | \maketitle 18 | 19 | Dear Prof. Wong, 20 | 21 | \lipsum[1-2] 22 | 23 | \vfill \raggedleft 24 | 25 | Sincerely yours,\\[4ex] 26 | \includegraphics[ height = 2em ]{hdu-title}\\[2ex] 27 | Professor of Department of Physics\\ 28 | Hangzhou Dianzi University (Xiasha Campus) 29 | 30 | \vspace{\baselineskip} 31 | 32 | \clearpage 33 | 34 | \notelines[25] 35 | 36 | \end{document} -------------------------------------------------------------------------------- /hdu-graphics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhsia/hduthesis/38e7d81e81b79a43c43bf37d5c1759943abdf177/hdu-graphics.pdf -------------------------------------------------------------------------------- /hduthesis.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhsia/hduthesis/38e7d81e81b79a43c43bf37d5c1759943abdf177/hduthesis.pdf -------------------------------------------------------------------------------- /source/hduthesis.dtx: -------------------------------------------------------------------------------- 1 | % \iffalse meta-comment 2 | % 3 | % File: hduthesis.dtx 4 | % ----------------------------------------------------------------------- 5 | % Copyright (C) 2023-2025 by Mingyu Xia * 6 | % * 7 | % It may be distributed and/or modified under the conditions of the * 8 | % LaTeX Project Public License (LPPL), either version 1.3c of this * 9 | % license or (at your option) any later version. The latest version * 10 | % of this license is in the file * 11 | % * 12 | % http://www.latex-project.org/lppl.txt * 13 | % * 14 | % This work has the LPPL maintenance status `maintained'. * 15 | % * 16 | % The Current Maintainer of this work is Mingyu Xia. * 17 | % * 18 | % This work consists of the files hduthesis.dtx, * 19 | % hdu-graphics.dtx, * 20 | % and hduthesis.ins, * 21 | % and the derived files hduthesis.cls, * 22 | % hdu-.code.tex, * 23 | % beamerthemehdu.sty, * 24 | % hdu-logo.pdf, * 25 | % hdu-title.pdf, * 26 | % hdu-badge.pdf, * 27 | % hdu-motto.pdf, * 28 | % hduthesis.pdf, * 29 | % hdu-graphics.pdf, * 30 | % and README.md. * 31 | % ----------------------------------------------------------------------- 32 | % 33 | % Any modification of this file should ensure that the copyright and 34 | % license information is placed in the derived files. 35 | % 36 | % ----------------------------------------------------------------------- 37 | % 38 | %<*internal> 39 | \iffalse 40 | % 41 | % 42 | %<*readme> 43 | The `hduthesis` Class: LaTeX class for Hangzhou Dianzi University 44 | ================================================================= 45 | 46 | LaTeX class for bachelor and mphil theses in Hangzhou Dianzi 47 | University is constructed by `LaTeX-expl3`. This class provides typesets 48 | for bachelors' and mphils' thesis in Hangzhou Dianzi University. 49 | 50 | Modules of `hduThesiS` provide the following supports: 51 | 52 | - `typeset`: Math and text Typeset 53 | 54 | - `layout`: Some central layout typeset interfaces 55 | 56 | - `bc.config`: Configuration for bachelor thesis' style 57 | 58 | - `pg.config`: Configuration for mphil thesis' style 59 | 60 | - `beamer`: HDU Beamer theme 61 | 62 | - `stationery`: Creation of HDU's stationery 63 | 64 | - `exam`: Typeset for HDU examinations' solution 65 | 66 | - `l3doc`: Configuration for class's `l3doc` manual 67 | 68 | Issues 69 | ------ 70 | 71 | The issue tracker for `hduthesis` is currently located 72 | [on GitHub](https://github.com/myhsia/hduthesis/issues). 73 | 74 | --- 75 | 76 | 杭州电子科技大学学位论文 LaTeX 模板 77 | ============================== 78 | 79 | 杭州电子科技大学学位论文 LaTeX 模板以 `LaTeX-expl3` 构建,提供杭州电子科技大学学士和硕士学位论文格式. 80 | 81 | `hduThesiS` 的模块提供以下支持: 82 | 83 | - `typeset`: 数学和文本排版 84 | 85 | - `layout`: 封面和浮动题布局 86 | 87 | - `bc.config`: 学士论文格式配置 88 | 89 | - `pg.config`: 硕士论文格式配置 90 | 91 | - `beamer`: HDU Beamer 主题 92 | 93 | - `stationery.config`: 学校信纸生成 94 | 95 | - `exam`: HDU 试卷解析模板 96 | 97 | - `hdu.l3doc`: 模板 `l3doc` 用户手册配置 98 | 99 | --- 100 | 101 | References 102 | ---------- 103 | 104 | > \[1\]. The LaTeX3 Interfaces 105 | 106 | > \[2\]. CTeX 宏集 107 | 108 | > \[3\]. LaTeX for package and class authors current version 109 | 110 | > \[4\]. The LaTeX2e Sources 111 | 112 | > \[5\]. The LaTeX3 kernel: style guide for code authors 113 | 114 | > \[6\]. Package `etoolbox`, `geometry`, `tocloft`, `fancyhdr`, etc. 115 | 116 | > \[7\]. [毕业设计(论文)的写作规范及格式要求(含写作模板)](https://jwc.hdu.edu.cn/2022/0428/c4555a153813/page.htm) 117 | 118 | > \[8\]. [杭州电子科技大学研究生学位论文格式统一要求(杭电研〔2012〕311号)](https://grs.hdu.edu.cn/2013/0507/c1730a51754/page.htm) 119 | 120 | 121 | Copyright and License 122 | --------------------- 123 | 124 | Copyright (C) 2023-2025 by Mingyu Xia 125 | 126 | It may be distributed and/or modified under the conditions of the 127 | LaTeX Project Public License (LPPL), either version 1.3c of this 128 | license or (at your option) any later version. The latest version 129 | of this license is in the file 130 | 131 | This work has the LPPL maintenance status `maintained`. 132 | 133 | The Current Maintainer of this work is Mingyu Xia. 134 | % 135 | % 136 | %<*internal> 137 | \fi 138 | % 139 | % 140 | %<*driver|package> 141 | \RequirePackage{etoolbox} 142 | % 143 | %<*driver> 144 | \documentclass[mode = l3doc, full]{hduthesis} 145 | \usepackage[mono = false]{libertine} 146 | \makeindex 147 | \begin{document} 148 | \DocInput{\jobname.dtx} 149 | \end{document} 150 | % 151 | % \fi 152 | % 153 | % \title{\bfseries 154 | % \hologo{hduThesiS} 文档类\\^^A 155 | % 杭州电子科技大学学位论文 \hologo{LaTeX} 模板^^A 156 | % \thanks{^^A 157 | % 在 杭州电子科技大学非毕业生 / 教师 中寻找模板的接班人, 158 | % 要求熟悉 \pkg{expl3} 与文学编程. 欢迎有意愿者邮件联系. 159 | % } 160 | % } 161 | % 162 | % \author{^^A 163 | % Mingyu Xia \mailto{myhsia@outlook.com}^^A 164 | % \thanks{Physics Department, Graduate in 07/2025} 165 | % } 166 | % 167 | % \maketitle 168 | % 169 | % \begin{documentation} 170 | % 171 | % \begin{abstract} 172 | % \hologo{hduthesis} 是杭州电子科技大学学位论文 \hologo{LaTeX} 模板, 173 | % 支持学士、硕士学位论文排版,同时提供了学校信笺、Beamer(幻灯片)与试卷解析模板. 174 | % \end{abstract} 175 | % 176 | % \begin{center} 177 | % \small\bfseries 用户协议 178 | % \end{center} 179 | % \begin{enumerate}[itemsep = 2em, itemsep = 0pt]\small 180 | % \item 本模板通过 LPPL 1.3c 协议开放源代码,您可以随意使用编译出的 PDF 文件. 181 | % \item 本模板根据杭州电子科技大学教务处颁发的 182 | % \href{https://jwc.hdu.edu.cn/2022/0428/c4528a153813/page.htm} 183 | % {杭电理工类毕业论文写作规范} 编写而成,作者不对使用本模板产生的格式审查问题负责. 184 | % 如果您所在的学院因论文查重、收录等原因要求提交 \file{.docx} 格式, 185 | % 不接收 \file{.pdf} 论文稿件,请勿执意使用本模板,避免因格式转换带来不必要的麻烦. 186 | % 使用本模板时,请按编译错误提示操作来勾选同意用户协议. 187 | % \item 欢迎前往 \href{https://github.com/myhsia/hduthesis/issues}{GitHub} 188 | % 提交反馈意见,为推动学校认证与规范化 \hologo{hduthesis} 贡献力量. 189 | % \end{enumerate} 190 | % 191 | % \setcounter{tocdepth}{2} \tableofcontents 192 | % 193 | % \section{\hologo{hduthesis} 模板介绍} 194 | % 195 | % \hologo{hduthesis}(\textbf Hangzhou \textbf Dianzi \textbf University 196 | % \hologo{LaTeX} \textbf{Thesis} Template) 是杭州电子科技大学学位论文 197 | % \underline{非官方} \hologo{LaTeX} 模板,以 \hologo{LaTeX3} 构建, 198 | % 支持学士和硕士学位论文排版. 199 | % 200 | % 本模板文档将尽量完整地介绍模板的使用方法,如有不清楚之处,或者想提出改进建议, 201 | % 可以在 \href{https://github.com/myhsia/hduthesis/issues}{GitHub Issues} 202 | % 提交反馈意见及贡献代码. 203 | % 204 | % 对于未接触过 \hologo{LaTeX} 的初学者,推荐阅读 205 | % \href{https://tug.ctan.org/info/lshort/english/lshort.pdf} 206 | % {The Not So Short Introduction to \hologo{LaTeX2e}} 207 | % (可在终端执行 |texdoc lshort| 获取)或者其中文版 208 | % \href{http://mirrors.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf} 209 | % {《一份(不太)简短的 \hologo{LaTeX2e} 介绍》} 210 | % (可在终端执行 |texdoc lshort-zh-cn| 获取). 211 | % 212 | % \subsection{模板组成} 213 | % 214 | % \hologo{hduthesis} 模板的 \file{./tex/} 文件夹中包含了模板的所有 Runtime 文件. 215 | % 其中,\file{hduthesis.cls} 是模板的核心文件,实质上并不提供主要功能, 216 | % 只用于对全局选项的控制加载模板的各个模块. 模板的功能模块如下 217 | % 218 | % \begin{tasks}(2) 219 | % \task \file{typeset}:字体和公式设置. 220 | % \task \file{layout}:版面核心排版接口. 221 | % \task \file{pg.config}:硕士学位论文配置模块. 222 | % \task \file{bc.config}:本科学位论文配置模块. 223 | % \task \file{beamerthemehdu}:Beamer 主题. 224 | % \task \file{stationery}:信纸模块. 225 | % \task \file{exam}:HDU 试卷解析模板. 226 | % \task \file{l3doc}:用户手册模块. 227 | % \end{tasks} 228 | % 229 | % 以上模块包含在 \file{hdu-}\meta{module name}\file{.code.tex} 文件中. 230 | % 同时,\file{./tex/} 文件夹中还包含了 \file{hdu-logo.pdf}、\file{hdu-title.pdf}、 231 | % \file{hdu-motto.pdf}、\file{hdu-badge.pdf},分别提供杭州电子科技大学校徽、校名、 232 | % 校训和校牌的矢量图. 233 | % \footnote{如果你通过 |tlmgr| 安装了此模板,在其他文档类中也可以调用这些素材.} 234 | % 235 | % 模板预加载的宏包有 236 | % 237 | % \begin{table}[htbp] 238 | % \centering \renewcommand* \arraystretch {.72} 239 | % \begin{tabular*}{\linewidth} 240 | % {*9{@{\hspace{1ex}}>{\footnotesize}l@{\hspace{1ex}}}} 241 | % \toprule 242 | % \pkg{amssymb} & \pkg{bm} & \pkg{booktabs} & 243 | % \pkg{cancel} & \pkg{circuitikz} & \pkg{cleveref} & 244 | % \pkg{derivative} & \pkg{extarrows} & \pkg{fixdif} \\ 245 | % \midrule 246 | % \pkg{hyperref} & \pkg{listings} & \pkg{mathtools} & 247 | % \pkg{multicol} & \pkg{pgfplots} & \pkg{physics2} & 248 | % \pkg{siunitx} & 249 | % \multicolumn{2}{@{}>{\footnotesize}l}{\pkg{unicode-math}}\\ 250 | % \bottomrule 251 | % \end{tabular*} 252 | % \end{table} 253 | % 254 | % \subsection{文件结构} 255 | % 256 | % \noindent \begin{minipage}[t]{.54\linewidth} 257 | % \subsubsection{源文件 \& 使用用例} 258 | % \dirtree 259 | % {^^A 260 | % .1 ./hduthesis.tar.gz/. 261 | % .2 hduthesis.dtx, *.pdf. 262 | % .2 hdu-graphics.dtx, *.pdf. 263 | % .2 hduthesis.ins. 264 | % .2 example/. 265 | % .3 hduthesis-bachelor.tex, *.pdf. 266 | % .3 hduthesis-mphil.tex, *.pdf. 267 | % .3 reference.bib. 268 | % .3 cha/. 269 | % .3 figures/. 270 | % .2 README.md. 271 | % } 272 | % \end{minipage} \hspace*{\fill} 273 | % \begin{minipage}[t]{.42\linewidth} 274 | % \subsubsection{Runtime 文件} \label{1.2.2} 275 | % \dirtree 276 | % {^^A 277 | % .1 ./hduthesis.tar.gz/. 278 | % .2 hduthesis.dtx/. 279 | % .3 hduthesis.cls. 280 | % .3 hdu-.code.tex. 281 | % .3 beamerthemehdu.sty. 282 | % .3 README.md. 283 | % .2 hdu-graphics.dtx/. 284 | % .3 hdu-logo.pdf. 285 | % .3 hdu-title.pdf. 286 | % .3 hdu-badge.pdf. 287 | % .3 hdu-motto.pdf. 288 | % } 289 | % \end{minipage} 290 | % 291 | % \subsection{模板的妥协与僵持} 292 | % 293 | % \begin{enumerate} 294 | % \item 模板的章节(\cs[no-index]{chapter}、\cs[no-index]{section}、 295 | % \cs[no-index]{subsection})字体、前后间距完全按照 296 | % 杭电理工类毕业论文写作规范 进行设置,虽然这样的设置可能与您的审美不符, 297 | % 但是这是为了保证论文的格式符合学校的要求. 298 | % \item 杭电理工类毕业论文写作规范中要求 299 | % 参考文献书写格式应符合GB7714-1987,但目前 300 | % GB7714-2015 为学术界通用格式,在已有新标准情况下旧标准理应废止使用. 301 | % 所以本模板默认使用 \pkg{gbt7714} 宏包. 302 | % \end{enumerate} 303 | % 304 | % \section{模板安装} 305 | % 306 | % \subsection{系统要求} 307 | % 308 | % 本模板支持在 |macOS|、|Windows|、|Linux|、|Overleaf|、|LoongTeX|、|TeXPage| 309 | % 等平台使用,兼容发行版 \hologo{TeX} Live 2023 及更新版本^^A 310 | % \footnote{ 311 | % 本模板均可在 |macOS Sequoia Version 15.4| / 312 | % |Ubuntu 24.04.1 LTS| / |Overleaf| / 313 | % |LoongTeX| / |TeXPage| 314 | % 上的 \hologo{TeX} Live 2024 中顺利编译. 315 | % \hologo{MiKTeX} 发行版以及 Windows 平台未作测试. 如在这些平台编译无法通过, 316 | % 建议转向在线平台,本模板在诸多在线平台编译性能良好. 317 | % }. 318 | % 本模板生成学位论文时支持 \hologo{XeLaTeX}、\hologo{ApTeX} 与 \hologo{LuaLaTeX} 319 | % 编译;使用本模板生成信纸、试题解析时支持所有编译方式. 320 | % 321 | % \subsection{标准安装} 322 | % 323 | % 强烈建议您使用 |tlmgr| 进行安装与升级. 在终端(Terminal) 324 | % 执行以下命令即可安装最新版本的 \hologo{hduthesis} 模板. 325 | % \begin{quote} 326 | % "sudo tlmgr install hduthesis" 327 | % \end{quote} 328 | % 329 | % Windows 系统用户无需 |sudo|,请以管理员身份运行命令提示符. 330 | % 有些时候,您需要手动更新 |tlmgr| 才能正常使用 |tlmgr| 命令安装宏包. 331 | % \begin{quote} 332 | % "sudo tlmgr update --self" 333 | % \end{quote} 334 | % 335 | % 升级该模板,在终端(Terminal)执行以下命令即可 336 | % \begin{quote} 337 | % "sudo tlmgr update hduthesis" 338 | % \end{quote} 339 | % 发行版 \hologo{TeX} Live 2025 以及更新版本已自带本模板,无需安装. 只需在必要时升级即可. 340 | % 341 | % \subsection{手动安装} 342 | % 343 | % 本模板采用 \pkg{l3build} 脚本进行打包. 用户可在 344 | % \href{https://ctan.org/pkg/hduthesis}{CTAN}、 345 | % \href{https://github.com/myhsia/hduthesis/}{GitHub} 和 346 | % \href{https://gitee.com/myhsia/hduthesis}{Gitee} 平台 347 | % Clone 项目\footnote{CTAN 平台并未提供 \file{build.lua} 脚本}. 348 | % 解压后在当前目录运行 349 | % \begin{quote} 350 | % "l3build ctan"\\ 351 | % "l3build install" 352 | % \end{quote} 353 | % 会生成如 \ref{1.2.2} 所示的 Runtime 文件,并将模板安装至本地. 354 | % 355 | % \section{全局选项} 356 | % 357 | % \subsection{用户协议} 358 | % 359 | % 使用本模板编译本科、硕士学位论文时遇到``编译受阻''报错,请认真阅读封面的用户协议. 360 | % 添加选项 |agreed| 后(即|\documentclass [ agreed ] { hduthesis }|), 361 | % 方可顺利编译,并默认您已同意用户协议. 362 | % 363 | % 使用 \hologo{hduthesis} 编译信纸、试题解析、Beamer 和本用户手册时,无需 |agreed| 选项. 364 | % 365 | % \subsection{字体设置} 366 | % 367 | % 用户可通过全局选项设置文档的数学和中文字体. 设置的方式为键值对. 368 | % \begin{keyval} 369 | % \item [\key{math-font}] \val{font family name} 用于设置数学字体. 370 | % \item [\key{CJKmain-font}] \val{xeCJK interface} 用于设置罗马族的 CJK 字体. 371 | % \item [\key{CJKsans-font}] \val{xeCJK interface} 用于设置无衬线族的 CJK 字体. 372 | % \item [\key{CJKmono-font}] \val{xeCJK interface} 用于设置等宽族的 CJK 字体. 373 | % \end{keyval} 374 | % \begin{verbatim} 375 | % \documentclass 376 | % [ 377 | % math-font = STIX Two Math, agreed, 378 | % CJKmain-font = {{Songti SC}[AutoFakeBold = 2.5, AutoFakeSlant]}, 379 | % CJKsans-font = {{STHeiti}[AutoFakeBold = 2]} 380 | % ] {hduthesis} 381 | % \end{verbatim} 382 | % 更加详细的字体设置请参考 \pkg{xeCJK} 宏包的文档. 383 | % 384 | % \section{文档信息设置} 385 | % 386 | % \begin{function}{\hduset} 387 | % \begin{syntax} 388 | % \cs{DocInfo}\marg{key values} 389 | % \end{syntax} 390 | % 此命令接收键值,用于设置文档信息,需在导言区中执行. 391 | % \begin{keyval} 392 | % \item [\key{title}] \val{list} 用于设置论文题目与封面大标题. 393 | % \item [\key{department}] \val{string} 用于设置学院. 394 | % \item [\key{major}] \val{string} 用于设置专业. 395 | % \item [\key{class}] \val{string} 用于设置班级. 396 | % \item [\key{stdntid}] \val{string} 用于设置学号, 397 | % 会根据输入的学号自动选择本科生/研究生格式. 398 | % \item [\key{author}] \val{string} 用于设置作者. 399 | % \item [\key{supervisor}] \val{list} 用于设置导师. 400 | % \item [\key{bibsource}] \val{string} 用于设置插入参考文献文件源. 401 | % \end{keyval} 402 | % \end{function} 403 | % 404 | % 本科生输入样例如下. 考虑到不同学院对封面样式的要求不同 |毕业论文|、|毕业设计|、 405 | % |毕业论文(设计)|,\key*{title} 提供了接口供设置封面大标题: 406 | % 论文题目和大标题之间用斜线 (|/|) 分隔. 指导教师职称和姓名之间用半角冒号 (|:|) 分隔. 407 | % \begin{verbatim} 408 | % \hduset 409 | % { 410 | % title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/ 411 | % 本科毕业设计, department = 理学院, 412 | % major = 物理学, stdntid = C668668E, 413 | % author = 申智能, bibsource = reference, 414 | % class = 英才班, supervisor = 教授:葉芷晴, 415 | % } 416 | % \end{verbatim} 417 | % 418 | % 研究生输入样例如下. 硕士学位论文扉页需同时有英文版,因此需要在键 419 | % \key*{title} \key*{author} \key*{supervisor} 中分别输入中文和英文信息, 420 | % 中英信息使用斜线 (|/|) 分隔,指导教师职称和姓名之间用半角冒号 (|:|) 分隔. 421 | % 422 | % \begin{verbatim} 423 | % \hduset 424 | % { 425 | % title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/ 426 | % \hologo{LaTeX} Template for Thesis at 427 | % Hangzhou Dianzi University, 428 | % major = 物理学, stdntid = 216686680, 429 | % author = 申智能/SAN Chi Nan, bibsource = reference 430 | % supervisor = 教授:葉芷晴/Prof.:YIP Tsz Ching, 431 | % } 432 | % \end{verbatim} 433 | % 434 | % \subsection{生成封面 \& 扉页} 435 | % 436 | % \begin{function}{\maketitle} 437 | % 在正文区域,使用命令 \cs{maketitle} 即可生成论文封面和扉页. 438 | % 生成的封面和扉页会根据所设置的文档信息自动生成. 439 | % \end{function} 440 | % 441 | % \DescribeMacro{\l__hduthesis_grade_int} 442 | % 封面上的论文完成日期和学生毕业年份会根据当前系统时间自动生成. 443 | % 针对本科论文,如果当前月份在8月及以前,毕业年份会显示今年; 444 | % 如果当前月份在9月及以后,毕业年份会显示次年. 445 | % 在 \cs{DocInfo} 后对整型 \cs{l__hduthesis_grade_int} 重新赋值可手动更改毕业年份. 446 | % 447 | % \begin{quote} 448 | % "\ExplSyntaxOn"\\ 449 | % "\int_set:Nn \l__hduthesis_grade_int" \marg{Year}\\ 450 | % "\ExplSyntaxOff" 451 | % \end{quote} 452 | % 453 | % \subsection{生成承诺书} 454 | % 455 | % \begin{function}{\commitment} 456 | % \begin{syntax} 457 | % \cs{commitment} \oarg{file-date combined comma list} 458 | % \end{syntax} 459 | % 460 | % 此命令用于生成承诺书. 命令的可选参数接收数组,用于指定签名文件和输入签名的日期. 461 | % 签名文件和签名的日期之间用 |/| 分隔,多组签名之间用 |,| 分隔. 462 | % 签名文件接收 \file{.pdf} / \file{.png} / \file{.jpg} 等格式. 463 | % 日期的输入格式为 |yyyy-mm-dd|. 464 | % \end{function} 465 | % 466 | % 对于本科生,只需要签署 ``诚信承诺'' 一组签名; 467 | % 对于研究生,则需要签署 ``原创性声明''、 468 | % ``(作者同意)学位论文使用授权声明'' 和 469 | % ``(导师同意)学位论文使用授权声明'' 三组签名. 使用用例如下 470 | % 471 | % \begin{verbatim} 472 | % \begin{document} ... \maketitle 473 | % \commitment 474 | % [ example-image-a/2025-05-31, example-image-a/2025-05-31, 475 | % example-image-b/2025-06-01 ] 476 | % ... \end{document} 477 | % \end{verbatim} 478 | % 479 | % 如果使用者暂未生成签名但是需要添加日期,则将签名文件留空即可,但分隔符 |/| 仍需保留. 例如 480 | % \verb|\commitment [ /2024-05-31 ]|. 如果不需要添加日期,则直接留空即可. 481 | % 482 | % 论文封面、扉页和承诺书如下图. 483 | % 可在终端执行 |texdoc hduthesis-bachelor| 和 |texdoc hduthesis-mphil| 484 | % 分别获取本科和硕士学位论文样例文件. 485 | % 486 | % \begin{center} 487 | % \begin{minipage}{.32\linewidth} 488 | % \centering 489 | % \fbox{^^A 490 | % \includegraphics[width = .94\linewidth, page = 1] 491 | % {hduthesis-bachelor.pdf}^^A 492 | % } 493 | % \end{minipage} \hspace*{\fill} 494 | % \begin{minipage}{.32\linewidth} 495 | % \centering 496 | % \fbox{^^A 497 | % \includegraphics[width = .94\linewidth, page = 2] 498 | % {hduthesis-bachelor.pdf}^^A 499 | % } 500 | % \end{minipage} \hspace*{\fill} 501 | % \begin{minipage}{.32\linewidth} 502 | % \centering 503 | % \fbox{^^A 504 | % \includegraphics[width = .94\linewidth, page = 1] 505 | % {hduthesis-mphil.pdf}^^A 506 | % } 507 | % \end{minipage}\\ 508 | % \begin{minipage}{.32\linewidth} 509 | % \centering 510 | % \fbox{^^A 511 | % \includegraphics[width = .94\linewidth, page = 2] 512 | % {hduthesis-mphil.pdf}^^A 513 | % } 514 | % \end{minipage} \hspace*{\fill} 515 | % \begin{minipage}{.32\linewidth} 516 | % \centering 517 | % \fbox{^^A 518 | % \includegraphics[width = .94\linewidth, page = 3] 519 | % {hduthesis-mphil.pdf}^^A 520 | % } 521 | % \end{minipage} \hspace*{\fill} 522 | % \begin{minipage}{.32\linewidth} 523 | % \centering 524 | % \fbox{^^A 525 | % \includegraphics[width = .94\linewidth, page = 4] 526 | % {hduthesis-mphil.pdf}^^A 527 | % } 528 | % \end{minipage} 529 | % \end{center} 530 | % 531 | % \section{章节设置} 532 | % 533 | % \subsection{输入中 / 英摘要} 534 | % 535 | % \DescribeEnv{abstract} 536 | % 环境 \env{abstract} 用于生成摘要,其可选参数可设置语言格式. 537 | % 538 | % \begin{function}{\keywords} 539 | % 命令 \cs{keywords} 需在 \env{abstract} 环境内执行, 540 | % 其会根据 \env{abstract} 环境所选择的语言,自动生成英文 / 中文格式的关键词. 541 | % \begin{quote} 542 | % |\begin{abstract}|\oarg{language}\\ 543 | % | ... |\\ 544 | % | |\cs{keywords}\marg{keywords list}\\ 545 | % |\end{abstract}| 546 | % \end{quote} 547 | % 通过命令 \cs{keywords} 以半角逗号 (,) 为分隔输入关键词列表, 548 | % 输出时会根据所处 \env{abstract} 环境选择的语言不同,自动以半 / 全角分号分隔. 549 | % \end{function} 550 | % 551 | % \subsection{输入目录 \& 正文} 552 | % 553 | % 通过命令 \cs{tableofcontents} 可生成目录. \cs{chapter}、\cs{section}、 554 | % \cs{subsection} 等章节级次均按照 555 | % \href{https://jwc.hdu.edu.cn/2022/0428/c4528a153813/page.htm} 556 | % {杭电理工类毕业论文写作规范} 定制. 557 | % 558 | % \subsection{参考文献 \& 附录} 559 | % 560 | % 通过命令 \cs{DocInfo} 指定 \file{.bib} 文件后使用命令 \cs{printbiblography} 561 | % 即可输出参考文献列表. 参考文献格式已设置为 |gb7714-2015|. 562 | % 若未指定参考文献 \file{.bib} 文件,为加速编译,\pkg{gbt7714} 宏包将不会加载. 563 | % 564 | % 可以直接使用带有星号的章节命令生成附录章节,如 \verb|\chapter*{附录}|. 565 | % 566 | % \clearpage 567 | % 568 | % \section{附加模块} 569 | % 570 | % \subsection{用户手册} 571 | % 572 | % 本手册为 \cls{hduthesis} 加载 \pkg{l3doc} 模块后生成,此模块无需 \pkg{agreed} 选项. 573 | % \begin{quote} 574 | % |\documentclass [ mode = l3doc ] { hduthesis }| 575 | % \end{quote} 576 | % \subsection{杭州电子科技大学信笺} 577 | % 578 | % 加载模块 \pkg{stationery},并进行文档信息设置,即可生成信纸. 579 | % 可用于推荐信撰写或生成笔记纸. 此模块无需 \pkg{agreed} 选项. 580 | % \begin{quote} 581 | % |\documentclass [ mode = stationery ] { hduthesis }| 582 | % \end{quote} 583 | % 与学士 / 硕士学位论文文档信息设置类似,使用 \cs{DocInfo} 命令, 584 | % 对信件主题、发件人、邮箱、日期和水印进行设置. 此时 \cs{DocInfo} 命令接受键 585 | % \key*{title} \key*{author} \key*{mail} 586 | % \key*{date} \key*{watermark}. 下页为生成信纸的样例. 587 | % 588 | % \begin{verbatim} 589 | % \hduset 590 | % { 591 | % title = Recommendation Letter for SAN Chi Nan, 592 | % author = YIP Tsz Ching, mail = email@server.domain, 593 | % date = {23\textsuperscript{th} December, 2024}, 594 | % watermark = true 595 | % } 596 | % \begin{document} \maketitle ... \end{document} 597 | % \end{verbatim} 598 | % 599 | % \begin{function}{\notelines} 600 | % \begin{syntax} 601 | % \cs{notelines} \oarg{num} 602 | % \end{syntax} 603 | % 用于在信纸上添加笔记线,其可选参数接收笔记线的数量,默认值为20. 604 | % 下页为生成的信纸和笔记纸样例,可在终端执行 |texdoc hduthesis-stationery| 605 | % 获取此样例文件. 606 | % \end{function} 607 | % 608 | % \includepdf [ pages = -, nup = 1x2, angle = -90, frame, 609 | % linktodoc, scale = 0.96, delta = 0in .25in 610 | % ] {hduthesis-stationery} 611 | % 612 | % \subsection{Beamer 主题} 613 | % 614 | % 本模板中存在独立的 Beamer 主题 |hdu|,用于生成杭州电子科技大学风格的 Beamer 幻灯片. 615 | % 该主题目前暂不开放更改主题色杭电蓝和 Logo. 616 | % 617 | % 加载模块 \pkg{beamer} 后可通过 \cs{hduset} 接口设置文档信息. 618 | % 此模块无需 \pkg{agreed} 选项. 619 | % \begin{quote} 620 | % "\documentclass [ mode = beamer ] { hduthesis }" 621 | % \end{quote} 622 | % 与学士 / 硕士学位论文文档信息设置类似,使用 \cs{DocInfo} 命令, 623 | % 对信件主题、发件人、邮箱、日期和水印进行设置. 此时 \cs{DocInfo} 命令接受键 624 | % \key*{title} \key*{subtitle} \key*{author} \key*{date} \key*{supervisor} 625 | % \key*{reference}. 下页为生成Beamer的样例. 626 | % \begin{verbatim} 627 | % \hduset 628 | % { 629 | % title = Beamer Theme for Hangzhou Dianzi University 630 | % Based on \LaTeX3, 631 | % subtitle = hdu Undergraduate Thesis Proposal, 632 | % author = SAN Chi Nan (C668668E0), 633 | % date = {\today{} / Building 6, Room 321}, 634 | % supervisor = Prof. YIP Tsz Ching, 635 | % bibsource = reference.bib, 636 | % } 637 | % \end{verbatim} 638 | % 639 | % \subsection{HDU 试卷解析模块} 640 | % 641 | % 加载模块 \pkg{exam} 后即可使用此模块, 642 | % 此模块无需 \pkg{agreed} 选项. 643 | % \begin{quote} 644 | % "\documentclass [ mode = exam ] { hduthesis }" 645 | % \end{quote} 646 | % 此模块中预制了 \env{problem} 和 \env{solution} 环境. 647 | % 648 | % \includepdf [ pages = -, nup = 2x4, frame, linktodoc, 649 | % scale = 0.96, delta = .25in .2in 650 | % ] {hduthesis-beamer} 651 | % 652 | % \includepdf [ pages = -, nup = 1x2, angle = -90, frame, 653 | % linktodoc, scale = 0.96, delta = 0in .25in 654 | % ] {hduthesis-exam} 655 | % 656 | % \begin{thebibliography}{99} 657 | % \bibitem{interface3} The \hologo{LaTeX} Project. 658 | % The \hologo{LaTeX3} Interfaces. CTAN: Released 2025-03-10. 659 | % \bibitem{ctex} \url{CTEX.ORG}. C\hologo{TeX} 宏集. 2022-07-14 v2.5.10. 660 | % \bibitem{clsguide} \hologo{LaTeX} Project Team. 661 | % \hologo{LaTeX} for package and class authors current version 662 | % \copyright{} Copyright 2023 -- 2024. 2024-09-15. 663 | % \bibitem{source2e} B. Johannes, C. David, J. Alan, L. Leslie L, M. Frank, 664 | % R. Chris, and S. Rainer. 665 | % \hologo{LaTeX} for package and class authors current version. 666 | % 2024-11-01 Patch level 2. 667 | % \bibitem{l3styleguide} The \hologo{LaTeX} Project. 668 | % The \hologo{LaTeX3} kernel: style guide for code authors. 669 | % CTAN: Released 2025-03-10. 670 | % \bibitem{packages} Package \pkg{etoolbox}, \pkg{geometry}, \pkg{tocloft}, 671 | % \pkg{fancyhdr}, etc. 672 | % \bibitem{hdubachelor} 杭州电子科技大学教务处. 673 | % \href{https://jwc.hdu.edu.cn/2022/0428/c4555a153813/page.htm} 674 | % {毕业设计(论文)的写作规范及格式要求} 675 | % \bibitem{hdumphil} 杭州电子科技大学研究生院. 676 | % \href{https://grs.hdu.edu.cn/2013/0507/c1730a51754/page.htm} 677 | % {杭州电子科技大学研究生学位论文格式统一要求(杭电研〔2012〕311号)} 678 | % \end{thebibliography} 679 | % \end{documentation} 680 | % \restoregeometry \appendix 681 | % \begin{implementation} 682 | % 683 | % \section{实现细节} 684 | % 685 | % \subsection{\file{hduthesis.cls} 的实现} 686 | % 687 | % \begin{macrocode} 688 | %<@@=hdu> 689 | % \end{macrocode} 690 | % 691 | % \begin{macrocode} 692 | %<*class> 693 | % \end{macrocode} 694 | % 695 | % \begin{macrocode} 696 | \def \hduthesis@date {2025-03-23} 697 | \def \hduthesis@version {1.1.1} 698 | \def \hduthesis@maintainerid {myhsia} 699 | % \end{macrocode} 700 | % 701 | % \begin{macrocode} 702 | \ProvidesExplClass {hduthesis} {\hduthesis@date} {\hduthesis@version} 703 | {LaTeX Template Bundle for Hangzhou Dianzi University} 704 | % \end{macrocode} 705 | % 兼容 \hologo{TeX} Live 2023 及之后的版本. 当对应命令不存在时,在已有命令基础上新增变体 706 | % \begin{macrocode} 707 | \cs_if_exist:NF \seq_set_split:Nne 708 | { \cs_generate_variant:Nn \seq_set_split:Nnn { Nne } } 709 | \cs_if_exist:NF \seq_set_split:Nee 710 | { \cs_generate_variant:Nn \seq_set_split:Nnn { Nee } } 711 | \cs_if_exist:NF \tl_set:Ne 712 | { \cs_generate_variant:Nn \tl_set:Nn { Ne } } 713 | \cs_if_exist:NF \tl_gset:Ne 714 | { \cs_generate_variant:Nn \tl_gset:Nn { Ne } } 715 | % \end{macrocode} 716 | % 警告信息设置 717 | % \begin{macrocode} 718 | \cs_new_protected:Npn \@@_msg_new:nn #1#2 719 | { \msg_new:nnn { hduthesis } {#1} {#2} } 720 | \cs_new_protected:Npn \@@_msg_error:nn #1#2 721 | { \msg_error:nnn { hduthesis } {#1} {#2} } 722 | \cs_generate_variant:Nn \@@_msg_error:nn { nx } 723 | \cs_new_protected:Npn \@@_msg_warning:nn #1#2 724 | { \msg_warning:nnn { hduthesis } {#1} {#2} } 725 | \cs_generate_variant:Nn \@@_msg_warning:nn { nx } 726 | \@@_msg_new:nn { not found module } 727 | { The ~ hduthesis ~ module ~ `#1' ~ not ~ found. } 728 | \@@_msg_new:nn { unknown mode } 729 | { 730 | Unknown ~ hduthesis ~ mode ~ `#1',~ 731 | loading ~ mode ~ `thesis' ~ instead. 732 | } 733 | \@@_msg_new:nn { Users Agreement } 734 | { 735 | \exp_not:n 736 | { 737 | 编译受阻!~ 使用模板前请阅读用户手册中的「用户协议」 738 | \MessageBreak 739 | !模板作者 (@myhsia) 不对使用本模板产生的格式审查问题负责! 740 | \MessageBreak 741 | 如果您同意协议,在全局选项中添加 `agreed' 即可解除本错误 742 | \MessageBreak 743 | 欢迎您通过邮件 (myhsia@hdu.edu.cn) 或 GitHub 反馈意见 744 | } 745 | } 746 | % \end{macrocode} 747 | % \begin{macro}{\@@_load_module:n, \@@_provide_module:n} 748 | % 加载 / 提供 \cls{hduthesis} 的模块 749 | % \begin{macrocode} 750 | \cs_new_protected_nopar:Npn \@@_load_module:n #1 751 | { 752 | \clist_map_inline:nn {#1} 753 | { 754 | \file_if_exist_input:nF { hdu-##1.code.tex } 755 | { \@@_msg_error:nn { not found module } {##1} } 756 | } 757 | } 758 | \cs_new_protected_nopar:Npn \@@_provide_module:n #1 759 | { 760 | \ProvidesExplFile{hdu-#1.code.tex} 761 | {\hduthesis@date}{\hduthesis@version} 762 | {hduThesiS ~ \text_titlecase:n {#1} ~ Module} 763 | } 764 | % \end{macrocode} 765 | % \end{macro} 766 | % \begin{variable} 767 | % { 768 | % \g_@@_agreement_bool, \g_@@_mode_tl, 769 | % \g_@@_math_font, \g_@@_main_CJK_font, 770 | % \g_@@_sans_CJK_font, \g_@@_mono_CJK_font 771 | % } 772 | % 定义文档类全局选项的键. 773 | % \begin{macrocode} 774 | \keys_define:nn { hduthesis / classoption } 775 | { 776 | agreed .bool_set:N = \g_@@_agreement_bool, 777 | agreed .initial:n = false, 778 | agreed .default:n = true, 779 | mode .tl_set:N = \g_@@_mode_tl, 780 | math-font .tl_set:N = \g_@@_math_font, 781 | CJKmain-font .tl_set:N = \g_@@_main_CJK_font, 782 | CJKsans-font .tl_set:N = \g_@@_sans_CJK_font, 783 | CJKmono-font .tl_set:N = \g_@@_mono_CJK_font, 784 | unknown .code:n = \@@_unknown_option:n {#1}, 785 | } 786 | % \end{macrocode} 787 | % \end{variable} 788 | % \begin{macro}{\@@_unknown_option:n} 789 | % \begin{variable}{\g_@@_base_options_clist} 790 | % 用于接收其他对此文档类未知选项. 791 | % \begin{macrocode} 792 | \clist_new:N \g_@@_base_options_clist 793 | % \end{macrocode} 794 | % \end{variable} 795 | % 处理未知选项:移交基本文档类处理. 796 | % \begin{macrocode} 797 | \cs_new_protected_nopar:Npn \@@_unknown_option:n #1 798 | { 799 | \tl_if_empty:nTF { #1 } 800 | { 801 | \clist_gput_right:NV 802 | \g_@@_base_options_clist \l_keys_key_str 803 | } 804 | { 805 | \exp_args:NNx 806 | \clist_gput_right:Nn \g_@@_base_options_clist 807 | { \l_keys_key_str = \exp_not:n {#1} } 808 | } 809 | } 810 | % \end{macrocode} 811 | % \end{macro} 812 | % 处理接收到的全局选项. 813 | % \begin{macrocode} 814 | \ProcessKeyOptions [ hduthesis / classoption ] 815 | % \end{macrocode} 816 | % 遇到未知模块时返回警告信息. 817 | % \begin{macrocode} 818 | \bool_lazy_all:nT 819 | { 820 | { !\str_if_empty_p:N \g_@@_mode_tl } 821 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { thesis } } 822 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { beamer } } 823 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { stationery } } 824 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { exam } } 825 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { l3doc } } 826 | } 827 | { \@@_msg_warning:nx { unknown mode } { \g_@@_mode_tl } } 828 | % \end{macrocode} 829 | % 加载 \module{beamer} 模块. 830 | % \begin{macrocode} 831 | \str_if_eq:eeT { \g_@@_mode_tl } { beamer } 832 | { 833 | \PassOptionsToClass { aspectratio = 2013 } { beamer } 834 | \exp_args:NNV 835 | \LoadClass [ \g_@@_base_options_clist ] { beamer } 836 | \usetheme{hdu} 837 | \endinput 838 | } 839 | % \end{macrocode} 840 | % 加载 \module{stationery} 模块. 841 | % \begin{macrocode} 842 | \str_if_eq:eeT { \g_@@_mode_tl } { stationery } 843 | { 844 | \PassOptionsToClass { 12pt } { letter } 845 | \exp_args:NNV 846 | \LoadClass [ \g_@@_base_options_clist ] { letter } 847 | \@@_load_module:n { stationery } 848 | \endinput 849 | } 850 | % \end{macrocode} 851 | % 加载 \module{exam} 模块. 852 | % \begin{macrocode} 853 | \str_if_eq:eeT { \g_@@_mode_tl } { exam } 854 | { 855 | \exp_args:NNV 856 | \LoadClass [ \g_@@_base_options_clist ] { article } 857 | \@@_load_module:n { exam } 858 | \endinput 859 | } 860 | % \end{macrocode} 861 | % 加载 \module{l3doc} 模块. 862 | % \begin{macrocode} 863 | \str_if_eq:eeT { \g_@@_mode_tl } { l3doc } 864 | { 865 | \PassOptionsToClass { 11pt, letterpaper, kernel } { l3doc } 866 | \RequirePackage{minted} 867 | \exp_args:NNV 868 | \LoadClass [ \g_@@_base_options_clist ] { l3doc } 869 | \@@_load_module:n { l3doc } 870 | \endinput 871 | } 872 | % \end{macrocode} 873 | % 其余情况下,默认加载 \module{thesis} 模块,并根据所输入的学号位数加载不同配置. 874 | % 未确认用户协议时,返回错误信息. 875 | % \begin{macrocode} 876 | \bool_lazy_any:nT 877 | { 878 | { \str_if_eq_p:ee { \g_@@_mode_tl } { thesis } } 879 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { beamer } } 880 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { stationery } } 881 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { exam } } 882 | { !\str_if_eq_p:ee { \g_@@_mode_tl } { l3doc } } 883 | } 884 | { 885 | \PassOptionsToClass { a4paper, zihao = -4 } { ctexrep } 886 | \PassOptionsToPackage { quiet, no-math } { xeCJK } 887 | \exp_args:NNV 888 | \LoadClass [ \g_@@_base_options_clist ] { ctexrep } 889 | \bool_if:NTF \g_@@_agreement_bool 890 | { 891 | \RequirePackage{hyperref} 892 | \pdfstringdefDisableCommands 893 | { 894 | \def \cite#1 {<#1>} 895 | \def \hologoRobust#1 {<#1>} 896 | } 897 | \AtBeginDocument 898 | { 899 | \hypersetup 900 | { hidelinks, pdfproducer = hduThesiS ~ by ~ Mingyu ~ Xia } 901 | } 902 | } { \@@_msg_error:nn { Users Agreement } { Unconfirmed } } 903 | \@@_load_module:n { typeset } 904 | \@@_load_module:n { layout } 905 | \cs_new_protected:Nn \@@_docinfo_degree_if_aux: 906 | { 907 | \int_compare:nNnTF 908 | { \tl_count:N \l_@@_set_stdntid_tl } = { 8 } 909 | { \@@_load_module:n { bc.config } } 910 | { \@@_load_module:n { pg.config } } 911 | } 912 | \endinput 913 | } 914 | % \end{macrocode} 915 | % 916 | % \begin{macrocode} 917 | % 918 | % \end{macrocode} 919 | % 920 | % \subsection{\module{typeset} 模块的实现} 921 | % 922 | % \begin{macrocode} 923 | %<*typeset> 924 | % \end{macrocode} 925 | % 926 | % \begin{macrocode} 927 | \@@_provide_module:n {typeset} 928 | % \end{macrocode} 929 | % 930 | % \begin{macrocode} 931 | \RequirePackage { circuitikz, pgfplots, listings, hologo, 932 | lipsum, zhlipsum, booktabs, multicol } 933 | \pgfplotsset { compat = newest } 934 | % \end{macrocode} 935 | % 插图相对路径设置. 936 | % \begin{macrocode} 937 | \graphicspath 938 | { 939 | {./figure/} {./figures/} {./image/} {./images/} 940 | {./graphics/} {./graphic/} {./pictures/} {./picture/} 941 | } 942 | % \end{macrocode} 943 | % 设置行距倍数、缩进和公式前后间距. 944 | % \begin{macrocode} 945 | \linespread{1.39} 946 | \AtBeginDocument 947 | { 948 | \dim_set:Nn \abovedisplayskip {3pt} 949 | \dim_set:Nn \belowdisplayskip {3pt} 950 | \dim_set:Nn \parindent { 2\ccwd } 951 | } 952 | % \end{macrocode} 953 | % 公式排版必要宏包加载,行间公式前后间距设置. 954 | % \begin{macrocode} 955 | \RequirePackage { mathtools, amssymb, cancel, fixdif, 956 | derivative, siunitx, physics2, bm } 957 | \usephysicsmodule { ab, braket, op.legacy, qtext.legacy } 958 | % \end{macrocode} 959 | % \begin{macro}{\@@_font_semilarge:, \@@_font_semiLarge:} 960 | % 两种新字体尺寸设置. 961 | % \begin{macrocode} 962 | \cs_new_protected:Nn \@@_font_semilarge: 963 | { \@setfontsize \@@_font_semilarge:{14}{16.5} } 964 | \cs_new_protected:Nn \@@_font_semiLarge: 965 | { \@setfontsize \@@_font_semiLarge:{16.5}{17.5} } 966 | % \end{macrocode} 967 | % \end{macro} 968 | % 设置西文字体、数学字体、中文字体. 969 | % \begin{macrocode} 970 | \sys_if_engine_xetex:T 971 | { 972 | \RequirePackage 973 | [ warnings-off = { mathtools-colon, mathtools-overbracket } 974 | ] {unicode-math} 975 | \setmainfont{texgyretermes} 976 | [ 977 | Extension = .otf, UprightFont = *-regular, 978 | BoldFont = *-bold, ItalicFont = *-italic, 979 | BoldItalicFont = *-bolditalic 980 | ] 981 | \setsansfont{texgyreheros} 982 | [ 983 | Extension = .otf, BoldItalicFont = *-bolditalic, 984 | UprightFont = *-regular, BoldFont = *-bold, 985 | ItalicFont = *-italic, Scale = .9 986 | ] 987 | \tl_if_empty:NF \g__hdu_math_font 988 | { \setmathfont { \g__hdu_math_font } } 989 | \tl_if_empty:NF \g__hdu_main_CJK_font 990 | { \exp_last_unbraced:No \setCJKmainfont \g__hdu_main_CJK_font } 991 | \tl_if_empty:NF \g__hdu_sans_CJK_font 992 | { \exp_last_unbraced:No \setCJKsansfont \g__hdu_sans_CJK_font } 993 | \tl_if_empty:NF \g__hdu_mono_CJK_font 994 | { \exp_last_unbraced:No \setCJKmonofont \g__hdu_mono_CJK_font } 995 | } 996 | % \end{macrocode} 997 | % 998 | % \begin{macrocode} 999 | % 1000 | % \end{macrocode} 1001 | % 1002 | % \subsection{\module{layout} 模块的实现} 1003 | % 1004 | % \begin{macrocode} 1005 | %<*layout> 1006 | % \end{macrocode} 1007 | % 1008 | % \begin{macrocode} 1009 | \@@_provide_module:n {layout} 1010 | % \end{macrocode} 1011 | % 页面样式、编号、列表设置. 1012 | % \begin{macrocode} 1013 | \RequirePackage { geometry, array, setspace, 1014 | fancyhdr, enumitem, cleveref } 1015 | \RequirePackage 1016 | [ skip = 1.75ex, labelsep = quad, font = small ]{caption} 1017 | \fancyhf{} 1018 | \pagestyle{fancy} 1019 | \renewcommand*\headrulewidth {.8pt} 1020 | \renewcommand*\thefigure {\arabic{chapter}-\arabic{figure}} 1021 | \renewcommand*\thetable {\arabic{chapter}-\arabic{table}} 1022 | \renewcommand*\theequation {\arabic{chapter}-\arabic{equation}} 1023 | \AddToHook{env/figure/after}{\vspace*{-2.3ex}} 1024 | \AddToHook{env/table/after}{\vskip-1.9ex} 1025 | \setlist[enumerate,1] 1026 | { 1027 | label = (\,\arabic*\,), itemindent = 4em, leftmargin = 0em, 1028 | labelsep = 1ex, topsep = 0pt, itemsep = 0pt, partopsep = 0pt, 1029 | parsep = 0em, listparindent = 2\ccwd 1030 | } 1031 | \crefformat{figure}{图#2#1#3} 1032 | \crefformat{table}{表#2#1#3} 1033 | % \end{macrocode} 1034 | % \begin{macro}{\@@_cover_spread_box:nn, \@@_cover_center_box:nn} 1035 | % 分散对齐盒子与 下划线居中对齐盒子. 1036 | % \footnote{由 \url{tex.stackexchange.com} 论坛上 |@egreg| 提供接口.} 1037 | % \begin{macrocode} 1038 | \cs_new_protected:Npn \@@_cover_spread_box:nn #1#2 1039 | { 1040 | \mode_leave_vertical: 1041 | \hbox_to_wd:nn {#1} 1042 | { \exp_args:Nee \tl_map_inline:nn {#2} { ##1 \hfil } \unskip } 1043 | } 1044 | \cs_new_protected:Npn \@@_cover_center_box:nn #1#2 1045 | { 1046 | \mode_leave_vertical: 1047 | \dim_set:Nn \l_tmpa_dim {#1} 1048 | \global\setbox1 = \box\voidb@x 1049 | \group_begin: 1050 | \setbox0 = \vbox 1051 | { 1052 | \dim_set:Nn \hsize {#1}\relax 1053 | \dim_set:Nn \parindent {0pt} 1054 | \skip_set:Nn \leftskip {0pt plus 1fil} 1055 | \skip_set:Nn \rightskip {0pt plus -1fil} 1056 | \skip_set:Nn \parfillskip {0pt plus 2fil} 1057 | #2 \par 1058 | \loop 1059 | \setbox2 = \lastbox 1060 | \unless\ifvoid2 1061 | \global\setbox1 = \vtop 1062 | { \hbox to\hsize{\strut\unhbox2} 1063 | \vskip-4pt \hrule height .5pt 1064 | \vskip9.6pt \unvbox1 1065 | } 1066 | \unskip\unpenalty 1067 | \repeat 1068 | } 1069 | \group_end: 1070 | \box1 1071 | } 1072 | % \end{macrocode} 1073 | % \end{macro} 1074 | % \begin{macro}{\@@_process_array:NnnN} 1075 | % 拆分 \cs{hduset} 部分键值输入二维数组. 1076 | % \begin{macrocode} 1077 | \cs_new_protected_nopar:Npn \@@_process_array:NnnN #1#2#3#4 1078 | { 1079 | \seq_set_split:Nee \l_@@_process_array_seq { / } {#1} 1080 | \seq_set_split:Nee \l_@@_process_array_row_seq { \c_colon_str } 1081 | { \seq_item:Nn \l_@@_process_array_seq {#2} } 1082 | \tl_if_eq:nnTF {#3} {:} 1083 | { 1084 | \tl_gset:Ne #4 1085 | { \seq_use:Nn \l_@@_process_array_row_seq {} } 1086 | } 1087 | { 1088 | \tl_gset:Ne #4 1089 | { \seq_item:Nn \l_@@_process_array_row_seq {#3} } 1090 | } 1091 | \seq_clear:N \l_@@_process_array_seq 1092 | \seq_clear:N \l_@@_process_array_row_seq 1093 | } 1094 | % \end{macrocode} 1095 | % \end{macro} 1096 | % \begin{variable}{\g_@@_month_clist} 1097 | % 存储英文月份表达. 1098 | % \begin{macrocode} 1099 | \clist_set:Nn \g_@@_month_clist 1100 | { 1101 | January, February, March, April, May, June, 1102 | July, August, September, October, November, December 1103 | } 1104 | % \end{macrocode} 1105 | % \end{variable} 1106 | % \begin{variable} 1107 | % { 1108 | % \l_@@_set_title_tl, \l_@@_set_department_tl, 1109 | % \l_@@_set_major_tl, \l_@@_set_class_tl, 1110 | % \l_@@_set_stdntid_tl, \l_@@_set_author_tl, 1111 | % \l_@@_set_supervisor_tl, \l_@@_set_bibsource_tl 1112 | % } 1113 | % 模式 \module{thesis} 下 \cs{hduset} 接口键值的定义. 1114 | % \begin{macrocode} 1115 | \keys_define:nn { thesis / hduset } 1116 | { 1117 | title .clist_set:N = \l_@@_set_title_tl, 1118 | department .tl_set:N = \l_@@_set_department_tl, 1119 | major .tl_set:N = \l_@@_set_major_tl, 1120 | class .tl_set:N = \l_@@_set_class_tl, 1121 | stdntid .tl_set:N = \l_@@_set_stdntid_tl, 1122 | author .clist_set:N = \l_@@_set_author_tl, 1123 | supervisor .tl_set:N = \l_@@_set_supervisor_tl, 1124 | bibsource .tl_set:N = \l_@@_set_bibsource_tl, 1125 | } 1126 | % \end{macrocode} 1127 | % \end{variable} 1128 | % \begin{macro}{\hduset} 1129 | % 模式 \module{thesis} 下设置文档信息. 1130 | % \begin{macrocode} 1131 | \NewDocumentCommand \hduset { m } 1132 | { 1133 | \keys_set:nn { thesis / hduset } {#1} 1134 | \@@_docinfo_process_aux: 1135 | \@@_docinfo_degree_if_aux: 1136 | } 1137 | % \end{macrocode} 1138 | % \end{macro} 1139 | % \begin{macro}{\@@_docinfo_process_aux:} 1140 | % 模式 \module{thesis} 下 \cs{hduset} 的辅助命令:拆分数组 / 设置参考文献. 1141 | % \begin{macrocode} 1142 | \cs_set_protected_nopar:Nn \@@_docinfo_process_aux: 1143 | { 1144 | \@@_process_array:NnnN \l_@@_set_title_tl {1} {:} \@title 1145 | \@@_process_array:NnnN \l_@@_set_title_tl {2} {:} 1146 | \l_@@_set_entitle_tl 1147 | \@@_process_array:NnnN \l_@@_set_author_tl {1} {:} \@author 1148 | \@@_process_array:NnnN \l_@@_set_author_tl {2} {:} 1149 | \l_@@_set_enauthor_tl 1150 | \@@_process_array:NnnN \l_@@_set_supervisor_tl {1} {1} 1151 | \l_@@_set_cnrole_tl 1152 | \@@_process_array:NnnN \l_@@_set_supervisor_tl {1} {2} 1153 | \l_@@_set_cnsupervisor_tl 1154 | \@@_process_array:NnnN \l_@@_set_supervisor_tl {2} {1} 1155 | \l_@@_set_enrole_tl 1156 | \@@_process_array:NnnN \l_@@_set_supervisor_tl {2} {2} 1157 | \l_@@_set_ensupervisor_tl 1158 | \bool_if:NF \g_@@_agreement_bool 1159 | { \tl_clear:N \l_@@_set_bibsource_tl } 1160 | \tl_if_empty:NTF \l_@@_set_bibsource_tl 1161 | { 1162 | \newcommand*\printbibliography{\chapter*{参考文献}} 1163 | \newcounter {citecount} 1164 | \renewcommand*\cite[1] 1165 | { 1166 | \refstepcounter{citecount} 1167 | \textsuperscript{[\thecitecount]} 1168 | } 1169 | } 1170 | { 1171 | \RequirePackage[sort&compress]{gbt7714} 1172 | \bibliographystyle{gbt7714-numerical} 1173 | \dim_set:Nn \bibsep {.35ex} 1174 | \newcommand*\printbibliography 1175 | { 1176 | \bibliography { \l_@@_set_bibsource_tl } 1177 | \addcontentsline{toc}{chapter}{参考文献} 1178 | } 1179 | } 1180 | } 1181 | % \end{macrocode} 1182 | % \end{macro} 1183 | % \begin{macro}{\@@_commitment_sign:N} 1184 | % 插入签名图片. 1185 | % \begin{macrocode} 1186 | \cs_new_protected:Npn \@@_commitment_sign:N #1 1187 | { 1188 | \leavevmode@ifvmode 1189 | \lower \dimexpr \f@size\p@ * 9/16 1190 | \hbox 1191 | { 1192 | \includegraphics 1193 | [ height = { \fp_eval:n { 2*\f@size }\p@ } ] {#1} 1194 | } 1195 | } 1196 | % \end{macrocode} 1197 | % \end{macro} 1198 | % \begin{macro}{\@@_sign_process_aux:nnn} 1199 | % 处理承诺书签名数组的辅助命令. 签名文件名需要展开后存入 1200 | % \cs{l_@@_sign_figure_tl} 中. 1201 | % \begin{macrocode} 1202 | \cs_new_protected_nopar:Npn \@@_sign_process_aux:nnn #1#2#3 1203 | { 1204 | \clist_set:Nn \l_@@_sign_process_clist {#1} 1205 | \seq_set_split:Nne \l_@@_sign_figure_seq {/} 1206 | { \clist_item:Nn \l_@@_sign_process_clist {#2} } 1207 | \int_compare:nNnTF {#3} = {0} 1208 | { 1209 | \tl_set:Ne \l_@@_sign_figure_tl 1210 | { \seq_item:Nn \l_@@_sign_figure_seq { #3 + 1 } } 1211 | \seq_clear:N \l_@@_sign_figure_seq 1212 | } 1213 | { 1214 | \seq_set_split:Nne \l_@@_sign_date_seq {-} 1215 | { \seq_item:Nn \l_@@_sign_figure_seq {2} } 1216 | \seq_item:Nn \l_@@_sign_date_seq {#3} 1217 | \seq_clear:N \l_@@_sign_date_seq 1218 | } 1219 | \clist_clear:N \l_@@_sign_process_clist 1220 | } 1221 | % \end{macrocode} 1222 | % \end{macro} 1223 | % 1224 | % \begin{macrocode} 1225 | % 1226 | % \end{macrocode} 1227 | % 1228 | % \subsection{\module{bc.config} 模块的实现} 1229 | % 1230 | % \begin{macrocode} 1231 | %<*bc.config> 1232 | % \end{macrocode} 1233 | % 1234 | % \begin{macrocode} 1235 | \ExplSyntaxOn \makeatletter 1236 | % \end{macrocode} 1237 | % 1238 | % \begin{macrocode} 1239 | \@@_provide_module:n {bc.config} 1240 | % \end{macrocode} 1241 | % 设置页面布局、页眉、目录页码格式. 1242 | % \begin{macrocode} 1243 | \geometry { top = 3.25cm, bottom = 2.4cm, 1244 | left = 4cm, right = 2cm, 1245 | headsep = .72cm, headheight = 15pt } 1246 | \fancyhead[C] 1247 | { 1248 | \raisebox { .12ex } 1249 | { \small 杭州电子科技大学 \l_@@_set_entitle_tl } 1250 | } 1251 | \hook_gput_code:nnn {cmd/tableofcontents/before} { . } 1252 | { 1253 | \clearpage 1254 | \pagenumbering{Roman} \cfoot{\small \thepage} 1255 | } 1256 | \hook_gput_code:nnn { cmd/tableofcontents/after } { . } 1257 | { 1258 | \thispagestyle{fancy} \clearpage 1259 | \pagenumbering{arabic} \cfoot{} 1260 | } 1261 | % \end{macrocode} 1262 | % \begin{macro}{\maketitle} 1263 | % 重新定义封面布局. 1264 | % \begin{macrocode} 1265 | \RenewDocumentCommand \maketitle {} 1266 | { 1267 | \newgeometry { margin = 3cm } 1268 | \titlepage \@@_maketitle_bc_auxi: \endtitlepage 1269 | \restoregeometry 1270 | } 1271 | % \end{macrocode} 1272 | % \end{macro} 1273 | % \begin{variable}{\l_@@_grade_int} 1274 | % 存储毕业年份. 根据当前月份判断. 1275 | % \begin{macrocode} 1276 | \int_new:N \l_@@_grade_int 1277 | \int_set:Nn \l_@@_grade_int 1278 | { 1279 | \int_compare:nNnTF { \c_sys_month_int } < 9 1280 | { \c_sys_year_int } { \int_eval:n { \c_sys_year_int + 1 } } 1281 | } 1282 | % \end{macrocode} 1283 | % \end{variable} 1284 | % \begin{macro}{\@@_maketitle_bc_auxi:} 1285 | % \cs{maketitle} 的辅助命令. 1286 | % \begin{macrocode} 1287 | \cs_new_protected_nopar:Nn \@@_maketitle_bc_auxi: 1288 | { 1289 | \begin{center} 1290 | \vspace*{14\p@} 1291 | \includegraphics[ width = .64\linewidth ]{hdu-title} 1292 | \par \vspace*{36\p@} 1293 | \scalebox{2.75} 1294 | { 1295 | \textbf 1296 | { 1297 | \@@_cover_spread_box:nn 1298 | { .205\paperwidth } { \l_@@_set_entitle_tl } 1299 | } 1300 | } 1301 | \par \vspace*{1.5\baselineskip} 1302 | { \LARGE (\int_use:N \l_@@_grade_int \bfseries 届) } 1303 | \par \vspace*{3.0\baselineskip} 1304 | \begin{tabular} 1305 | { 1306 | >{\large\bfseries}p{5.5\ccwd}@{} 1307 | >{\large\centering\arraybackslash\kaishu}p{.65\linewidth}@{} 1308 | } 1309 | \@@_cover_spread_box:nn { 4\ccwd } { 题目 } & 1310 | \@@_cover_center_box:nn { .95\linewidth } 1311 | { \@title }\\[5.2ex] 1312 | \@@_cover_spread_box:nn { 4\ccwd } { 学院 } & 1313 | \@@_cover_center_box:nn { .95\linewidth } 1314 | { \l_@@_set_department_tl }\\[5.2ex] 1315 | \@@_cover_spread_box:nn { 4\ccwd } { 专业 } & 1316 | \@@_cover_center_box:nn { .95\linewidth } 1317 | { \l_@@_set_major_tl }\\[5.2ex] 1318 | \@@_cover_spread_box:nn { 4\ccwd } { 班级 } & 1319 | \@@_cover_center_box:nn { .95\linewidth } 1320 | { \l_@@_set_class_tl }\\[5.2ex] 1321 | \@@_cover_spread_box:nn { 4\ccwd } { 学号 } & 1322 | \@@_cover_center_box:nn { .95\linewidth } 1323 | { \l_@@_set_stdntid_tl }\\[5.2ex] 1324 | \@@_cover_spread_box:nn { 4\ccwd } { 学生姓名 } & 1325 | \@@_cover_center_box:nn { .95\linewidth } 1326 | { \@author }\\[5.2ex] 1327 | \@@_cover_spread_box:nn { 4\ccwd } { 指导教师 } & 1328 | \@@_cover_center_box:nn { .95\linewidth } 1329 | { 1330 | \l_@@_set_cnsupervisor_tl \quad 1331 | \l_@@_set_cnrole_tl 1332 | }\\[5.2ex] 1333 | \@@_cover_spread_box:nn { 4\ccwd } { 完成日期 } & 1334 | \@@_cover_center_box:nn { .95\linewidth } 1335 | { 1336 | \textsf{\int_use:N \c_sys_year_int} 年 1337 | \textsf{\int_use:N \c_sys_month_int} 月 1338 | } 1339 | \end{tabular} 1340 | \end{center} 1341 | } 1342 | % \end{macrocode} 1343 | % \end{macro} 1344 | % \begin{macro}{\commitment} 1345 | % 生成承诺书 1346 | % \begin{macrocode} 1347 | \NewDocumentCommand \commitment { O{} } 1348 | { 1349 | \newgeometry{ margin = 3cm } 1350 | \titlepage 1351 | \@@_commitment_bc_aux:n {#1} 1352 | \endtitlepage 1353 | \restoregeometry 1354 | } 1355 | % \end{macrocode} 1356 | % \end{macro} 1357 | % \begin{macro}{\@@_commitment_bc_aux:n} 1358 | % \cs{commitment} 的辅助命令. 1359 | % \begin{macrocode} 1360 | \cs_new_protected_nopar:Npn \@@_commitment_bc_aux:n #1 1361 | { 1362 | \vspace*{65\p@} 1363 | \begin{center} 1364 | \@beginparpenalty \@lowpenalty 1365 | \Large \textsf 1366 | { \bfseries \@@_cover_spread_box:nn { 6\ccwd }{ 诚信承诺 } } 1367 | \@endparpenalty \@M 1368 | \end{center} 1369 | \vspace*{.4\baselineskip} \par 1370 | \linespread{2.1} 1371 | { 1372 | \@@_font_semilarge: 1373 | 我谨在此承诺:本人所写的毕业论文《\@title 》均系本人独立完成, 1374 | 没有抄袭行为,凡涉及其他作者的观点和材料,均作了注释,若有不实, 1375 | 后果由本人承担。 1376 | \par\vspace*{\baselineskip} \bfseries\sffamily 1377 | \hskip.48\linewidth 承诺人(签名): 1378 | \@@_sign_process_aux:nnn {#1} { 1 } { 0 } 1379 | \tl_if_empty:NF \l_@@_sign_figure_tl 1380 | { 1381 | \@@_commitment_sign:N 1382 | \l_@@_sign_figure_tl 1383 | \tl_clear:N \l_@@_sign_figure_tl 1384 | } 1385 | \par \vspace*{.5\baselineskip} 1386 | \hskip \dim_eval:n { .48\linewidth - 1em } 1387 | \makebox [ 3em ] 1388 | { \@@_sign_process_aux:nnn {#1} { 1 } { 1 } } 年 1389 | \makebox [ 2em ] 1390 | { \@@_sign_process_aux:nnn {#1} { 1 } { 2 } } 月 1391 | \makebox [ 2em ] 1392 | { \@@_sign_process_aux:nnn {#1} { 1 } { 3 } } 日 1393 | } 1394 | } 1395 | % \end{macrocode} 1396 | % \end{macro} 1397 | % \DescribeEnv{abstract} 1398 | % 重新定义摘要环境,加入中英文判断. 1399 | % \begin{macrocode} 1400 | \RenewDocumentEnvironment {abstract} { O{en} } 1401 | { 1402 | \str_if_eq:nnT {#1} {en} 1403 | { 1404 | \tl_set:Nn \l_@@_keywords_name_tl {Keywords:~} 1405 | \tl_set:Nn \l_@@_keywords_sep_tl {;~} 1406 | \@beginparpenalty \@lowpenalty 1407 | \chapter*{\normalfont\bfseries ABSTRACT} 1408 | } 1409 | \str_if_eq:nnT {#1} {cn} 1410 | { 1411 | \tl_set:Nn \l_@@_keywords_name_tl {\textsf{关键词:}} 1412 | \tl_set:Nn \l_@@_keywords_sep_tl {;} 1413 | \@beginparpenalty \@lowpenalty 1414 | \chapter*{摘\qquad 要} 1415 | } 1416 | } 1417 | { 1418 | \tl_clear:N \l_@@_abstract_title_tl 1419 | \cfoot{} \clearpage 1420 | } 1421 | % \end{macrocode} 1422 | % \begin{variable}{\l_@@_keywords_clist} 1423 | % 存储关键词列表. 1424 | % \begin{macrocode} 1425 | \clist_new:N \l_@@_keywords_clist 1426 | % \end{macrocode} 1427 | % \end{variable} 1428 | % \begin{macro}{\keywords} 1429 | % 重新定义 \cs{keywords} 命令,关键词样式会根据 \env{abstract} 所选语言自动变化. 1430 | % \begin{macrocode} 1431 | \NewDocumentCommand \keywords { m } 1432 | { 1433 | \par \vspace*{\baselineskip} 1434 | \noindent\textbf{\l_@@_keywords_name_tl} 1435 | \clist_set:Nn \l_@@_keywords_clist {#1} 1436 | \clist_use:Nn \l_@@_keywords_clist {\l_@@_keywords_sep_tl} 1437 | } 1438 | % \end{macrocode} 1439 | % \end{macro} 1440 | % 设置目录样式. 1441 | % \begin{macrocode} 1442 | \RequirePackage{tocloft} 1443 | \renewcommand \contentsname {\hfill 目 \qquad 录 \hfill} 1444 | \renewcommand* \cfttoctitlefont {\sffamily\@@_font_semiLarge:} 1445 | \dim_set:Nn \cftbeforetoctitleskip {3pt} 1446 | \dim_set:Nn \cftaftertoctitleskip {24pt} 1447 | \dim_set:Nn \cftbeforechapskip {1pt} 1448 | \dim_set:Nn \cftbeforesecskip {-.2pt} 1449 | \patchcmd { \@dottedtocline } 1450 | { 1451 | \leaders 1452 | \hbox { $\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$ } 1453 | } 1454 | { 1455 | \kern 4pt \leaders 1456 | \hbox { $\m@th\mkern .4 mu\hbox{-}\mkern .4 mu$ } 1457 | } {}{} 1458 | \renewcommand* \l@chapter {\@dottedtocline{1}{0em}{1.6em}} 1459 | \renewcommand* \l@section {\@dottedtocline{1}{2.3em}{2.1em}} 1460 | \renewcommand* \@dotsep {1.7} 1461 | \renewcommand* \@pnumwidth {2.5ex} 1462 | \renewcommand* \cftchapfont {\normalfont} 1463 | \setcounter{tocdepth}{1} 1464 | % \end{macrocode} 1465 | % 使用 \cs{ctexset} 提供的接口设置章节样式. 1466 | % \begin{macrocode} 1467 | \ctexset 1468 | { 1469 | chapter = 1470 | { 1471 | fixskip = true, name = {}, beforeskip = 21pt, 1472 | format+ = \sffamily \large, afterskip = 34pt, 1473 | number = \arabic{chapter}, pagestyle = fancy, 1474 | }, 1475 | section = 1476 | { 1477 | beforeskip = 1.25ex, fixskip = true, 1478 | afterskip = 1.5ex, format = \sffamily \@@_font_semilarge: 1479 | }, 1480 | subsection = 1481 | { 1482 | beforeskip = 1.25ex, fixskip = true, 1483 | afterskip = 1.5ex, format = \sffamily 1484 | } 1485 | } 1486 | % \end{macrocode} 1487 | % 1488 | % \begin{macrocode} 1489 | \makeatother \ExplSyntaxOff 1490 | % \end{macrocode} 1491 | % 1492 | % \begin{macrocode} 1493 | % 1494 | % \end{macrocode} 1495 | % 1496 | % \subsection{\module{pg.config} 模块的实现} 1497 | % 1498 | % \begin{macrocode} 1499 | %<*pg.config> 1500 | % \end{macrocode} 1501 | % 1502 | % \begin{macrocode} 1503 | \ExplSyntaxOn \makeatletter 1504 | % \end{macrocode} 1505 | % 1506 | % \begin{macrocode} 1507 | \@@_provide_module:n {pg.config} 1508 | % \end{macrocode} 1509 | % 设置页面布局、页眉、目录页码格式. 1510 | % \begin{macrocode} 1511 | \geometry { top = 2.8cm, bottom = 3.2cm, left = 3.2cm, right = 3.2cm, 1512 | headheight = 15pt, headsep = .72cm, footskip = 1.5cm } 1513 | \fancyhead[C] 1514 | { \raisebox { .12ex } { \small 杭州电子科技大学硕士学位论文 } } 1515 | \hook_gput_code:nnn { cmd/tableofcontents/after } { . } 1516 | { 1517 | \clearpage 1518 | \pagenumbering{arabic} 1519 | \cfoot{\small \thepage} 1520 | } 1521 | % \end{macrocode} 1522 | % 重新定义封面布局. 1523 | % \begin{macrocode} 1524 | \RenewDocumentCommand \maketitle {} 1525 | { 1526 | \newgeometry{margin = 2.75cm} 1527 | \begin{titlepage} 1528 | \@@_maketitle_pg_auxi: 1529 | \end{titlepage} 1530 | \titlepage 1531 | \@@_maketitle_pg_auxii: 1532 | \endtitlepage 1533 | \titlepage 1534 | \@@_maketitle_pg_auxiii: 1535 | \endtitlepage 1536 | \restoregeometry 1537 | \pagenumbering{Roman} 1538 | \cfoot {\small \thepage} 1539 | } 1540 | % \end{macrocode} 1541 | % \begin{macro} 1542 | % {\@@_maketitle_pg_auxi:, \@@_maketitle_pg_auxii:, \@@_maketitle_pg_auxiii:} 1543 | % \cs{maketitle} 的辅助命令:封面设置、中文扉页设置、英文扉页设置. 1544 | % \begin{macrocode} 1545 | \cs_new_protected_nopar:Nn \@@_maketitle_pg_auxi: 1546 | { 1547 | \begin{center} 1548 | \null 1549 | \includegraphics[height = 2.35cm]{hdu-title} 1550 | \par \vspace*{40\p@} 1551 | { 1552 | \LARGE 1553 | \@@_cover_spread_box:nn {.575\linewidth} {硕士学位论文} 1554 | } 1555 | \par\vspace*{100\p@} 1556 | \@@_font_semiLarge: 题 \qquad 目: 1557 | \@@_cover_center_box:nn { .75\linewidth } { \kaishu \@title } 1558 | \vspace*{24\p@}\par 1559 | \begin{tabular} 1560 | { 1561 | >{ \@@_font_semiLarge: \centering \arraybackslash } 1562 | p{4\ccwd}@{} 1563 | >{ \@@_font_semiLarge: \centering \arraybackslash \kaishu } 1564 | p{.65\linewidth}@{} 1565 | } 1566 | \@@_cover_spread_box:nn { 4\ccwd } { 研究生 } & 1567 | \@@_cover_center_box:nn { .96\linewidth } { \@author }\\ 1568 | \@@_cover_spread_box:nn { 4\ccwd } { 专业 } & 1569 | \@@_cover_center_box:nn { .96\linewidth } 1570 | { \l_@@_set_major_tl }\\ 1571 | \@@_cover_spread_box:nn { 4\ccwd } { 指导教师 } & 1572 | \@@_cover_center_box:nn { .96\linewidth } 1573 | { 1574 | \l_@@_set_cnsupervisor_tl \qquad \l_@@_set_cnrole_tl 1575 | }\\[13.5ex] 1576 | \@@_font_semilarge: 完成日期 & 1577 | \@@_cover_center_box:nn { .96\linewidth } 1578 | { 1579 | \@@_font_semilarge: 1580 | \textsf { \int_use:N \c_sys_year_int } 年 1581 | \textsf { \int_use:N \c_sys_month_int } 月 1582 | } 1583 | \end{tabular} 1584 | \end{center} 1585 | } 1586 | \cs_new_protected_nopar:Nn \@@_maketitle_pg_auxii: 1587 | { 1588 | \begin{center} 1589 | \vspace*{25\p@} 1590 | { \LARGE 杭州电子科技大学硕士学位论文 } 1591 | \vspace*{140\p@} \par 1592 | \begin{spacing}{1.15} 1593 | \huge\textsf{ \@title } 1594 | \end{spacing} 1595 | \vspace*{128\p@} \par 1596 | \begin{tabular} 1597 | { 1598 | >{ \@@_font_semiLarge: } p{6.25\ccwd} 1599 | >{ \@@_font_semiLarge: \kaishu } l 1600 | } 1601 | \@@_cover_spread_box:nn { 4\ccwd } { 研究生 }:& 1602 | \@@_cover_spread_box:nn { 4\ccwd } { \@author }\\[2ex] 1603 | \@@_cover_spread_box:nn { 4\ccwd } { 指导教师 }:& 1604 | \@@_cover_spread_box:nn { 4\ccwd } 1605 | { \l_@@_set_cnsupervisor_tl } 1606 | \hskip 1.5em \l_@@_set_cnrole_tl 1607 | \end{tabular} 1608 | \par \vspace{60\p@} \@@_font_semilarge: 1609 | \textsf { \int_use:N \c_sys_year_int } \kaishu 年 1610 | \textsf { \int_use:N \c_sys_month_int } \kaishu 月 1611 | \end{center} 1612 | } 1613 | \cs_new_protected_nopar:Nn \@@_maketitle_pg_auxiii: 1614 | { 1615 | \begin{center} 1616 | \vspace*{16\p@} 1617 | { 1618 | \bfseries \@@_font_semilarge: 1619 | Dissertation ~ Submitted ~ to ~ 1620 | Hangzhou ~ Dianzi ~ University\\[.8ex] 1621 | for ~ the ~ Degree ~ of ~ Master 1622 | } 1623 | \vspace*{120\p@} \par 1624 | \begin{spacing}{1.12} 1625 | \huge \bfseries \l_@@_set_entitle_tl 1626 | \end{spacing} 1627 | \vspace*{112\p@} \par 1628 | \begin{tabular}{*2{>{\bfseries\large}l}} 1629 | \@@_cover_spread_box:nn { 5em } {Candidate:~} & 1630 | \l_@@_set_enauthor_tl\\[3ex] 1631 | \@@_cover_spread_box:nn { 5em } {Supervisor:~} & 1632 | \l_@@_set_enrole_tl{} ~ \l_@@_set_ensupervisor_tl 1633 | \\[11ex] 1634 | \end{tabular} 1635 | \vspace*{8\p@}\par 1636 | \bfseries \large 1637 | \clist_item:Nn 1638 | \g_@@_month_clist { \int_use:N \c_sys_month_int },~ 1639 | \int_use:N \c_sys_year_int 1640 | \end{center} 1641 | } 1642 | % \end{macrocode} 1643 | % \end{macro} 1644 | % \begin{macro}{\commitment} 1645 | % 生成承诺书 1646 | % \begin{macrocode} 1647 | \NewDocumentCommand \commitment { O{} } 1648 | { 1649 | \cfoot {} 1650 | \newgeometry{margin = 2.75cm} 1651 | \titlepage 1652 | \@@_commitment_pg_aux:n {#1} 1653 | \endtitlepage 1654 | \restoregeometry 1655 | \cfoot {\small \thepage} 1656 | } 1657 | % \end{macrocode} 1658 | % \end{macro} 1659 | % \begin{macro}{\@@_commitment_pg_aux:n} 1660 | % \cs{commitment} 的辅助命令. 1661 | % \begin{macrocode} 1662 | \cs_new_protected_nopar:Npn \@@_commitment_pg_aux:n #1 1663 | { 1664 | \vspace*{-12\p@} 1665 | \begin{center} 1666 | \large 1667 | 杭州电子科技大学\\[1ex] 学位论文原创性声明和使用授权说明 1668 | \end{center} 1669 | \vspace*{20\p@} 1670 | \begin{center} 1671 | \@@_font_semilarge: 原创性声明 1672 | \end{center} 1673 | \par \vspace*{.4\baselineskip} 1674 | \begin{spacing}{1.65} 1675 | 本人郑重声明:所呈交的学位论文,是本人在导师的指导下, 1676 | 独立进行研究工作所取得的成果。除文中已经注明引用的内容外, 1677 | 本论文不含任何其他个人或集体已经发表或撰写过的作品或成果。 1678 | 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par 1679 | \noindent 申请学位论文与资料若有不实之处,本人承担一切相关责任。 1680 | \par \vspace*{1.25\baselineskip} 1681 | \noindent \makebox [ .45\linewidth ] [ l ] 1682 | { 1683 | 论文作者签名: 1684 | \@@_sign_process_aux:nnn {#1} { 1 } { 0 } 1685 | \tl_if_empty:NF \l_@@_sign_figure_tl 1686 | { 1687 | \@@_commitment_sign:N 1688 | \l_@@_sign_figure_tl 1689 | \tl_clear:N \l_@@_sign_figure_tl 1690 | } 1691 | } 1692 | 日期: 1693 | \makebox [ 2.5em ] [ l ] 1694 | { \@@_sign_process_aux:nnn {#1} { 1 } { 1 } } 年 1695 | \makebox [ 2em ] 1696 | { \@@_sign_process_aux:nnn {#1} { 1 } { 2 } } 月 1697 | \makebox [ 2em ] 1698 | { \@@_sign_process_aux:nnn {#1} { 1 } { 3 } } 日 1699 | \par\vspace*{20\p@} 1700 | \begin{center} 1701 | \@@_font_semilarge: 学位论文使用授权说明 1702 | \end{center} 1703 | \par \vspace*{.4\baselineskip} 1704 | 本人完全了解杭州电子科技大学关于保留和使用学位论文的规定, 1705 | 即:研究生在校攻读学位期间论文工作的知识产权单位属杭州电子科技大学。 1706 | 本人保证毕业离校后, 1707 | 发表论文或使用论文工作成果时署名单位仍然为杭州电子科技大学。 1708 | 学校有权保留送交论文的复印件,允许查阅和借阅论文; 1709 | 学校可以公布论文的全部或部分内容, 1710 | 可以允许采用影印、缩印或其它复制手段保存论文。 1711 | (保密论文在解密后遵守此规定) 1712 | \par \vspace*{1.25\baselineskip} 1713 | \noindent \makebox [.45\linewidth] [ l ] 1714 | { 1715 | 论文作者签名: 1716 | \@@_sign_process_aux:nnn {#1} { 2 } { 0 } 1717 | \tl_if_empty:NF \l_@@_sign_figure_tl 1718 | { 1719 | \@@_commitment_sign:N 1720 | \l_@@_sign_figure_tl 1721 | \tl_clear:N \l_@@_sign_figure_tl 1722 | } 1723 | } 1724 | 日期: 1725 | \makebox [ 2.5em ] [ l ] 1726 | { \@@_sign_process_aux:nnn {#1} { 2 } { 1 } } 年 1727 | \makebox [ 2em ] 1728 | { \@@_sign_process_aux:nnn {#1} { 2 } { 2 } } 月 1729 | \makebox [ 2em ] 1730 | { \@@_sign_process_aux:nnn {#1} { 2 } { 3 } } 日 1731 | \par \vspace*{\baselineskip} 1732 | \noindent \makebox [ .45\linewidth ] [ l ] 1733 | { 1734 | 指导教师签名: 1735 | \@@_sign_process_aux:nnn {#1} { 3 } { 0 } 1736 | \tl_if_empty:NF \l_@@_sign_figure_tl 1737 | { 1738 | \@@_commitment_sign:N 1739 | \l_@@_sign_figure_tl 1740 | \tl_clear:N \l_@@_sign_figure_tl 1741 | } 1742 | } 1743 | 日期: 1744 | \makebox [ 2.5em ] [ l ] 1745 | { \@@_sign_process_aux:nnn {#1} { 3 } { 1 } } 年 1746 | \makebox [ 2em ] 1747 | { \@@_sign_process_aux:nnn {#1} { 3 } { 2 } } 月 1748 | \makebox [ 2em ] 1749 | { \@@_sign_process_aux:nnn {#1} { 3 } { 3 } } 日 1750 | \end{spacing} 1751 | } 1752 | % \end{macrocode} 1753 | % \end{macro} 1754 | % \DescribeEnv{abstract} 1755 | % 重新定义摘要环境,加入中英文判断. 1756 | % \begin{macrocode} 1757 | \RenewDocumentEnvironment {abstract} { O{en} } 1758 | { 1759 | \str_if_eq:nnT {#1} {en} 1760 | { 1761 | \tl_set:Nn \l_@@_keywords_name_tl {Keywords:~} 1762 | \tl_set:Nn \l_@@_keywords_sep_tl {,~} 1763 | \@beginparpenalty \@lowpenalty 1764 | \chapter*{\normalfont\bfseries Abstract} 1765 | \addcontentsline{toc}{chapter}{\bfseries Abstract} 1766 | } 1767 | \str_if_eq:nnT {#1} {cn} 1768 | { 1769 | \tl_set:Nn \l_@@_keywords_name_tl {\textsf{关键词:}} 1770 | \tl_set:Nn \l_@@_keywords_sep_tl {,} 1771 | \@beginparpenalty \@lowpenalty 1772 | \chapter*{摘要} 1773 | \addcontentsline{toc}{chapter}{摘要} 1774 | } 1775 | } 1776 | { 1777 | \tl_clear:N \l_@@_abstract_title_tl 1778 | \clearpage 1779 | } 1780 | % \end{macrocode} 1781 | % \begin{variable}{\l_@@_keywords_clist} 1782 | % 存储关键词列表. 1783 | % \begin{macrocode} 1784 | \clist_new:N \l_@@_keywords_clist 1785 | % \end{macrocode} 1786 | % \end{variable} 1787 | % \begin{macro}{\keywords} 1788 | % 重新定义 \cs{keywords} 命令,关键词样式会根据 \env{abstract} 所选语言自动变化. 1789 | % \begin{macrocode} 1790 | \NewDocumentCommand \keywords { m } 1791 | { 1792 | \par \vspace*{\baselineskip} 1793 | \noindent\textbf{\l_@@_keywords_name_tl} 1794 | \clist_set:Nn \l_@@_keywords_clist {#1} 1795 | \clist_use:Nn \l_@@_keywords_clist { \l_@@_keywords_sep_tl } 1796 | } 1797 | % \end{macrocode} 1798 | % \end{macro} 1799 | % 设置目录样式. 1800 | % \begin{macrocode} 1801 | \RequirePackage{tocloft} 1802 | \renewcommand \contentsname {\hfill 目录 \hfill} 1803 | \renewcommand* \cfttoctitlefont{\sffamily\@@_font_semiLarge:} 1804 | \dim_set:Nn \cftbeforetoctitleskip {12pt} 1805 | \dim_set:Nn \cftaftertoctitleskip {24pt} 1806 | \dim_set:Nn \cftbeforechapskip {1pt} 1807 | \dim_set:Nn \cftbeforesecskip {-.2pt} 1808 | \patchcmd { \@dottedtocline } 1809 | { 1810 | \leaders 1811 | \hbox { $\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$ } 1812 | } 1813 | { 1814 | \kern 4pt \leaders 1815 | \hbox { $\m@th\mkern .4 mu\hbox{.}\mkern .4 mu$ } 1816 | } {}{} 1817 | \renewcommand* \l@chapter {\@dottedtocline{1}{0em}{1.6em}} 1818 | \renewcommand* \l@section {\@dottedtocline{1}{2.3em}{2.1em}} 1819 | \renewcommand* \@dotsep {1.7} 1820 | \renewcommand* \@pnumwidth {2.5ex} 1821 | \renewcommand* \cftchapfont {\normalfont} 1822 | \setcounter{tocdepth}{1} 1823 | % \end{macrocode} 1824 | % 使用 \cs{ctexset} 提供的接口设置章节样式. 1825 | % \begin{macrocode} 1826 | \ctexset 1827 | { 1828 | chapter = 1829 | { 1830 | aftername = \hspace{.5\ccwd}, fixskip = true, 1831 | beforeskip = 32pt, afterskip = 32pt, 1832 | format+ = \sffamily \@@_font_semiLarge:, 1833 | pagestyle = fancy 1834 | }, 1835 | section = 1836 | { 1837 | aftername = \hspace{.5\ccwd}, fixskip = true, 1838 | beforeskip = 2ex, afterskip = 2.75ex, 1839 | format = \sffamily \large 1840 | }, 1841 | subsection = 1842 | { 1843 | aftername = \hspace{.5\ccwd}, fixskip = true, 1844 | beforeskip = 2ex, afterskip = 2.75ex, 1845 | format = \sffamily \@@_font_semilarge: 1846 | } 1847 | } 1848 | % \end{macrocode} 1849 | % 1850 | % \begin{macrocode} 1851 | \makeatother \ExplSyntaxOff 1852 | % \end{macrocode} 1853 | % 1854 | % \begin{macrocode} 1855 | % 1856 | % \end{macrocode} 1857 | % 1858 | % \subsection{Beamer 主题的实现} 1859 | % 1860 | % \begin{macrocode} 1861 | %<*beamer> 1862 | % \end{macrocode} 1863 | % 1864 | % \begin{macrocode} 1865 | \ProvidesExplPackage{beamerthemehdu}{\hduthesis@date}{\hduthesis@version} 1866 | {hduThesiS ~ \text_titlecase:n {beamer} ~ Module} 1867 | % \end{macrocode} 1868 | % 1869 | % \begin{macrocode} 1870 | \mode 1871 | % \end{macrocode} 1872 | % 1873 | % \begin{macrocode} 1874 | \RequirePackage{tikz} 1875 | \usetikzlibrary{fadings} 1876 | % \end{macrocode} 1877 | % 插图相对路径设置. 1878 | % \begin{macrocode} 1879 | \graphicspath 1880 | { 1881 | {./figure/} {./image/} {./graphic/} {./picture/} 1882 | {./figures/} {./images/} {./graphics/} {./pictures/} 1883 | } 1884 | % \end{macrocode} 1885 | % \begin{variable} 1886 | % { 1887 | % \l_@@_set_title_tl, \l_@@_set_subtitle_tl, 1888 | % \l_@@_set_author_tl, \l_@@_set_date_tl, 1889 | % \l_@@_set_supervisor_tl, \l_@@_set_reference_tl, 1890 | % } 1891 | % 模式 \module{beamer} 下 \cs{hduset} 接口键值的定义. 1892 | % \begin{macrocode} 1893 | \keys_define:nn { beamer / hduset } 1894 | { 1895 | title .tl_set:N = \l_@@_set_title_tl, 1896 | subtitle .tl_set:N = \l_@@_set_subtitle_tl, 1897 | author .tl_set:N = \l_@@_set_author_tl, 1898 | date .tl_set:N = \l_@@_set_date_tl, 1899 | supervisor .tl_set:N = \l_@@_set_supervisor_tl, 1900 | bibsource .tl_set:N = \l_@@_set_bibsource_tl, 1901 | } 1902 | % \end{macrocode} 1903 | % \end{variable} 1904 | % \begin{macro}{\hduset} 1905 | % 模式 \module{beamer} 下设置文档信息. 1906 | % \begin{macrocode} 1907 | \NewDocumentCommand \hduset { m } 1908 | { 1909 | \keys_set:nn { beamer / hduset } { #1 } 1910 | \title { \large \l_@@_set_title_tl } 1911 | \tl_set:Nn \insertshorttitle { \textsc \l_@@_set_subtitle_tl } 1912 | \author [ \l_@@_set_author_tl ] 1913 | { 1914 | \l_@@_set_author_tl 1915 | \tl_if_empty:NF \l_@@_set_supervisor_tl 1916 | { 1917 | \texorpdfstring 1918 | { \\[2ex] 1919 | \small Supervised ~ by ~ \l_@@_set_supervisor_tl 1920 | } {} 1921 | } 1922 | } 1923 | \date { \l_@@_set_date_tl } 1924 | \tl_if_empty:NTF \l_@@_set_bibsource_tl 1925 | { 1926 | \newcommand* \printbibliography 1927 | { 1928 | \begin{frame}[t] 1929 | \frametitle{Bibliography} 1930 | \end{frame} 1931 | } 1932 | \newcounter {citecount} 1933 | \renewcommand*\cite[1] 1934 | { 1935 | \refstepcounter{citecount} 1936 | \textsuperscript{[\thecitecount]} 1937 | } 1938 | } 1939 | { 1940 | \RequirePackage [ natbib = true, sorting = none, backend = biber, 1941 | autocite = superscript, style = numeric-comp ] 1942 | { biblatex } 1943 | \addbibresource { \l_@@_set_reference_tl } 1944 | \let \@printbibliography \printbibliography 1945 | \renewcommand* \printbibliography 1946 | { 1947 | \begin{frame}[t, allowframebreaks]{Bibliography} 1948 | \small 1949 | \@printbibliography 1950 | \end{frame} 1951 | } 1952 | } 1953 | } 1954 | % \end{macrocode} 1955 | % \end{macro} 1956 | % |Beamer| 背景 \& 标头设置. 1957 | % \begin{macrocode} 1958 | \usebackgroundtemplate 1959 | { 1960 | \tikz [ remember~picture, overlay ] 1961 | \node [ inner~sep = 0pt, outer~sep = auto, 1962 | opacity = .1, xshift = -2em 1963 | ] at (current~page.east) 1964 | { \includegraphics [ height = .75\paperheight ] { hdu-logo.pdf } }; 1965 | } 1966 | \titlegraphic 1967 | { 1968 | \tikz [ remember~picture, overlay ] 1969 | \node [ below~right, yshift = -1em ] at (current~page.north~west) 1970 | { \includegraphics [ width = 2\textwidth/7 ]{ hdu-badge.pdf } }; 1971 | } 1972 | % \end{macrocode} 1973 | % |Beamer| 原生主题调用. 1974 | % \begin{macrocode} 1975 | \useoutertheme{infolines} 1976 | \useinnertheme[shadow = false]{rounded} 1977 | \definecolor{hdu}{HTML}{163479} 1978 | \definecolor{hduRed}{HTML}{BF6236} 1979 | \usecolortheme[named = hdu]{structure} 1980 | \setbeamercolor*{palette~primary} 1981 | { 1982 | use = structure, fg = black, 1983 | bg = structure.fg!30!white 1984 | } 1985 | \setbeamercolor*{palette~secondary} 1986 | { 1987 | use = structure, fg = white, 1988 | bg = structure.fg!60!white 1989 | } 1990 | \setbeamercolor*{palette~tertiary} 1991 | { 1992 | use = structure, fg = white, 1993 | bg = structure.fg!90!white 1994 | } 1995 | \setbeamercolor{block~title} 1996 | { 1997 | use = structure, fg = structure.fg, 1998 | bg = structure.fg!20!bg 1999 | } 2000 | \setbeamercolor{block~body} 2001 | { 2002 | use = block~title, parent = normal~text, 2003 | bg = block~title.bg!50!bg 2004 | } 2005 | \addtobeamertemplate{block~begin} 2006 | {\pgfsetfillopacity{0.8}}{\pgfsetfillopacity{1}} 2007 | \setbeamercolor{block~title~alerted} 2008 | { 2009 | use = alerted~text, fg = alerted~text.fg, 2010 | bg = alerted~text.fg!20!bg 2011 | } 2012 | \setbeamercolor{block~body~alerted} 2013 | { 2014 | use = block~title~alerted, parent = normal~text, 2015 | bg = block~title~alerted.bg!50!bg 2016 | } 2017 | \addtobeamertemplate{block~alerted~begin} 2018 | {\pgfsetfillopacity{0.8}}{\pgfsetfillopacity{1}} 2019 | \setbeamercolor{block~title~example} 2020 | { 2021 | use = example~text,fg = example~text.fg, 2022 | bg = example~text.fg!20!bg 2023 | } 2024 | \setbeamercolor{block~body~example} 2025 | { 2026 | use = block~title~example, parent=normal~text, 2027 | bg = block~title~example.bg!50!bg 2028 | } 2029 | \addtobeamertemplate{block~example~begin} 2030 | {\pgfsetfillopacity{0.8}}{\pgfsetfillopacity{1}} 2031 | \setbeamercolor{title}{parent=author~in~head/foot} 2032 | \setbeamertemplate{title~page}[default][colsep=-4bp,rounded=true] 2033 | \usesubitemizeitemtemplate 2034 | {\tiny\raise1.5pt\hbox{\color{beamerstructure}$\blacktriangleright$}} 2035 | \usesubsubitemizeitemtemplate 2036 | { \tiny\raise1.5pt\hbox{\color{beamerstructure}$\bigstar$} } 2037 | % \end{macrocode} 2038 | % |Beamer| 顶部进度条配置. 2039 | % \begin{macrocode} 2040 | \addtobeamertemplate{headline}{} 2041 | { 2042 | \tikz [ remember~picture, overlay ] 2043 | { 2044 | \filldraw [hduRed, ultra~thick, line~cap = butt] 2045 | (0,0) --++ 2046 | (\insertpagenumber\paperwidth/\insertdocumentendpage,0); 2047 | \draw [white, very~thick, yshift = -.6pt] (0,0) --++ 2048 | (\paperwidth,0); 2049 | } 2050 | } 2051 | % \end{macrocode} 2052 | % |Beamer| 章节封面设置. 2053 | % \begin{macrocode} 2054 | \AtBeginSection[] 2055 | { 2056 | \begin{frame} 2057 | \tikz [ remember~picture, overlay ] 2058 | \node [ below~right, yshift = -1em ] at (current~page.north~west) 2059 | { \includegraphics [ width = 2\textwidth/7 ]{ hdu-badge.pdf } }; 2060 | \vfill 2061 | \usebeamerfont{title} \insertsectionhead \par 2062 | \tikz 2063 | { 2064 | \draw [line~cap = round, hdu!20, ultra~thick] 2065 | (0,0) --++ (2\linewidth/3,0); 2066 | \filldraw 2067 | [ line~cap = round, hdu!60, ultra~thick, path~fading = west 2068 | ] (0,0) --++ 2069 | (\insertpagenumber\linewidth/\insertdocumentendpage * 2/3,0); 2070 | } 2071 | \vfill 2072 | \end{frame} 2073 | } 2074 | % \end{macrocode} 2075 | % 公式排版必要宏包加载. 2076 | % \begin{macrocode} 2077 | % math settings 2078 | \numberwithin{equation}{section} 2079 | \RequirePackage { keytheorems, amssymb, mathtools, physics2, 2080 | fixdif, derivative, cancel, siunitx, nicematrix } 2081 | \renewcommand* \qedsymbol {$\color{gray}\blacksquare$} 2082 | \usephysicsmodule{ ab, braket, op.legacy } 2083 | % \end{macrocode} 2084 | % 浮动体设置. 2085 | % \begin{macrocode} 2086 | % Figure settings 2087 | \RequirePackage [ labelsep = period, figurename = \textsc{Fig}, 2088 | font = footnotesize ] {caption} 2089 | \RequirePackage {subcaption, booktabs, anyfontsize, ragged2e} 2090 | \captionsetup{belowskip=0pt} 2091 | \captionsetup[sub]{font = scriptsize} 2092 | \justifying 2093 | \AtBeginEnvironment{columns}{\vspace*{-.5ex}} 2094 | % \end{macrocode} 2095 | % 2096 | % \begin{macrocode} 2097 | \mode 2098 | % \end{macrocode} 2099 | % 2100 | % \begin{macrocode} 2101 | % 2102 | % \end{macrocode} 2103 | % 2104 | % \subsection{\module{stationery} 模块的实现} 2105 | % 2106 | % \begin{macrocode} 2107 | %<*stationery> 2108 | % \end{macrocode} 2109 | % 2110 | % \begin{macrocode} 2111 | \@@_provide_module:n {stationery} 2112 | % \end{macrocode} 2113 | % 2114 | % \begin{macro} 2115 | % { 2116 | % \g_@@_set_watermark_bool, 2117 | % \l_@@_set_title_tl, \l_@@_set_author_tl, 2118 | % \l_@@_set_mail_tl, \l_@@_set_date_tl 2119 | % } 2120 | % 模式 \module{stationery} 下 \cs{hduset} 接口键值的定义. 2121 | % \begin{macrocode} 2122 | \keys_define:nn { stationery / hduset } 2123 | { 2124 | watermark .bool_set:N = \g_@@_set_watermark_bool, 2125 | watermark .initial:n = false, 2126 | watermark .default:n = true, 2127 | title .tl_set:N = \l_@@_set_title_tl, 2128 | author .tl_set:N = \l_@@_set_author_tl, 2129 | mail .tl_set:N = \l_@@_set_mail_tl, 2130 | date .tl_set:N = \l_@@_set_date_tl 2131 | } 2132 | % \end{macrocode} 2133 | % \end{macro} 2134 | % \begin{macrocode} 2135 | \RequirePackage{ hyperref, geometry, tikz, 2136 | tikzpagenodes, twemojis, fancyhdr } 2137 | \hypersetup{hidelinks} 2138 | \urlstyle{same} 2139 | % \end{macrocode} 2140 | % \begin{macro}{\hduset} 2141 | % 模式 \module{beamer} 下设置文档信息. 2142 | % \begin{macrocode} 2143 | \NewDocumentCommand \hduset { m } 2144 | { 2145 | \tl_clear:N \l_@@_set_author_tl 2146 | \tl_clear:N \l_@@_set_mail_tl 2147 | \keys_set:nn { stationery / hduset } {#1} 2148 | \hypersetup 2149 | { 2150 | pdftitle = Hangzhou Dianzi University, 2151 | pdfsubject = \l_@@_set_title_tl, 2152 | pdfauthor = \l_@@_set_author_tl 2153 | } 2154 | } 2155 | % \end{macrocode} 2156 | % \end{macro} 2157 | % 设置页面布局、页眉页脚格式. 2158 | % \begin{macrocode} 2159 | \geometry 2160 | { hmargin = .8in, top = 1.95in, bottom = .75in, 2161 | headheight = 1.2in, headsep = .3in, footskip = .3in } 2162 | \linespread{1.25} 2163 | \RequirePackage [ skip = \baselineskip ] { parskip } 2164 | \renewcommand* \familydefault { \sfdefault } 2165 | \definecolor{hdu}{HTML}{163479} 2166 | 2167 | \renewcommand* \headrulewidth {2pt} 2168 | \renewcommand* \footrulewidth {2pt} 2169 | \hook_gput_code:nnn { cmd/headrule/before } { . } { \color{hdu!80} } 2170 | \hook_gput_code:nnn { cmd/footrule/before } { . } { \color{hdu!80} } 2171 | \lhead 2172 | { {}~ 2173 | \minipage{.6\linewidth} 2174 | \medskip \leavevmode \lower -.111in 2175 | \hbox { \includegraphics [ height = .75in ] {hdu-badge} } 2176 | \endminipage \medskip \hfill 2177 | \minipage{.36\linewidth} 2178 | \medskip \vbox 2179 | { 2180 | \linespread{1.2} 2181 | \raggedright \small \color{hdu} 2182 | \texttwemoji{1f4cd} ~ 1158 ~ No.2 ~ St., ~ Hangzhou, ~ 310018\\ 2183 | \texttwemoji{1f4de} ~ (86) ~ 0571-86915072\\ 2184 | \texttwemoji{1f310} ~ \url{www.hdu.edu.cn} 2185 | } \medskip 2186 | \endminipage 2187 | } 2188 | \lfoot 2189 | { 2190 | \small{} ~ \texttwemoji{1f4cd} ~ 2191 | 1158 ~ No.2~Street, ~ Qiantang ~District, ~ 2192 | Hangzhou, ~ Zhejiang ~ Province, ~ 310018, ~ P.R.China 2193 | } 2194 | \cfoot {} 2195 | \rfoot { \small \texttwemoji{1f310} ~ \url{www.hdu.edu.cn} ~ } 2196 | \pagestyle{fancy} 2197 | % \end{macrocode} 2198 | % \begin{macro}{\maketitle} 2199 | % 重新定义标题布局,当未给定 \key*{author} 和 \key*{mail} 时,不输出 |From|. 2200 | % \begin{macrocode} 2201 | \renewcommand* \maketitle 2202 | { 2203 | \group_begin: \small 2204 | \bool_lazy_or:nnT 2205 | { !\tl_if_empty_p:N \l_@@_set_author_tl } 2206 | { !\tl_if_empty_p:N \l_@@_set_mail_tl } 2207 | { \makebox [ 4em ] [ l ] { \scshape From } } 2208 | \tl_if_empty:NTF \l_@@_set_author_tl 2209 | { \@latex@warning@no@line {No \noexpand \author given} } 2210 | { \l_@@_set_author_tl{} ~ } 2211 | \tl_if_empty:NF \l_@@_set_mail_tl 2212 | { \texttt { <\l_@@_set_mail_tl> } } 2213 | \bool_lazy_or:nnT 2214 | { !\tl_if_empty_p:N \l_@@_set_author_tl } 2215 | { !\tl_if_empty_p:N \l_@@_set_mail_tl } { \\ } 2216 | \makebox [ 4em ] [ l ] { \scshape Date } 2217 | \tl_if_empty:NTF \l_@@_set_date_tl \today \l_@@_set_date_tl \\ 2218 | \tl_if_empty:NTF \l_@@_set_title_tl 2219 | { \@latex@error {No \noexpand \title given}\@ehc } 2220 | { 2221 | \makebox [ 4em ] [ l ] { \scshape Subject } 2222 | \l_@@_set_title_tl 2223 | } 2224 | \par \vspace{.5\baselineskip} 2225 | \group_end: 2226 | } 2227 | % \end{macrocode} 2228 | % \end{macro} 2229 | % 水印设置. 2230 | % \begin{macrocode} 2231 | \AtBeginDocument { \color_select:n {black!80} } 2232 | \DeclareHookRule { shipout / background } { hduthesis / stationery } 2233 | { before } { pgfrcs } 2234 | \AddToHook { shipout / background } [ hduthesis / stationery ] 2235 | { 2236 | \bool_if:NT \g_@@_set_watermark_bool 2237 | { 2238 | \tikz [ remember~picture, overlay ] 2239 | \node [ opacity = .2 ] at (current~page) 2240 | { \includegraphics [ width = .4\linewidth ] {hdu-logo} }; 2241 | } 2242 | } 2243 | % \end{macrocode} 2244 | % \begin{macro}{\notelines} 2245 | % 用于添加笔记线. 2246 | % \begin{macrocode} 2247 | \NewDocumentCommand \notelines {O{20}} 2248 | { 2249 | \tikz [ remember~picture, overlay ] 2250 | { 2251 | \int_step_inline:nn { #1 - 1 } 2252 | { 2253 | \draw [ hdu, very~thick, opacity = .6 ] 2254 | ([ 2255 | yshift = -##1 * (\textheight + .6in - 15.87pt ) / #1 2256 | + .3in 2257 | ]current~page~text~area.north~west 2258 | ) --++ (\linewidth, 0); 2259 | } 2260 | } 2261 | } 2262 | % \end{macrocode} 2263 | % \end{macro} 2264 | % 2265 | % \begin{macrocode} 2266 | % 2267 | % \end{macrocode} 2268 | % 2269 | % \subsection{\module{exam} 模块的实现} 2270 | % 2271 | % \begin{macrocode} 2272 | %<*exam> 2273 | % \end{macrocode} 2274 | % 2275 | % \begin{macrocode} 2276 | \@@_provide_module:n {exam} 2277 | \keys_define:nn { hduthesis / exam } 2278 | { 2279 | watermark .tl_set:N = \l_@@_exam_watermark_tl, 2280 | } 2281 | \NewDocumentCommand \hdutexset {m} { \keys_set:nn { hduthesis / exam } {#1} } 2282 | \DeclareHookRule { shipout / background } 2283 | { hduthesis / exam } { before } { pgfrcs } 2284 | \AddToHook { shipout / background } [ hduthesis / exam ] 2285 | { 2286 | \tl_if_empty:NF \l_@@_exam_watermark_tl 2287 | { 2288 | \tikz [ remember~picture, overlay ] 2289 | \node [ opacity = .2 ] at (current~page) 2290 | { 2291 | \includegraphics [ width = \linewidth ] 2292 | { \l_@@_exam_watermark_tl } 2293 | }; 2294 | } 2295 | } 2296 | \RequirePackage 2297 | { 2298 | geometry, mathtools, array, bm, esint, keytheorems, 2299 | siunitx, fixdif, derivative, physics2, tasks, anyfontsize 2300 | } 2301 | \RequirePackage[inline]{enumitem} 2302 | \RequirePackage{fontawesome5, fancyqr, circuitikz} 2303 | \hook_gput_code:nnn { cmd/faIcon/before } { . } 2304 | { 2305 | \group_begin: 2306 | \fontsize { \fp_eval:n { .9 * \f@size } } { 0 } \selectfont 2307 | } 2308 | \hook_gput_code:nnn { cmd/faIcon/after } { . } { \group_end: } 2309 | \geometry{margin = 1in} 2310 | \RequirePackage[svgnames]{xcolor} 2311 | \newkeytheorem{note} 2312 | [ style = remark, numbered = false, 2313 | name = \color{DarkRed}\sffamily \faIcon{info-circle}~Tip. ] 2314 | \newkeytheorem{problem} 2315 | [ style = definition, 2316 | name = \color{DarkGreen}\sffamily \faIcon{pen-square}~Problem ] 2317 | \newkeytheorem{solution} 2318 | [ style = definition, numbered = false, 2319 | name = \color{MidnightBlue}\sffamily \faIcon{check-square}~Solution ] 2320 | \usephysicsmodule{ab, op.legacy} 2321 | \settasks { label = \sffamily\Alph*., item-indent = 2.5em, label-offset = .5pt } 2322 | \newcommand \true {\addtocounter{task}{1}\faIcon{check-circle}} 2323 | \def \@result#1 {\underline{~#1~}} 2324 | \def \s@result {\textsf{【\qquad 】}} 2325 | \DeclareRobustCommand \result {\@ifstar\s@result\@result} 2326 | \keys_define:nn { textfig } 2327 | { 2328 | ratio .tl_set:N = \l_@@_textfig_ratio_tl, 2329 | ratio .initial:n = 7 \c_colon_str 2, 2330 | position .tl_set:N = \l_@@_textfig_position_tl, 2331 | position .initial:n = c, 2332 | unknown .code:n = \tl_if_novalue:nF {#1} 2333 | { \tl_set_eq:NN \l_@@_textfig_position_tl \l_keys_key_tl } 2334 | } 2335 | \NewDocumentEnvironment{textfig}{ O{} } 2336 | { 2337 | \group_begin: 2338 | \keys_set:nn { textfig } {#1} 2339 | \seq_set_split:Nee \l_@@_textfig_ratio_seq { \c_colon_str } 2340 | { \l_@@_textfig_ratio_tl } 2341 | \noindent 2342 | \minipage [ \l_@@_textfig_position_tl ] 2343 | { 2344 | \fp_eval:n 2345 | { 2346 | .96*\seq_item:Nn \l_@@_textfig_ratio_seq {1}/ 2347 | ( 2348 | \seq_item:Nn \l_@@_textfig_ratio_seq {1} + 2349 | \seq_item:Nn \l_@@_textfig_ratio_seq {2} 2350 | ) 2351 | }\dimexpr \linewidth 2352 | } 2353 | } 2354 | { 2355 | \endminipage 2356 | \vspace{4.5pt plus 1.5pt minus 1.5pt} \par 2357 | \group_end: 2358 | } 2359 | \NewDocumentCommand \textfigsplit {} 2360 | { 2361 | \endminipage 2362 | \hspace{.02\linewidth} 2363 | \minipage [ \l_@@_textfig_position_tl ] 2364 | { 2365 | \fp_eval:n 2366 | { 2367 | .96*\seq_item:Nn \l_@@_textfig_ratio_seq {2}/ 2368 | ( 2369 | \seq_item:Nn \l_@@_textfig_ratio_seq {1} + 2370 | \seq_item:Nn \l_@@_textfig_ratio_seq {2} 2371 | ) 2372 | }\dimexpr \linewidth 2373 | } 2374 | } 2375 | 2376 | \makeatother \ExplSyntaxOff 2377 | \usetikzlibrary{ fadings, patterns, arrows, decorations.markings } 2378 | \tikzset 2379 | { 2380 | > = stealth', 2381 | every picture/.append style = 2382 | { line join = round, line cap = round, thick } 2383 | } 2384 | % \end{macrocode} 2385 | % 2386 | % \begin{macrocode} 2387 | % 2388 | % \end{macrocode} 2389 | % 2390 | % \subsection{\module{l3doc} 模块的实现} 2391 | % 2392 | % \begin{macrocode} 2393 | %<*l3doc> 2394 | % \end{macrocode} 2395 | % 2396 | % \begin{macrocode} 2397 | \@@_provide_module:n {l3doc} 2398 | % \end{macrocode} 2399 | % 定义常用强调命令. 2400 | % \begin{macrocode} 2401 | \providecommand \module \texttt 2402 | \RenewDocumentCommand \pkg {m} 2403 | { \href{https://ctan.org/pkg/#1}{\textsf{#1}} } 2404 | \RenewDocumentCommand \cls {m} 2405 | { \href{https://ctan.org/pkg/#1}{\textsf{#1}} } 2406 | \NewDocumentCommand \mailto {m} { \texttt{<\href{mailto:#1}{#1}>} } 2407 | \def \@key #1 2408 | { \textcolor{red}{\textbf{\texttt{#1}}} ~ \normalfont \texttt{=} ~ } 2409 | \def \s@key #1{\textcolor{red}{\textbf{\texttt{#1}}}} 2410 | \DeclareRobustCommand \key {\@ifstar\s@key\@key} 2411 | % \end{macrocode} 2412 | % 用于输入键值对. 2413 | % \begin{macrocode} 2414 | \def \val #1{\meta{\textup{#1}}} 2415 | \def \TFF {true\textbar \textbf{false}} 2416 | \def \TTF {\textbf{true}\textbar false} 2417 | \newlist{keyval}{itemize}{10} 2418 | \setlist[keyval]{leftmargin = 0pt, labelsep = 0pt} 2419 | % \end{macrocode} 2420 | % 配置 \pkg{hyperref},调用所需宏包. 2421 | % \begin{macrocode} 2422 | \RequirePackage{ hyperref } 2423 | \RequirePackage [ svgnames ] { xcolor } 2424 | \hypersetup 2425 | { 2426 | filecolor = DarkGreen, urlcolor = MidnightBlue, 2427 | linkcolor = FireBrick 2428 | } 2429 | \ExplSyntaxOff 2430 | \pdfstringdefDisableCommands 2431 | { 2432 | \def \file #1 { <#1> } \def \pkg #1 { <#1> } 2433 | \def \cls #1 { <#1> } \def \mailto #1 { <#1> } 2434 | } 2435 | \RequirePackage{tikz} 2436 | \usetikzlibrary{calc} 2437 | \ExplSyntaxOn 2438 | \RequirePackage [ pass ] { geometry } 2439 | \RequirePackage { enumitem, dirtree, tabularx, 2440 | tasks, pdfpages, subcaption } 2441 | \graphicspath { {} } 2442 | \RequirePackage[fontset = fandol]{ctex} \linespread{1.4} 2443 | \dim_set:Nn \parindent {0pt} 2444 | \hook_gput_code:nnn { env/function/before } { . } 2445 | { \vspace*{-.6\baselineskip} } 2446 | \hook_gput_code:nnn { env/syntax/after } { . } 2447 | { \par\vspace*{.1\baselineskip} } 2448 | % \end{macrocode} 2449 | % 定义新的 \pkg{hologo} 标志. 2450 | % \begin{macrocode} 2451 | \def \HoLogo@ApTeX #1{\HOLOGO@mbox {Ap\kern -.1667em\TeX}} 2452 | \def \HoLogo@hduThesiS #1 2453 | { 2454 | \raisebox{-.5pt} 2455 | { 2456 | \HOLOGO@mbox 2457 | { 2458 | \tikz [ baseline = (hduthesis.base) ] 2459 | { 2460 | \node [ inner~sep = 0pt ] (hduthesis) 2461 | {\sffamily\scshape hduThesi\scalebox{1.2}[1.2]{S}}; 2462 | \draw let \p1 = (hduthesis.west), 2463 | \p2 = (hduthesis.east) in (\x1,\y1) (\x2,\y2) 2464 | [ line~width = {.028pt * (\x2 - \x1)} ] 2465 | ([yshift = -.5ex]hduthesis.north~west) 2466 | to [ bend~right = 5 ] 2467 | ([yshift = .25ex]hduthesis.north~east); 2468 | } 2469 | } 2470 | } 2471 | } 2472 | \def \HoLogo@hduthesis #1 2473 | { \raisebox{-.5pt} { \HOLOGO@mbox { \scshape \cls{hduThesiS} } } } 2474 | % \end{macrocode} 2475 | % 重新定义封面布局. 2476 | % \begin{macrocode} 2477 | \let \old@maketitle \maketitle 2478 | \RenewDocumentCommand \maketitle {} 2479 | { 2480 | \newgeometry { margin = 1.2in } 2481 | \titlepage 2482 | \old@maketitle 2483 | \begin{center} 2484 | \tikz 2485 | { 2486 | \node [ opacity = .8 ] 2487 | { 2488 | \includegraphics [ width = .14\paperwidth ] 2489 | { hdu-motto.pdf } 2490 | }; 2491 | \node [ opacity = .3 ] 2492 | { 2493 | \includegraphics [ width = .21\paperwidth ] 2494 | { hdu-logo.pdf } 2495 | }; 2496 | } 2497 | \end{center} 2498 | \thispagestyle{empty} 2499 | } 2500 | \hook_gput_code:nnn { cmd/tableofcontents/before } { . } 2501 | { \clearpage } 2502 | \hook_gput_code:nnn { cmd/tableofcontents/after } { . } 2503 | { \endtitlepage \restoregeometry } 2504 | \date{ 2505 | Released ~ \hduthesis@date \quad \texttt{v\hduthesis@version} 2506 | \footnote{ 2507 | \url{https://github.com/\hduthesis@maintainerid/hduthesis}, ~ 2508 | \url{https://gitee.com/\hduthesis@maintainerid/hduthesis} 2509 | } 2510 | } 2511 | % \end{macrocode} 2512 | % 2513 | % \begin{macrocode} 2514 | % 2515 | % \end{macrocode} 2516 | % 2517 | % \end{implementation} 2518 | % \clearpage 2519 | % \PrintIndex -------------------------------------------------------------------------------- /source/hduthesis.ins: -------------------------------------------------------------------------------- 1 | \iffalse meta-comment 2 | 3 | File: hduthesis.ins 4 | ----------------------------------------------------------------------- 5 | Copyright (C) 2023-2025 by Mingyu Xia * 6 | * 7 | It may be distributed and/or modified under the conditions of the * 8 | LaTeX Project Public License (LPPL), either version 1.3c of this * 9 | license or (at your option) any later version. The latest version * 10 | of this license is in the file * 11 | * 12 | http://www.latex-project.org/lppl.txt * 13 | * 14 | This work has the LPPL maintenance status `maintained'. * 15 | * 16 | The Current Maintainer of this work is Mingyu Xia. * 17 | * 18 | This work consists of the files hduthesis.dtx, * 19 | hdu-graphics.dtx, * 20 | and hduthesis.ins, * 21 | and the derived files hduthesis.cls, * 22 | hdu-.code.tex, * 23 | beamerthemehdu.sty, * 24 | hdu-logo.pdf, * 25 | hdu-title.pdf, * 26 | hdu-badge.pdf, * 27 | hdu-motto.pdf, * 28 | hduthesis.pdf, * 29 | hdu-graphics.pdf, * 30 | and README.md. * 31 | ----------------------------------------------------------------------- 32 | 33 | Any modification of this file should ensure that the copyright and 34 | license information is placed in the derived files. 35 | 36 | ----------------------------------------------------------------------- 37 | 38 | \fi 39 | 40 | \input docstrip % 41 | \askforoverwritefalse 42 | 43 | \preamble 44 | ----------------------------------------------------------------------- 45 | Copyright (C) 2023-2025 by Mingyu Xia * 46 | * 47 | It may be distributed and/or modified under the conditions of the * 48 | LaTeX Project Public License (LPPL), either version 1.3c of this * 49 | license or (at your option) any later version. The latest version * 50 | of this license is in the file * 51 | * 52 | http://www.latex-project.org/lppl.txt * 53 | * 54 | This work has the LPPL maintenance status `maintained'. * 55 | * 56 | The Current Maintainer of this work is Mingyu Xia. * 57 | ----------------------------------------------------------------------- 58 | \endpreamble 59 | 60 | \postamble 61 | ----------------------------------------------------------------------- 62 | This work consists of the files hduthesis.dtx, * 63 | hdu-graphics.dtx, * 64 | and hduthesis.ins, * 65 | and the derived files hduthesis.cls, * 66 | hdu-.code.tex, * 67 | beamerthemehdu.sty, * 68 | hdu-logo.pdf, * 69 | hdu-title.pdf, * 70 | hdu-badge.pdf, * 71 | hdu-motto.pdf, * 72 | hduthesis.pdf, * 73 | hdu-graphics.pdf, * 74 | and README.md. * 75 | ----------------------------------------------------------------------- 76 | \endpostamble 77 | 78 | \keepsilent 79 | 80 | \generate{ 81 | \usedir{tex/latex/hduthesis} 82 | \file{hduthesis.cls} {\from{hduthesis.dtx}{class} } 83 | \file{hdu-typeset.code.tex} {\from{hduthesis.dtx}{typeset} } 84 | \file{hdu-layout.code.tex} {\from{hduthesis.dtx}{layout} } 85 | \file{hdu-bc.config.code.tex} {\from{hduthesis.dtx}{bc.config} } 86 | \file{hdu-pg.config.code.tex} {\from{hduthesis.dtx}{pg.config} } 87 | \file{hdu-stationery.code.tex} {\from{hduthesis.dtx}{stationery} } 88 | \file{hdu-exam.code.tex} {\from{hduthesis.dtx}{exam} } 89 | \file{hdu-l3doc.code.tex} {\from{hduthesis.dtx}{l3doc} } 90 | \file{beamerthemehdu.sty} {\from{hduthesis.dtx}{beamer} } 91 | \nopreamble \nopostamble \let \MetaPrefix \perCent 92 | \file{hdu-logo.pdf} {\from{hdu-graphics.dtx}{hdu-logo} } 93 | \file{hdu-title.pdf} {\from{hdu-graphics.dtx}{hdu-title}} 94 | \file{hdu-badge.pdf} {\from{hdu-graphics.dtx}{hdu-badge}} 95 | \file{hdu-motto.pdf} {\from{hdu-graphics.dtx}{hdu-motto}} 96 | \usedir{doc/latex/hduthesis} 97 | \file{README.md} {\from{hduthesis.dtx}{readme} } 98 | } 99 | 100 | \endbatchfile 101 | \endinput 102 | %% 103 | %% End of file `hduthesis.ins' 104 | --------------------------------------------------------------------------------