Debian Codegraph @

texmf-dist/doc/latex/cquthesis/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 %% cquthesis.dtx (with options: `dtx-style')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 2016-2020 by Zhennan Li <[email protected]>
12 %% This file may be distributed and/or modified under the
13 %% conditions of the LaTeX Project Public License, either
14 %% version 1.3 of this license or (at your option) any later
15 %% version. The latest version of this license is in:
16 %%
17 %% http://www.latex-project.org/lppl.txt
18 %%
19 %% and version 1.3 or later is part of all distributions of
20 %% LaTeX version 2005/12/01 or later.
21 %%
22 \ProvidesPackage{dtx-style}
23 \RequirePackage[bottom,perpage,hang,]{footmisc}
24 \RequirePackage{hypdoc}
25 \RequirePackage[UTF8,scheme=chinese]{ctex}
26 \RequirePackage[
27 top=2.5cm, bottom=2.5cm,
28 left=4cm, right=2cm,
29 headsep=3mm]{geometry}
30 \RequirePackage{array,longtable,booktabs}
31 \RequirePackage{listings}
32 \RequirePackage{fancyhdr}
33 \RequirePackage{xcolor}
34 \RequirePackage{enumitem}
35 \RequirePackage{etoolbox}
36 \RequirePackage{metalogo}
37 \RequirePackage{graphicx}
38 \RequirePackage{xspace}
39 \RequirePackage{pifont}
40
41 \def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@}
42 \let\cqu@footnotesize\footnotesize
43 \renewcommand{\footnotesize}{\cqu@footnotesize\zihao{-5}}
44 \footnotemargin1.5em\relax
45
46 \let\cqu@makefnmark\@makefnmark
47 \def\cqu@@makefnmark{\mbox{{\normalfont\@thefnmark}}}
48 \pretocmd{\@makefntext}{\let\@makefnmark\cqu@@makefnmark}{}{}
49 \apptocmd{\@makefntext}{\let\@makefnmark\cqu@makefnmark}{}{}
50
51 \colorlet{cqu@macro}{blue!60!black}
52 \colorlet{cqu@env}{blue!70!black}
53 \colorlet{cqu@option}{purple}
54 \patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{cqu@macro}}{}{}
55 \patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{cqu@macro}}{}{}
56 \patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{cqu@env}}{}{}
57 \patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{cqu@env}}{}{}
58
59 \appto{\TeX}{\xspace}
60 \appto{\LaTeX}{\xspace}
61 \appto{\XeTeX}{\xspace}
62
63 \def\DescribeOption{%
64 \leavevmode\@bsphack\begingroup\MakePrivateLetters%
65 \Describe@Option}
66 \def\Describe@Option#1{\endgroup
67 \marginpar{\raggedleft\PrintDescribeOption{#1}}%
68 \cqu@special@index{option}{#1}\@esphack\ignorespaces}
69 \def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{cqu@option} #1\ }
70 \def\cqu@special@index#1#2{\@bsphack
71 \begingroup
72 \HD@target
73 \let\HDorg@encapchar\encapchar
74 \edef\encapchar usage{%
75 \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
76 }%
77 \index{#2\actualchar{\string\ttfamily\space#2}
78 (#1)\encapchar usage}%
79 \index{#1:\levelchar#2\actualchar
80 {\string\ttfamily\space#2}\encapchar usage}%
81 \endgroup
82 \@esphack}
83
84 \lstdefinestyle{lstStyleBase}{%
85 basicstyle=\small\ttfamily,
86 aboveskip=\medskipamount,
87 belowskip=\medskipamount,
88 lineskip=0pt,
89 boxpos=c,
90 showlines=false,
91 extendedchars=true,
92 upquote=true,
93 tabsize=2,
94 showtabs=false,
95 showspaces=false,
96 showstringspaces=false,
97 numbers=none,
98 linewidth=\linewidth,
99 xleftmargin=4pt,
100 xrightmargin=0pt,
101 resetmargins=false,
102 breaklines=true,
103 breakatwhitespace=false,
104 breakindent=0pt,
105 breakautoindent=true,
106 columns=flexible,
107 keepspaces=true,
108 gobble=2,
109 framesep=3pt,
110 rulesep=1pt,
111 framerule=1pt,
112 backgroundcolor=\color{gray!5},
113 stringstyle=\color{green!40!black!100},
114 keywordstyle=\bfseries\color{blue!50!black},
115 commentstyle=\slshape\color{black!60}}
116
117 \lstdefinestyle{lstStyleShell}{%
118 style=lstStyleBase,
119 frame=l,
120 rulecolor=\color{blue},
121 language=bash}
122
123 \lstdefinestyle{lstStyleLaTeX}{%
124 style=lstStyleBase,
125 frame=l,
126 rulecolor=\color{cyan},
127 language=[LaTeX]TeX}
128
129 \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{}
130 \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{}
131
132 \setlist{nosep}
133
134 \DeclareDocumentCommand{\option}{m}{\textsf{#1}\xspace}
135 \DeclareDocumentCommand{\env}{m}{\texttt{#1}\xspace}
136 \DeclareDocumentCommand{\pkg}{s m}{%
137 \texttt{#2}\xspace\IfBooleanF#1{\cqu@special@index{package}{#2}}}
138 \DeclareDocumentCommand{\file}{s m}{%
139 \texttt{#2}\xspace\IfBooleanF#1{\cqu@special@index{file}{#2}}}
140 \newcommand{\myentry}[1]{%
141 \marginpar{\raggedleft\color{purple}\bfseries\strut #1}}
142 \newcommand{\note}[1]{{%
143 \color{magenta}{\noindent\bfseries 说明:}\emph{#1}}}
144
145 \def\cquthesis{\textsc{Cqu}\-\textsc{Thesis}}
146 \endinput
147 %%
148 %% End of file `dtx-style.sty'.