-
Notifications
You must be signed in to change notification settings - Fork 62
/
ustcbeamer.sty
executable file
·124 lines (104 loc) · 4 KB
/
ustcbeamer.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
\ProvidesPackage{ustcbeamer}
\RequirePackage{tikz}
\DeclareOption{bluetheme}{
\definecolor{themecolor}{RGB}{0,64,152} %科大校徽蓝
}
\DeclareOption{redtheme}{
\definecolor{themecolor}{RGB}{150,0,0} %红色
}
\DeclareOption{blacktheme}{
\definecolor{themecolor}{RGB}{0,0,0} %黑色
}
\ExecuteOptions{bluetheme}
\ProcessOptions\relax
\definecolor{themecolor1}{RGB}{243,242,243} %灰色
\definecolor{themecolor2}{RGB}{234,235,237} %分割线颜色
%\useoutertheme{infolines}%
%\usefonttheme{serif} %使用衬线字体,自行设置
%\setmainfont{Times New Roman} %全局英文字体,自行设置
%\setCJKmainfont{STKaiti} %全局中文字体,自行设置
\defbeamertemplate*{headline}{BLANK}{}
% \defbeamertemplate*{navigation symbols}{} %隐藏导航按钮
\setbeamerfont{frametitle}{size=\large}
\setbeamercolor{section in toc}{fg=black}
\setbeamercolor{block title}{fg=black}
\setbeamercolor{caption name}{fg=black}
\setbeamercolor{title}{fg=white}%
\setbeamercolor{frametitle}{fg=white}%
\setbeamercolor{item projected}{bg=themecolor}%
\setbeamercolor{item}{fg=themecolor}
\setbeamertemplate{items}[bullet]%
\setbeamertemplate{item}[bullet]%
\setbeamertemplate{sections/subsections in toc}[square]%
%--------------------
%模版
%--------------------
%标题页
\defbeamertemplate*{title page}{}[1][]{%
\strut\vfill\strut%
\begin{centering}%
\vfill\vfill\vfill\vfill%
{\usebeamercolor[fg]{title}\usebeamerfont{title}\inserttitle}%
\vfill%
\begingroup{\ifx\insertsubtitle\empty%
\else%
\usebeamercolor[fg]{title}\usebeamerfont{title}\large{\insertsubtitle}
\vfill%
\fi}\endgroup%
\begin{beamercolorbox}[center,#1]{author}%
\usebeamercolor[bg]{frametitle}\usebeamerfont{author}\insertauthor%
\end{beamercolorbox}\vfill%
\begin{beamercolorbox}[center,#1]{institute}%
\usebeamercolor[fg]{title}\usebeamerfont{institute}\insertinstitute%
\end{beamercolorbox}\vfill%
\begin{beamercolorbox}[center,#1]{date}%
\usebeamercolor[fg]{title}\usebeamerfont{date}\insertdate%
\end{beamercolorbox}%
\end{centering}
\vfill\vfill\vfill\vfill\vfill%
}%
%页脚
\defbeamertemplate*{footline}{footlineoff}{}
\defbeamertemplate*{footline}{footlineon}{%
\leavevmode%
\ifnum\c@framenumber=1
\else
\vspace{-0.004\paperheight}\hspace{-0.01\paperwidth}
\begin{beamercolorbox}[wd=.56\paperwidth,ht=.025\paperheight,left,dp=2ex]{section in footline}
\insertsectionnavigationhorizontal{.5\textwidth}{}{}
\end{beamercolorbox}
\begin{beamercolorbox}[wd=.25\paperwidth,right,dp=2ex]{shorttitle in footline}
\quad\insertshorttitle
\end{beamercolorbox}
\begin{beamercolorbox}[wd=.1\paperwidth,right,dp=2ex]{shortauthor in footline}
\insertshortauthor
\end{beamercolorbox}
\begin{beamercolorbox}[wd=.08\paperwidth,right,dp=2ex]{page in footline}
{\insertframenumber{}}/{\inserttotalframenumber\quad}
\end{beamercolorbox}
\fi%
}
\setbeamercolor{shorttitle in footline}{fg=white}
\setbeamercolor{section in footline}{fg=white}
\setbeamercolor{shortauthor in footline}{fg=white}
\setbeamercolor{page in footline}{fg=white}
\setbeamerfont{section in head/foot}{size={\fontsize{6}{6}}}
\setbeamercolor{section in head/foot}{fg=white,bg=themecolor}
\setbeamertemplate{section in head/foot shaded}[default][35]%被暗淡的其他标题;调节系数为fg!35!bg
%大纲页
\setbeamerfont{section in toc}{size={\fontsize{14}{14}}}
\setbeamercolor{section in toc}{fg=themecolor,bg=white}
\setbeamertemplate{section in toc shaded}[default][35]%被暗淡的其他标题;调节系数为fg!35!bg
%\setbeamerfont{section in toc}{size={\fontsize{6}{6}}}
\setbeamercolor{subsection in toc}{fg=themecolor,bg=white}
\setbeamertemplate{subsection in toc shaded}[default][35]%被暗淡的其他标题;调节系数为fg!35!bg
%beamerbaseauxtemplates.sty
\defbeamertemplate*{subsection in toc}{subsectionhorizontal}%
{\leavevmode%
\ifnum\inserttocsubsectionnumber=1
\hspace{3.7ex}%
\else
\fi
\usebeamercolor[bg]{subsection number projected}%
\vrule width1ex height1ex\kern1ex\inserttocsubsection}
\setbeamertemplate{subsection in toc}[subsectionhorizontal]