-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLatexConfig.tex
188 lines (164 loc) · 4.71 KB
/
LatexConfig.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
\ifx \aspectratio \undefined
\def \aspectratio{43} % also: 169
\fi
\documentclass[xetex,mathserif,serif,aspectratio=\aspectratio]{beamer}
\usepackage{listings}
\usepackage{tikz}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{verbatim}
\usepackage{eso-pic}
\usepackage{courier}
\usepackage{textcomp}
\usepackage[inkscapepath=/tmp/TalkSvg/]{svg}
\usepackage[cm-default]{fontspec}
\usepackage{xeCJK}
% https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755385#26
%\setCJKmainfont{Source Han Sans CN}
%\setCJKmonofont{Source Han Sans CN}
\setCJKmainfont{Noto Sans CJK SC}
\setCJKmonofont{Noto Sans CJK SC}
\setmainfont{DejaVu Sans}
\setmonofont{Courier 10 Pitch}
\hypersetup{colorlinks,linkcolor=,urlcolor=blue}
\newcommand{\link}[1]{\href{#1}{#1}}
\newcommand{\insertGraph}[3]{
\centerline{\includegraphics[scale=#1]{#2}} % 0/0
\centerline{#3}
}
\newcommand{\HCCLogoSimp}{
\begin{tikzpicture}[scale=0.1,
rev/.style={insert path={circle[radius=9]}},eo/.code={\pgfseteorule}]
\input{assets/HCCLogoLogo.tex}
\end{tikzpicture}
}
\newcommand{\HCCLogoFull}{
\begin{tikzpicture}[scale=0.05,
rev/.style={insert path={circle[radius=9]}},eo/.code={\pgfseteorule}]
\input{assets/HCCLogoLogo.tex}
\input{assets/HCCLogoText.tex}
\end{tikzpicture}
}
\setbeamercolor{background canvas}{bg=}
\newcommand{\PreFirstFrame}{
\AddToShipoutPictureFG*{
\AtPageLowerLeft{
\put(\LenToUnit{0.05\paperwidth},\LenToUnit{0.1\paperheight}){
\footnotesize
这个指引文档在
\href{https://creativecommons.org/licenses/by-sa/3.0/deed.zh}
{知识共享 署名-相同方式共享 3.0协议} 之条款下提供
}
\put(\LenToUnit{0.05\paperwidth},\LenToUnit{0.05\paperheight}){
\footnotesize
Available under
\href{https://creativecommons.org/licenses/by-sa/3.0/}
{Creative Commons Attribution-ShareAlike License}
}
\put(\LenToUnit{0.6\paperwidth},\LenToUnit{0.15\paperheight}){
\HCCLogoFull
}
}
}
}
\newcommand{\PostFirstFrame}{
\AddToShipoutPictureBG{
\AtPageLowerLeft{
\put(\LenToUnit{0.8\paperwidth},\LenToUnit{0.15\paperheight}){
\HCCLogoSimp
}
}
}
}
\newcommand{\PreLastFrame}{
\ClearShipoutPictureBG
\AddToShipoutPictureFG*{
\AtPageLowerLeft{
\put(\LenToUnit{0.6\paperwidth},\LenToUnit{0.15\paperheight}){
\HCCLogoFull
}
}
}
}
\definecolor{Pink}{HTML}{ff0bff} % Use: \color{Pink} OR \color[HTML]{ff0bff}
\definecolor{Blue}{HTML}{0000ff}
\definecolor{Green}{HTML}{008a8c}
\definecolor{Brown}{HTML}{a52a2a}
% Note: this C style differs a lot from gedit's
\lstdefinestyle{cstyle}{
language=c,
basicstyle=\ttfamily,
morekeywords={with},
keywordstyle=\bfseries\color{Brown},
commentstyle=\color{Blue},
stringstyle=\color{Pink},
keywordstyle=[3]\color{Green},
alsoletter={0123456789.},
morekeywords=[4]{0,1,2,100,999},
keywordstyle=[4]\color{Pink},
upquote=true,
breaklines=true,
}
\lstdefinestyle{pythonstyle}{
language=python,
basicstyle=\ttfamily,
% frame=single,
morekeywords={with,yield},
keywordstyle=\bfseries\color{Brown},
keywordstyle=[2]\color{Green},
commentstyle=\color{Blue},
stringstyle=\color{Pink},
keywordstyle=[3]\color{Green},
alsoletter={0123456789.},
morekeywords=[4]{False,True,
0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,17,19,16,20,24,27,31,32,33,34,35,38,
45,56,60,64,81,95,97,99,100,123,243,256,400,512,576,729,999,1000,1024,
1234,1365,1366,2000,2187,2836,2957,3856,3857,5678,6561,9274,100000,
1000000,
0.5,3.14,3.4,
0x1234,},
keywordstyle=[4]\color{Pink},
upquote=true,
breaklines=true,
showstringspaces=false,
}
\lstdefinestyle{bashstyle}{
language=bash,
basicstyle=\ttfamily,
% frame=single,
morekeywords=[2]{
cp,df,du,find,ll,ls,mkdir,mv,rm,tree,
cut,diff,grep,head,hexdump,less,man,md5sum,more,nano,sha1sum,tail,vi,wc,
date,free,ifconfig,lspci,sleep,sync,time,top,uname,
7za,dnf,history,rpm,su,sudo,wget,yum,
git,
},
keywordstyle=\bfseries\color{Brown},
keywordstyle=[2]\color{Green},
commentstyle=\color{Blue},
stringstyle=\color{Pink},
keywordstyle=[3]\color{Green},
alsoletter={-=0123456789.|><&~*?;},
morekeywords={&,&&,|,||,>,<,>>,<<,2>,&>,;},
morekeywords=[4]{
0,1,2,3,4,5,6,7,8,9,10,
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,
bin,dev,etc,hcc,home,jkl,mnt,opt,root,srv,tmp,usr,
*,?,.,..,~,-,stdin,stdout,stderr,
null,zero,random,urandom,sda,sda1,sda2,sda3,sda4,sdb1,sr0,USB,tmpfs,
passwd,shadow,hosts,fstab,sudoers,locale.conf,resolv.conf,
.bash_history,mydoc.7z,mydoc,master,
},
keywordstyle=[4]\color{Pink},
upquote=true,
breaklines=true,
showstringspaces=false,
}
\lstset{
tabsize=4,
columns=fixed,
extendedchars=false,
}
\newcommand{\inlinePython}{\lstinline[style=pythonstyle]}
\newcommand{\inlineBash}{\lstinline[style=bashstyle]}
\newcommand{\inlineListing}{\lstinline[basicstyle=\ttfamily]}