Debian Codegraph @

texmf-dist/doc/latex/hitszthesis/dtx-style.sty

raw
1 %%
2 %% This is file `dtx-style.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% hitszthesis.dtx (with options: `dtx-style')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 2019-2021 by Jingxuan Yang <[email protected]>
12 %%
13 %% This file may be distributed and/or modified under the
14 %% conditions of the LaTeX Project Public License, either version 1.3a
15 %% of this license or (at your option) any later version.
16 %% The latest version of this license is in:
17 %%
18 %% http://www.latex-project.org/lppl.txt
19 %%
20 %% and version 1.3a or later is part of all distributions of LaTeX
21 %% version 2004/10/01 or later.
22 %%
23 %% To produce the documentation run the original source files ending with `.dtx'
24 %% through LaTeX.
25 %%
26 \ProvidesPackage{dtx-style}
27 \RequirePackage{hypdoc}
28 \RequirePackage[UTF8,scheme=chinese,fontset=windowsnew]{ctex}
29 \RequirePackage{newpxtext}
30 \RequirePackage{newpxmath}
31 \RequirePackage[
32 top=2.5cm, bottom=2.5cm,
33 left=4cm, right=2cm,
34 headsep=8mm]{geometry}
35 \RequirePackage{array,longtable,booktabs}
36 \RequirePackage{listings}
37 \RequirePackage{fancyhdr}
38 \RequirePackage{xcolor}
39 \RequirePackage{enumitem}
40 \RequirePackage{etoolbox}
41 \RequirePackage{metalogo}
42 \RequirePackage{hyperref}
43
44 \colorlet{hitsz@macro}{blue!60!black}
45 \colorlet{hitsz@env}{blue!70!black}
46 \colorlet{hitsz@option}{purple}
47 \patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{hitsz@macro}}{}{}
48 \patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{hitsz@macro}}{}{}
49 \patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{hitsz@env}}{}{}
50 \patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{hitsz@env}}{}{}
51
52 \def\DescribeOption{%
53 \leavevmode\@bsphack\begingroup\MakePrivateLetters%
54 \Describe@Option}
55 \def\Describe@Option#1{\endgroup
56 \marginpar{\raggedleft\PrintDescribeOption{#1}}%
57 \hitsz@special@index{option}{#1}\@esphack\ignorespaces}
58 \def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{hitsz@option} #1\ }
59 \def\hitsz@special@index#1#2{\@bsphack
60 \begingroup
61 \HD@target
62 \let\HDorg@encapchar\encapchar
63 \edef\encapchar usage{%
64 \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
65 }%
66 \index{#2\actualchar{\string\ttfamily\space#2}
67 (#1)\encapchar usage}%
68 \index{#1:\levelchar#2\actualchar
69 {\string\ttfamily\space#2}\encapchar usage}%
70 \endgroup
71 \@esphack}
72
73 \lstdefinestyle{lstStyleBase}{%
74 basicstyle=\small\ttfamily,
75 aboveskip=\medskipamount,
76 belowskip=\medskipamount,
77 lineskip=0pt,
78 boxpos=c,
79 showlines=false,
80 extendedchars=true,
81 upquote=true,
82 tabsize=2,
83 showtabs=false,
84 showspaces=false,
85 showstringspaces=false,
86 numbers=none,
87 linewidth=\linewidth,
88 xleftmargin=4pt,
89 xrightmargin=0pt,
90 resetmargins=false,
91 breaklines=true,
92 breakatwhitespace=false,
93 breakindent=0pt,
94 breakautoindent=true,
95 columns=flexible,
96 keepspaces=true,
97 gobble=2,
98 framesep=3pt,
99 rulesep=1pt,
100 framerule=1pt,
101 backgroundcolor=\color{gray!5},
102 stringstyle=\color{green!40!black!100},
103 keywordstyle=\bfseries\color{blue!50!black},
104 commentstyle=\slshape\color{black!60}}
105
106 \lstdefinestyle{lstStyleShell}{%
107 style=lstStyleBase,
108 frame=l,
109 rulecolor=\color{purple},
110 language=bash}
111
112 \definecolor{hitcolor}{RGB}{21,95,130}
113 \lstdefinestyle{lstStyleLaTeX}{%
114 style=lstStyleBase,
115 frame=l,
116 rulecolor=\color{hitcolor},
117 language=[LaTeX]TeX}
118
119 \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{}
120 \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{}
121
122 \setlist{nosep}
123
124 \DeclareDocumentCommand{\option}{m}{\textsf{#1}}
125 \DeclareDocumentCommand{\env}{m}{\texttt{#1}}
126 \DeclareDocumentCommand{\pkg}{s m}{%
127 \texttt{#2}\IfBooleanF#1{\hitsz@special@index{package}{#2}}}
128 \DeclareDocumentCommand{\file}{s m}{%
129 \texttt{#2}\IfBooleanF#1{\hitsz@special@index{file}{#2}}}
130 \newcommand{\myentry}[1]{%
131 \marginpar{\small\raggedleft\color{purple}\bfseries\strut #1}}
132 \newcommand{\note}[2][Note]{{%
133 \color{magenta}{\bfseries #1}\emph{#2}}}
134 \newcommand{\pozhehao}{——}
135 \def\hitszthesis{\textsc{Hitsz}\-\textsc{Thesis}}
136 \def\hitsz{哈尔滨工业大学(深圳)}
137 \def\PGR{\href{http://hitgs.hit.edu.cn/aa/fd/c3425a109309/page.htm}
138 {《\hitsz 研究生学位论文撰写规范》}}
139 \def\UGR{\href{http://www.hitsz.edu.cn/UserFiles/editor/file/20190923/1569224708968004622.doc}
140 {《\hitsz 本科生毕业论文撰写规范》}}
141 \NewDocumentEnvironment{hitszrgu}{o o}
142 { \IfNoValueTF{#1}{\PGR,\UGR}{#1}\IfNoValueF{#2}{#2中}%
143 \color{red}规定:“}{”}
144 \endinput
145 %%
146 %% End of file `dtx-style.sty'.