Debian Codegraph @

texmf-dist/doc/latex/thubeamer/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 %% thubeamer.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.3c
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.3c or later is part of all distributions of LaTeX
21 %% version 2008/05/04 or later.
22 %%
23 %% To produce the documentation run the original source files ending with `.dtx'
24 %% through LaTeX.
25 %%
26
27 \ProvidesPackage{dtx-style}
28 \RequirePackage{hypdoc}
29 \RequirePackage[UTF8,scheme=chinese,fontset=windowsnew]{ctex}
30 \RequirePackage{newpxtext}
31 \RequirePackage{newpxmath}
32 \RequirePackage[top=2.5cm, bottom=2.5cm, left=3cm, right=2cm, headsep=8mm]{geometry}
33 \RequirePackage{array,longtable,booktabs}
34 \RequirePackage{listings}
35 \RequirePackage{fancyhdr}
36 \RequirePackage{xcolor}
37 \RequirePackage{enumitem}
38 \RequirePackage{etoolbox}
39 \RequirePackage{metalogo}
40 \RequirePackage{hyperref}
41
42 \colorlet{thu@macro}{purple!60!black}
43 \colorlet{thu@env}{purple!70!black}
44 \colorlet{thu@option}{purple}
45 \patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{}
46 \patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{}
47 \patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{}
48 \patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{}
49
50 \def\DescribeOption{%
51 \leavevmode\@bsphack\begingroup\MakePrivateLetters%
52 \Describe@Option}
53 \def\Describe@Option#1{\endgroup
54 \marginpar{\raggedleft\PrintDescribeOption{#1}}%
55 \thu@special@index{option}{#1}\@esphack\ignorespaces}
56 \def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{thu@option} #1\ }
57 \def\thu@special@index#1#2{\@bsphack
58 \begingroup
59 \HD@target
60 \let\HDorg@encapchar\encapchar
61 \edef\encapchar usage{%
62 \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
63 }%
64 \index{#2\actualchar{\string\ttfamily\space#2}
65 (#1)\encapchar usage}%
66 \index{#1:\levelchar#2\actualchar
67 {\string\ttfamily\space#2}\encapchar usage}%
68 \endgroup
69 \@esphack}
70
71 \lstdefinestyle{lstStyleBase}{%
72 basicstyle=\small\ttfamily,
73 aboveskip=\medskipamount,
74 belowskip=\medskipamount,
75 lineskip=0pt,
76 boxpos=c,
77 showlines=false,
78 extendedchars=true,
79 upquote=true,
80 tabsize=2,
81 showtabs=false,
82 showspaces=false,
83 showstringspaces=false,
84 numbers=none,
85 linewidth=\linewidth,
86 xleftmargin=4pt,
87 xrightmargin=0pt,
88 resetmargins=false,
89 breaklines=true,
90 breakatwhitespace=false,
91 breakindent=0pt,
92 breakautoindent=true,
93 columns=flexible,
94 keepspaces=true,
95 gobble=2,
96 framesep=3pt,
97 rulesep=1pt,
98 framerule=1pt,
99 backgroundcolor=\color{gray!5},
100 stringstyle=\color{purple!40!black!100},
101 keywordstyle=\bfseries\color{purple!50!black},
102 commentstyle=\slshape\color{black!60}}
103
104 \lstdefinestyle{lstStyleShell}{%
105 style=lstStyleBase,
106 frame=l,
107 rulecolor=\color{purple},
108 language=bash}
109
110 \definecolor{beamer@headercolor}{RGB}{21,95,130}
111 \lstdefinestyle{lstStyleLaTeX}{%
112 style=lstStyleBase,
113 frame=l,
114 rulecolor=\color{beamer@headercolor},
115 language=[LaTeX]TeX}
116
117 \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{}
118 \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{}
119
120 \setlist{nosep}
121
122 \DeclareDocumentCommand{\option}{m}{\textsf{#1}}
123 \DeclareDocumentCommand{\env}{m}{\texttt{#1}}
124 \DeclareDocumentCommand{\pkg}{s m}{%
125 \texttt{#2}\IfBooleanF#1{\thu@special@index{package}{#2}}}
126 \DeclareDocumentCommand{\file}{s m}{%
127 \texttt{#2}\IfBooleanF#1{\thu@special@index{file}{#2}}}
128 \newcommand{\myentry}[1]{%
129 \marginpar{\small\raggedleft\color{purple}\bfseries\strut #1}}
130 \newcommand{\note}[2][Note]{{%
131 \color{magenta}{\bfseries #1}\emph{#2}}}
132 \def\thubeamer{\textsc{Thu}\-\textsc{Beamer}}
133 \def\thu{清华大学}
134 %%
135 %% This package consists of the file thubeamer.dtx,
136 %% and the derived files thubeamer.pdf,
137 %% beamerthemethubeamer.sty,
138 %% beamercolorthemethubeamer.sty,
139 %% beamerinnerthemethubeamer.sty,
140 %% beamerouterthemethubeamer.sty.
141 %%
142 %%
143 %% End of file `dtx-style.sty'.