| 1 |
%% |
| 2 |
%% This is file `dtx-style.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% hitreport.dtx (with options: `dtx-style') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Copyright (C) 2021 by Xiao Sun <[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.3c |
| 15 |
%% of this license or (at your option) any later version. |
| 16 |
%% The latest version of this license is in: |
| 17 |
%% http://www.latex-project.org/lppl.txt |
| 18 |
%% and version 1.3c or later is part of all distributions of LaTeX |
| 19 |
%% version 2005/12/01 or later. |
| 20 |
%% |
| 21 |
|
| 22 |
\newcommand\hit@error[1]{% |
| 23 |
\ClassError{hitreport}{#1}{}% |
| 24 |
} |
| 25 |
\newcommand\hit@warning[1]{% |
| 26 |
\ClassWarning{hitreport}{#1}% |
| 27 |
} |
| 28 |
\newcommand\hit@patch@error[1]{% |
| 29 |
\hit@error{Failed to patch command \protect#1}% |
| 30 |
} |
| 31 |
\newcommand\hit@deprecate[2]{% |
| 32 |
\def\hit@@tmp{#2}% |
| 33 |
\hit@warning{% |
| 34 |
The #1 is deprecated% |
| 35 |
\ifx\hit@@tmp\@empty\else |
| 36 |
. Use #2 instead% |
| 37 |
\fi |
| 38 |
}% |
| 39 |
} |
| 40 |
\@ifl@t@r\fmtversion{2017/04/15}{}{ |
| 41 |
\hit@error{% |
| 42 |
TeX Live 2017 or later version is required to compile this document% |
| 43 |
} |
| 44 |
} |
| 45 |
\RequirePackage{ifxetex} |
| 46 |
\RequireXeTeX |
| 47 |
\ifxetex\else |
| 48 |
\ClassError{hitreport}{You must use the `xelatex' driver\MessageBreak |
| 49 |
Please choose `xelatex'}{Just choose `xelatex', no `pdflatex' or `latex' and so on.} |
| 50 |
\fi |
| 51 |
\ProvidesPackage{dtx-style} |
| 52 |
\RequirePackage{hypdoc} |
| 53 |
\RequirePackage{ifthen} |
| 54 |
\RequirePackage{fontspec}[2017/01/20] |
| 55 |
\RequirePackage{amsmath} |
| 56 |
\RequirePackage{unicode-math} |
| 57 |
\RequirePackage[UTF8,scheme=chinese]{ctex} |
| 58 |
\RequirePackage[ |
| 59 |
top=25mm, bottom=25mm, |
| 60 |
left=40mm, right=20mm, |
| 61 |
headsep=3mm]{geometry} |
| 62 |
\RequirePackage{hologo} |
| 63 |
\RequirePackage{array,longtable,booktabs} |
| 64 |
\RequirePackage{listings} |
| 65 |
\RequirePackage{fancyhdr} |
| 66 |
\RequirePackage{xcolor} |
| 67 |
\RequirePackage{enumitem} |
| 68 |
\RequirePackage{etoolbox} |
| 69 |
\RequirePackage{metalogo} |
| 70 |
|
| 71 |
\unimathsetup{ |
| 72 |
math-style=ISO, |
| 73 |
bold-style=ISO, |
| 74 |
} |
| 75 |
|
| 76 |
\DeclareRobustCommand\mathellipsis{\mathinner{\unicodecdots}} |
| 77 |
\IfFontExistsTF{XITSMath-Regular.otf}{ |
| 78 |
\setmathfont[ |
| 79 |
Extension = .otf, |
| 80 |
BoldFont = XITSMath-Bold, |
| 81 |
StylisticSet = 8, |
| 82 |
]{XITSMath-Regular} |
| 83 |
\setmathfont[range={cal,bfcal},StylisticSet=1]{XITSMath-Regular.otf} |
| 84 |
}{ |
| 85 |
\setmathfont[ |
| 86 |
Extension = .otf, |
| 87 |
BoldFont = *bold, |
| 88 |
StylisticSet = 8, |
| 89 |
]{xits-math} |
| 90 |
\setmathfont[range={cal,bfcal},StylisticSet=1]{xits-math.otf} |
| 91 |
} |
| 92 |
|
| 93 |
\colorlet{hit@macro}{blue!60!black} |
| 94 |
\colorlet{hit@env}{blue!70!black} |
| 95 |
\colorlet{hit@option}{purple} |
| 96 |
\patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{hit@macro}}{}{} |
| 97 |
\patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{hit@macro}}{}{} |
| 98 |
\patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{hit@env}}{}{} |
| 99 |
\patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{hit@env}}{}{} |
| 100 |
|
| 101 |
\def\DescribeOption{% |
| 102 |
\leavevmode\@bsphack\begingroup\MakePrivateLetters% |
| 103 |
\Describe@Option} |
| 104 |
\def\Describe@Option#1{\endgroup |
| 105 |
\marginpar{\raggedleft\PrintDescribeOption{#1}}% |
| 106 |
\hit@special@index{option}{#1}\@esphack\ignorespaces} |
| 107 |
\def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{hit@option} #1\ } |
| 108 |
\def\hit@special@index#1#2{\@bsphack |
| 109 |
\begingroup |
| 110 |
\HD@target |
| 111 |
\let\HDorg@encapchar\encapchar |
| 112 |
\edef\encapchar usage{% |
| 113 |
\HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}% |
| 114 |
}% |
| 115 |
\index{#2\actualchar{\string\ttfamily\space#2} |
| 116 |
(#1)\encapchar usage}% |
| 117 |
\index{#1:\levelchar#2\actualchar |
| 118 |
{\string\ttfamily\space#2}\encapchar usage}% |
| 119 |
\endgroup |
| 120 |
\@esphack} |
| 121 |
|
| 122 |
\lstdefinestyle{lstStyleBase}{% |
| 123 |
basicstyle=\small\ttfamily, |
| 124 |
aboveskip=\medskipamount, |
| 125 |
belowskip=\medskipamount, |
| 126 |
lineskip=0pt, |
| 127 |
boxpos=c, |
| 128 |
showlines=false, |
| 129 |
extendedchars=true, |
| 130 |
upquote=true, |
| 131 |
tabsize=2, |
| 132 |
showtabs=false, |
| 133 |
showspaces=false, |
| 134 |
showstringspaces=false, |
| 135 |
numbers=none, |
| 136 |
linewidth=\linewidth, |
| 137 |
xleftmargin=4pt, |
| 138 |
xrightmargin=0pt, |
| 139 |
resetmargins=false, |
| 140 |
breaklines=true, |
| 141 |
breakatwhitespace=false, |
| 142 |
breakindent=0pt, |
| 143 |
breakautoindent=true, |
| 144 |
columns=flexible, |
| 145 |
keepspaces=true, |
| 146 |
gobble=4, |
| 147 |
framesep=3pt, |
| 148 |
rulesep=1pt, |
| 149 |
framerule=1pt, |
| 150 |
backgroundcolor=\color{gray!5}, |
| 151 |
stringstyle=\color{green!40!black!100}, |
| 152 |
keywordstyle=\bfseries\color{blue!50!black}, |
| 153 |
commentstyle=\slshape\color{black!60}} |
| 154 |
|
| 155 |
\lstdefinestyle{lstStyleShell}{% |
| 156 |
style=lstStyleBase, |
| 157 |
frame=l, |
| 158 |
rulecolor=\color{purple}, |
| 159 |
language=bash} |
| 160 |
|
| 161 |
\lstdefinestyle{lstStyleLaTeX}{% |
| 162 |
style=lstStyleBase, |
| 163 |
frame=l, |
| 164 |
rulecolor=\color{violet}, |
| 165 |
language=[LaTeX]TeX} |
| 166 |
|
| 167 |
\lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{} |
| 168 |
\lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{} |
| 169 |
|
| 170 |
\setlist{nosep} |
| 171 |
|
| 172 |
\DeclareDocumentCommand{\option}{m}{\textsf{#1}} |
| 173 |
\DeclareDocumentCommand{\env}{m}{\texttt{#1}} |
| 174 |
\DeclareDocumentCommand{\pkg}{s m}{% |
| 175 |
\textsf{#2}\IfBooleanF#1{\hit@special@index{package}{#2}}} |
| 176 |
\DeclareDocumentCommand{\cls}{s m}{% |
| 177 |
\textsf{#2}\IfBooleanF#1{\hit@special@index{package}{#2}}} |
| 178 |
\DeclareDocumentCommand{\file}{s m}{% |
| 179 |
\nolinkurl{#2}\IfBooleanF#1{\hit@special@index{file}{#2}}} |
| 180 |
\newcommand{\myentry}[1]{% |
| 181 |
\marginpar{\raggedleft\color{purple}\bfseries\strut #1}} |
| 182 |
\newcommand{\note}[2][Note]{{% |
| 183 |
\color{magenta}{\bfseries #1}\emph{#2}}} |
| 184 |
|
| 185 |
\DeclareDocumentCommand{\githubuser}{m}{\href{https://github.com/#1}{@#1}} |
| 186 |
|
| 187 |
\def\thuthesis{\textsc{Thu}\-\textsc{Thesis}} |
| 188 |
\def\hitreport{\textsc{Hit}\-\textsc{Report}} |
| 189 |
\def\hithesis{\textsc{hi}\-\textsc{Thesis}} |
| 190 |
\endinput |
| 191 |
%% |
| 192 |
%% End of file `dtx-style.sty'. |