-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathWHU-Beamer.sty
661 lines (560 loc) · 22.7 KB
/
WHU-Beamer.sty
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
%========== 元信息定义 ==========%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{WHU-Beamer}[2022/04/26 Wuhan University Beamer Theme]
%========== 预定义部分 ==========%
\RequirePackage{ctex} % 中文支持
\RequirePackage{hyperref}
\RequirePackage[T1]{fontenc}
% other packages
\RequirePackage{latexsym}
\RequirePackage{amsmath,amsfonts,amssymb} % 数学公式
\RequirePackage{xcolor} % 代码着色
\RequirePackage{algorithm,algorithmic}
\RequirePackage{multicol,multirow}
\RequirePackage{booktabs}
\RequirePackage{calligra}
\RequirePackage{graphicx} % 图片支持
\RequirePackage{pstricks}
\RequirePackage{listings} % 代码包
\RequirePackage{stackengine}
\RequirePackage{tikz} % tikz: 绘制图像.
\RequirePackage{tcolorbox} % tcolorbox: 绘制彩色文本框.
\RequirePackage{caption} % 图片插入标题
\RequirePackage{subcaption} % 子图片插入标题
\RequirePackage[backend=biber,style=numeric-comp,sorting=none]{biblatex} % 参考文献
\RequirePackage{cncolours} % 绘制樱花的color包
% 添加引用路径
\addbibresource{./ref/ref.bib}
% 设置图片的标题字体
\captionsetup{font=scriptsize,labelfont=scriptsize}
% tcolorbox使用对应的库
\tcbuselibrary{theorems, skins, breakable, xparse, listings}
\tcbset{listing engine=listings}
% tikz引入shapes calc
\usetikzlibrary{shapes, calc}
% 定义执行命令. 修改自 sjtubeamer.
\def\EqualOptionsBeamer{%
\relax\fi\ifEqualOptionsBeamer%
}
\def\ifEqualOptionsBeamer#1#2{%
% #1: Option - Key.
% #2: Option - Value.
\newif\ifoption@tmp%
\edef\optionkey@tmp{%
\csname beamer@whu@#1\endcsname%
}%
\edef\optionvalue@tmp{#2}%
\ifx\optionkey@tmp\optionvalue@tmp\option@tmptrue%
\else\option@tmpfalse\fi%
\ifoption@tmp%
}
% 改变引用字体大小
\renewcommand*{\bibfont}{\scriptsize}
% 重写上标引用命令。请勿随意改动括号缩进。
\DeclareCiteCommand{\supercite}[\mkbibsuperscript]
{\bibopenbracket
\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}{}
{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}{}
{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}\bibclosebracket}
% 代码块颜色
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\definecolor{halfgray}{gray}{0.55}
% 注: 常用的颜色模式有 RGB 与 CMYK, 对应 LaTeX 中 rgb(0-1小数制, x/255), RGB(原始数值), cmyk(0-1小数制, x/100).
% 以下定义一些颜色及其渐变色,包含来自各学校的颜色定义
% ----------------
% COLOR:: 武大青色 - whucyan
\definecolor{whucyan}{cmyk}{0.5,0,0.15,0}
\colorlet{whucyan10} {whucyan!10!white}
\colorlet{whucyan20} {whucyan!20!white}
\colorlet{whucyan30} {whucyan!30!white}
\colorlet{whucyan40} {whucyan!40!white}
\colorlet{whucyan50} {whucyan!50!white}
\colorlet{whucyan60} {whucyan!60!white}
\colorlet{whucyan70} {whucyan!70!white}
\colorlet{whucyan80} {whucyan!80!white}
\colorlet{whucyan90} {whucyan!90!white}
% COLOR:: 武大樱花粉 - whusakura
\definecolor{whusakura}{RGB}{255, 86, 119}
\colorlet{whusakura10} {whusakura!10!white}
\colorlet{whusakura20} {whusakura!20!white}
\colorlet{whusakura30} {whusakura!30!white}
\colorlet{whusakura40} {whusakura!40!white}
\colorlet{whusakura50} {whusakura!50!white}
\colorlet{whusakura60} {whusakura!60!white}
\colorlet{whusakura70} {whusakura!70!white}
\colorlet{whusakura80} {whusakura!80!white}
\colorlet{whusakura90} {whusakura!90!white}
% COLOR:: 清华紫色 - thupurple
\xdefinecolor{thupurple}{rgb}{0.455,0.204,0.506}
\colorlet{thupurple10} {thupurple!10!white}
\colorlet{thupurple20} {thupurple!20!white}
\colorlet{thupurple30} {thupurple!30!white}
\colorlet{thupurple40} {thupurple!40!white}
\colorlet{thupurple50} {thupurple!50!white}
\colorlet{thupurple60} {thupurple!60!white}
\colorlet{thupurple70} {thupurple!70!white}
\colorlet{thupurple80} {thupurple!80!white}
\colorlet{thupurple90} {thupurple!90!white}
% COLOR:: 川大锦绣红 - scured - CMYK(12,92,95,20).
\definecolor{scured} {cmyk}{0.12,0.92,0.95,0.20}
\colorlet{scured10} {scured!10!white}
\colorlet{scured20} {scured!20!white}
\colorlet{scured30} {scured!30!white}
\colorlet{scured40} {scured!40!white}
\colorlet{scured50} {scured!50!white}
\colorlet{scured60} {scured!60!white}
\colorlet{scured70} {scured!70!white}
\colorlet{scured80} {scured!80!white}
\colorlet{scured90} {scured!90!white}
% COLOR:: 川大优雅灰 - scugrey - CMYK(47,37,37,20).
\definecolor{scugrey} {cmyk}{0.47,0.37,0.37,0.00}
\colorlet{scugrey10} {scugrey!10!white}
\colorlet{scugrey20} {scugrey!20!white}
\colorlet{scugrey30} {scugrey!30!white}
\colorlet{scugrey40} {scugrey!40!white}
\colorlet{scugrey50} {scugrey!50!white}
\colorlet{scugrey60} {scugrey!60!white}
\colorlet{scugrey70} {scugrey!70!white}
\colorlet{scugrey80} {scugrey!80!white}
\colorlet{scugrey90} {scugrey!90!white}
% COLOR:: 川大宝石蓝 - scublue - CMYK(100,60,0,15).
\definecolor{scublue} {cmyk}{1.00,0.60,0.00,0.15}
\colorlet{scublue10} {scublue!10!white}
\colorlet{scublue20} {scublue!20!white}
\colorlet{scublue30} {scublue!30!white}
\colorlet{scublue40} {scublue!40!white}
\colorlet{scublue50} {scublue!50!white}
\colorlet{scublue60} {scublue!60!white}
\colorlet{scublue70} {scublue!70!white}
\colorlet{scublue80} {scublue!80!white}
\colorlet{scublue90} {scublue!90!white}
% COLOR:: 川大荷叶绿 - scugreen - CMYK(100,0,90,15).
\definecolor{scugreen} {cmyk}{1.00,0.00,0.90,0.15}
\colorlet{scugreen10} {scugreen!10!white}
\colorlet{scugreen20} {scugreen!20!white}
\colorlet{scugreen30} {scugreen!30!white}
\colorlet{scugreen40} {scugreen!40!white}
\colorlet{scugreen50} {scugreen!50!white}
\colorlet{scugreen60} {scugreen!60!white}
\colorlet{scugreen70} {scugreen!70!white}
\colorlet{scugreen80} {scugreen!80!white}
\colorlet{scugreen90} {scugreen!90!white}
% COLOR:: 川大银杏黄 - scuyellow - CMYK(0,40,100,15).
\definecolor{scuyellow}{cmyk}{0.00,0.40,1.00,0.15}
\colorlet{scuyellow10}{scuyellow!10!white}
\colorlet{scuyellow20}{scuyellow!20!white}
\colorlet{scuyellow30}{scuyellow!30!white}
\colorlet{scuyellow40}{scuyellow!40!white}
\colorlet{scuyellow50}{scuyellow!50!white}
\colorlet{scuyellow60}{scuyellow!60!white}
\colorlet{scuyellow70}{scuyellow!70!white}
\colorlet{scuyellow80}{scuyellow!80!white}
\colorlet{scuyellow90}{scuyellow!90!white}
% ----------------
% 设置页面间距
% \setbeamersize {
% text margin left=1.5cm,
% text margin right=1.5cm
% }
% 用于判断是否目录分栏
\newif\ifbeamer@whu@contentmuticols
% KEY:: BlockDisplay.
% VALUE:: colorful | followtheme | allgrey.
\DeclareOptionBeamer{BlockDisplay}{\def\beamer@whu@BlockDisplay{#1}}
% KEY:: LanguageMode.
% VALUE:: cn | en.
\DeclareOptionBeamer{LanguageMode}{\def\beamer@whu@LanguageMode{#1}}
% KEY:: ColorDisplay.
% VALUE:: JXred | BSblue.
\DeclareOptionBeamer{ColorDisplay}{\def\beamer@whu@ColorDisplay{#1}}
% KEY:: AspectRatio [PASSTO:: beamercolorthemescu.sty].
% VALUE:: 1610 | 169.
% 注:1610表示16:10的比例;169表示16:9的比例。
\DeclareOptionBeamer{AspectRatio}{\def\beamer@whu@AspectRatio{#1}}
% KEY:: IconColor.
% VALUE:: light | dark.
% 注:浅色或深色校徽。
\DeclareOptionBeamer{IconColor}{\def\beamer@whu@IconColor{#1}}
% KEY:: ThemeColor.
% VALUE:: whucyan | whusakura | thupuple | scured | scublue | scugreen | scuyellow.
% 注:指定主题颜色。
\DeclareOptionBeamer{ThemeColor}{\colorlet{ThemeColor}{#1}}
% 展开后面的内容
\DeclareOptionBeamer{ContentMuticols}{\csname beamer@whu@contentmuticols#1\endcsname}
\ExecuteOptionsBeamer{%
AspectRatio=1610,
BlockDisplay=colorful,%
ContentMuticols=true,%
ColorDisplay=JXred,%
LanguageMode=cn,%
IconColor=light,%
ThemeColor=whucyan
}
\ProcessOptionsBeamer
\colorlet{ThemeColor10}{ThemeColor!10!black}
\colorlet{ThemeColor20}{ThemeColor!20!black}
\colorlet{ThemeColor30}{ThemeColor!30!black}
\colorlet{ThemeColor40}{ThemeColor!40!black}
\colorlet{ThemeColor50}{ThemeColor!50!black}
\colorlet{ThemeColor60}{ThemeColor!60!black}
\colorlet{ThemeColor70}{ThemeColor!70!black}
\colorlet{ThemeColor80}{ThemeColor!80!black}
\colorlet{ThemeColor90}{ThemeColor!90!black}
\mode<presentation>
% \newif\ifbeamer@secheader
% \beamer@secheaderfalse
%\DeclareOptionBeamer{secheader}{\beamer@secheadertrue}
% ----------------
% Background Layout
% ----------------
% 设置了主题背景选项 "background=true" & "background=false".
% 设置了页眉logo.
% ----------------
\if\EqualOptionsBeamer{AspectRatio}{1610}%
\def\beamer@whu@bg{./images/background_1610.png}
\def\beamer@whu@bg@cover{./images/background_cover_1610.png}
%\PackageWarningNoLine{beamerthemescu}{ratio set to 1610}
\typeout{ratio set to 16:10.}
\else\if\EqualOptionsBeamer{AspectRatio}{169}%
\def\beamer@whu@bg{./images/background_169.png}
\def\beamer@whu@bg@cover{./images/background_cover_169.png}
\typeout{ratio set to 16:9.}
\fi\fi
\if\EqualOptionsBeamer{IconColor}{light}%
\def\beamer@whu@icon{./images/light.pdf}
\else\if\EqualOptionsBeamer{IconColor}{dark}%
\def\beamer@whu@icon{./images/dark.pdf}
\fi\fi
% 设置 "background.png" 为图片 "bg".
\pgfdeclareimage[width=\paperwidth]%
{bg}{\beamer@whu@bg}
% 设置图片 "bg" 为背景图片.
\usebackgroundtemplate{\pgfuseimage{bg}}
% 设置 "background_cover.png" 为图片 "bgofsubsectoc".
\pgfdeclareimage[width=\paperwidth]%
{bgofsubsectoc}{\beamer@whu@bg@cover}
% 设置 "background_cover.png" 为图片 "bgoftitle".
\pgfdeclareimage[width=\paperwidth]%
{bgoftitle}{\beamer@whu@bg@cover}
% 设置 "whulogo.png" 为图片 "logo".
% \pgfdeclareimage[width=6.25em]%
% {lg}{./images/whulogo_light.png}
% ----------------
% 设置定理环境
\def\themytheorem{\thesection.\arabic{mytheorem}}
\newcounter{TheoremCounter}[section]
\newcounter{DefinitionCounter}[section]
\newcounter{CorollaryCounter}[section]
\newcounter{ExampleCounter}[section]
\definecolor{thorem-yellow}{cmyk}{0,0.2,0.7,0,1.00}
\definecolor{thorem-blue}{cmyk}{0.80, 0.13, 0.14, 0.04, 1.00}
\definecolor{thorem-green}{cmyk}{0.4,0,0.4,0,1.00}
% 设置定理块样式
\tcbset{
defstyle/.style={fonttitle=\bfseries\upshape, colback=thorem-yellow!5,colframe=thorem-yellow!80!black},
theostyle/.style={fonttitle=\bfseries\upshape, colback=thorem-blue!5,colframe=thorem-blue!80!black},
corstyle/.style={fonttitle=\bfseries\upshape, colback=thorem-green!5,colframe=thorem-green!80!black},
}
\newtcbtheorem[number within=section]{defn}{定义}{defstyle}{defn}
\newtcbtheorem[number within=section]{theo}{定理}{theostyle}{theo}
\newtcbtheorem[number within=section]{coro}{推论}{corstyle}{cor}
\newtcbtheorem[number within=section]{exm}{例}{corstyle}{eg}
% 注:定理环境在使用时需要两个必须参数 二者可以为空{}
% 第一个参数是定理块的名称 第二个参数用于引用
% ref:https://tex.stackexchange.com/questions/628664/tcolorbox-theorem-environment-doesnt-show-first-character
% ----------------
% 设置代码高亮
% ref: https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings
\lstdefinestyle{customc}{
belowcaptionskip=1\baselineskip,
breaklines=true,
frame=L,
xleftmargin=\parindent,
language=C,
showstringspaces=false,
basicstyle=\footnotesize\ttfamily,
keywordstyle=\bfseries\color{green!40!black},
commentstyle=\itshape\color{red!50!green!50!blue!50},
identifierstyle=\color{blue},
stringstyle=\color{orange},
}
\lstdefinestyle{customasm}{
belowcaptionskip=1\baselineskip,
frame=L,
xleftmargin=\parindent,
language=[x86masm]Assembler,
basicstyle=\footnotesize\ttfamily,
commentstyle=\itshape\color{purple!40!black},
}
\lstset{escapechar=@,style=customc,numbers=left,numberstyle=\tiny}
\newcommand{\includecode}[2][c]{\lstinputlisting[caption=#2, escapechar=, style=custom#1]{#2}<!---->}
% ----------------
% 定义目录输入命令。可以选择将目录分栏显示。
\def\inserttableofcontent{
\ifbeamer@whu@contentmuticols%
\begin{multicols}{2}
\tableofcontents[]%
\end{multicols}
\else
\tableofcontents[]
\fi
}
% 添加封面及目录
\AtBeginDocument{%
\begingroup%
\kaishu
\setbeamertemplate{background}{\pgfuseimage{bgoftitle}}%
\endgroup%
}
% 小节前加目录.
\AtBeginSection[]{
\begingroup%
\setbeamertemplate{background}{\pgfuseimage{bgofsubsectoc}}%
\begin{frame}
\tableofcontents[sections=\value{section}]
\end{frame}
\endgroup%
}
% \AtBeginSubsection[]{%
% \begingroup%
% \setbeamertemplate{background}{\pgfuseimage{bg}}%
% \begin{frame}{目录}
% \inserttableofcontent
% \end{frame}
% \endgroup%
% }
\useoutertheme[footline=authorinstitute,subsection=false]{miniframes}
\makeatletter % [add curpage/total page at the bottom](http://tex.stackexchange.com/questions/100838/beamer-dresden-theme-miniframes-appeareance-and-frame-number-insertion)
\newcommand{\frameofframes}{/}
\newcommand{\setframeofframes}[1]{\renewcommand{\frameofframes}{#1}}
\makeatother
% ref:https://tex.stackexchange.com/questions/330817/beamer-template-customization-logo-headline-and-footline?newreg=c99281e2d52846a1abddc869f1cdc120
% footline
\makeatletter
\setbeamertemplate{footline}{%
\leavevmode%
\hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortdate \hfill \insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
% \usebeamerfont{title in head/foot}\insertshorttitle \hfill \insertframenumber \,/\, \inserttotalframenumber%
\usebeamerfont{title in head/foot}
\insertshorttitle\hfill
\vbox{\hbox{\insertslidenavigationsymbol\insertframenavigationsymbol\insertsectionnavigationsymbol\insertsubsectionnavigationsymbol\insertbackfindforwardnavigationsymbol\hskip-2ex}\vskip-.6ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
% Headline
\makeatletter
\setbeamertemplate{headline}{%
\leavevmode%
\@tempdimb=1.25ex%
\ifnum\beamer@subsectionmax<\beamer@sectionmax%
\multiply\@tempdimb by\beamer@sectionmax%
\else%
\multiply\@tempdimb by\beamer@subsectionmax%
\fi%
\ifdim\@tempdimb>0pt%
\advance\@tempdimb by 1.825ex%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
\vspace*{1mm}\hspace*{-2mm}%
\insertsectionnavigationhorizontal{.5\paperwidth}{}{\hskip0pt plus1filll}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
% \vbox to\@tempdimb{
% \vfil
% \insertsubsectionnavigation
% {.5\paperwidth}
% \vfil
% }%
\vbox to\@tempdimb{
\vfill
\insertsubsectionnavigationhorizontal{.4\paperwidth}{}{\hskip0pt plus1filll}
\vfill
}%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=0\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
\vspace*{1.3ex}\hspace*{-1.65cm}
\includegraphics[height=.7\@tempdimb]{\beamer@whu@icon}
\end{beamercolorbox}%
\fi%
}
\makeatother
% 设置箭头样式
% ref:https://tex.stackexchange.com/questions/398326/custom-horizontal-navigation-bar-for-beamer
\setbeamertemplate{section in head/foot}{%
\if\insertsectionheadnumber1
\tikz\node[draw=ThemeColor,fill=ThemeColor,shape=signal,very thick,text=white]{\insertsectionhead\hskip.3cm};
\else
\tikz\node[draw=ThemeColor,fill=ThemeColor,shape=signal,signal from=west, signal to=east,very thick,text=white] {\insertsectionhead\hskip.3cm};
\fi
}
\setbeamertemplate{section in head/foot shaded}{%
\if\insertsectionheadnumber1
\tikz\node[draw=ThemeColor,fill=white,shape=signal,very thick,text=ThemeColor]{\insertsectionhead\hskip.3cm};
\else
\tikz\node[draw=ThemeColor,fill=white,shape=signal,signal from=west, signal to=east,very thick,text=ThemeColor] {\insertsectionhead\hskip.3cm};
\fi
}
%--------------
\useinnertheme{circles}
%\useoutertheme{default}
%\useinnertheme[shadow=true]{rounded}
% 设置一下相关字体大小
\setbeamerfont{footnote}{size=\tiny}
\setbeamerfont{author}{size=\large}
\setbeamerfont{institute}{size=\footnotesize}
\setbeamerfont{date}{size=\footnotesize}
\setbeamerfont{frametitle}{size=\small}
\setbeamerfont{section in toc}{size=\large}
\setbeamerfont{subsection in toc}{size=\small}
% 设置各种元素的颜色
\setbeamercolor{footline}{bg=ThemeColor}
\setbeamercolor{frametitle}{bg=ThemeColor,fg=white}
\setbeamercolor{title}{bg=ThemeColor, fg=white}
\setbeamercolor{subsection in toc}{fg=ThemeColor50}
\setbeamercolor{navigation symbols dimmed}{fg=white} % 修改导航按钮箭头颜色
\setbeamercolor{navigation symbols}{bg=white,fg=white}
\setbeamercolor{bibliography item}{fg=ThemeColor50}
\setbeamercolor{bibliography entry author}{fg=scugrey}
\setbeamercolor{bibliography entry title}{fg=ThemeColor80}
\setbeamercolor{bibliography entry location}{fg=scugrey}
\setbeamercolor{bibliography entry note}{fg=scugrey}
% 将引用参考文献的图片改为数字
\setbeamertemplate{bibliography item}[text]
\setbeamertemplate{caption}[numbered]
% 小节目录样式 %
% \defbeamertemplate{subsection in toc}{bullets}{%
% \leavevmode
% \leftskip=1.5em
% \parbox[t]{1em}{\textbullet\hfill}%
% \parbox[t]{\dimexpr\textwidth\relax}{\inserttocsubsection}
% \par
% }
%\setbeamertemplate{subsection in toc}[bullets]
% 修改frame title的样式
\setbeamertemplate{frametitle}{%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=.5ex]{}%{frametitle}
\textcolor{ThemeColor50}{\rule[-.3ex]{.35em}{2.25ex}\enspace}%
\usebeamerfont{frametitle}\usebeamercolor[bg]{frametitle}%
\insertframetitle%
\end{beamercolorbox}%
}
\setbeamertemplate{subsection in toc}{
\leavevmode
\leftskip=3.2em
\rlap{
\hskip-2em
\inserttocsectionnumber.
\inserttocsubsectionnumber
}
\inserttocsubsection\par
}
%-----------------------
% 樱花进度条
% Thanks to @T0nyX1ang
% ref:https://github.com/T0nyX1ang/WHU-BeamerTemplate/tree/v1.4.0
\providecommand{\drawpetalgeneral}[8]{
% draw a general petal (not needed be called explicitly in most situations)
% required parameter(s): #1 -- rotation of the petal
% #2 -- outer color of the petal
% #3 -- inner color of the petal
% #4 -- kernel color of the petal
% #5 -- outwards angle of the petal
% #6 -- inwards angle of the petal
% #7 -- offset in x axis
% #8 -- offset in y axis
\filldraw[rotate=#1,color=#2] (0,0) [out=#5,in=#6]to (#7,#8) -- (0,#8-#7) -- (-#7,#8) [out=-180-#6,in=180-#5]to (0, 0) -- cycle;
\fill[rotate=#1-6,#3,opacity=.65] (0,#8*0.25) circle (1.2pt);
\fill[rotate=#1+6,#3,opacity=.65] (0,#8*0.25) circle (1.2pt);
\fill[#4,opacity=.75] (0,0) circle (2.2pt);
}
\providecommand{\drawpetal}[2]{
% draw a certain petal
% required parameter(s): #1 -- rotation of the petal
% #2 -- petal type
\ifcase#2\relax
\or\drawpetalgeneral{#1}{嫣红}{樱桃色}{樱草色}{53}{-25}{0.25}{3.75} % Type 1 -- pink petal of sakura
\or\drawpetalgeneral{#1}{精白}{粉红}{樱草色}{53}{-25}{0.25}{3.75} % Type 2 -- white petal of sakura
\fi
}
\providecommand{\drawflower}[2]{
% draw a flower
% required parameter(s): #1 -- the number of petals
% #2 -- petal type
% e.g. for a pink sakura, call \drawflower{5}{1}
\foreach \x in {1,...,#1}
{
\drawpetal{-(\x - 1) / #1 * 360}{#2}
}
}
\providecommand{\drawprogressbarh}[7]{
% draw a horizontal progressbar
% required parameter(s): #1 the color of progressbar
% #2 length of paper height (factor = 0.85/0.75)
% #3 total pages
% #4 start page of current section
% #5 end page of current section
% #6 current page
% #7 sakura type
\draw[line width=0.2pt, color=#1] (0, 0) -- (.85#2, 0);
\draw[line width=0.8pt, color=#1] (0.05 * #2 + 0.75 / #3 * #2 * #4 - 0.375 / #3 * #2, 0) -- (0.05 * #2 + 0.75 / #3 * #2 * #5 - 0.375 / #3 * #2, 0); % extinguish current section by line width
\begin{scope}[xshift=0.05 * #2 + 0.75 / #3 * #2 * #6 - 0.375 / #3 * #2, scale=.05]
\drawflower{5}{#7}
\end{scope}
}
\providecommand{\drawprogressbarv}[7]{
% draw a vertical progressbar
% required parameter(s): #1 the color of progressbar
% #2 length of paper height (factor = 0.85/0.75)
% #3 total pages
% #4 start page of current section
% #5 end page of current section
% #6 current page
% #7 sakura type
\draw[line width=0.2pt, color=#1] (0, 0) -- (0, -0.85#2);
\draw[line width=0.8pt, color=#1] (0, -0.05 * #2 - 0.75 / #3 * #2 * #4 + 0.375 / #3 * #2) -- (0, -0.05 * #2 - 0.75 / #3 * #2 * #5 + 0.375 / #3 * #2);
\begin{scope}[yshift=-0.05 * #2 - 0.75 / #3 * #2 * #6 + 0.375 / #3 * #2, scale=.05]
\drawflower{5}{#7}
\end{scope}
}
\def\verticalpbartype{1} % 垂直方向 画粉色樱花
\def\horizontalpbartype{2} % 水平方向 画白色樱花
\setbeamersize{sidebar width right=1cm}
\makeatletter
\setbeamertemplate{sidebar right}
{
\begin{tikzpicture}
% construct several paths to make room for the sakura
\path (-0.5cm, 0) -- ++ (0.5cm, 0); % make room for progressbar
\drawprogressbarv{ThemeColor}{\paperheight}{\insertdocumentendpage}{\insertsectionstartpage}{\insertsectionendpage}{\insertpagenumber}{\verticalpbartype}
\node[rounded corners, draw=ThemeColor, text width=4.5em, align=center, inner sep=2pt, text=ThemeColor50, anchor=east, opacity=.85] at (0.405, -0.85\paperheight-4.5) %rounded rectangle west arc=none
{\insertframenumber \,/\, \inserttotalframenumber};
\end{tikzpicture}
}
\makeatother
%-----------------------
% 设置structure的四种调色板颜色
\setbeamercolor{palette primary}{use=structure,fg=white,bg=structure.fg}
\setbeamercolor{palette secondary}{use=structure,fg=white,bg=structure.fg!90!black}
\setbeamercolor{palette tertiary}{use=structure,fg=white,bg=structure.fg!80!black}
\setbeamercolor{palette quaternary}{fg=white,bg=structure.fg!80!black}
%\setbeamercolor*{sidebar}{use=structure,bg=structure.fg}
\setbeamercolor{titlelike}{parent=palette primary}
\setbeamercolor{block title}{bg=ThemeColor,fg=white}
\setbeamercolor*{block title example}{use={normal text,example text},bg=white,fg=ThemeColor}
\setbeamercolor{fine separation line}{}
\setbeamercolor{item projected}{fg=white}
\setbeamercolor{separation line}{}
\setbeamercolor{structure}{fg=ThemeColor}
\mode
<all>