forked from ustctug/ustcbeamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathustcbeamer.sty
executable file
·175 lines (159 loc) · 6.17 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
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
\newif\ifbeamer@ustcblue
\newif\ifbeamer@ustcred
\newif\ifbeamer@black
\newif\ifbeamer@violet
\newif\ifbeamer@blue
\DeclareOption{ustcblue}{\beamer@ustcbluetrue\beamer@ustcredfalse\beamer@blackfalse\beamer@violetfalse\beamer@bluefalse}
\DeclareOption{ustcred}{\beamer@ustcbluefalse\beamer@ustcredtrue\beamer@blackfalse\beamer@violetfalse\beamer@bluefalse}
\DeclareOption{black}{\beamer@ustcbluefalse\beamer@ustcredfalse\beamer@blacktrue\beamer@violetfalse\beamer@bluefalse}
\DeclareOption{violet}{\beamer@ustcbluefalse\beamer@ustcredfalse\beamer@blackfalse\beamer@violettrue\beamer@bluefalse}
\DeclareOption{blue}{\beamer@ustcbluefalse\beamer@ustcredfalse\beamer@blackfalse\beamer@violetfalse\beamer@bluetrue}
\ExecuteOptions{ustcblue}
\ProcessOptions\relax
%定义主题七色
\definecolor{themeHong}{cmyk}{0,1,1,0}
\definecolor{themeCheng}{RGB}{247,88,33}
\definecolor{themeHuang}{RGB}{247,212,53}
\definecolor{themeLv}{RGB}{6,84,19}
\definecolor{themeLan}{cmyk}{1,0.8,0,0}
%\definecolor{themeDian}{cmyk}{}
\definecolor{themeZi}{cmyk}{0.8,1,0,0}
\ifbeamer@ustcblue
\definecolor{themecolor}{cmyk}{1,0.8,0,0} %科大蓝色
\def\ustccover{./figures/ustc_cover_1}
\def\ustcbackground{./figures/ustc_background_1}
\fi
\ifbeamer@ustcred
\definecolor{themecolor}{cmyk}{0,1,1,0} %科大红色
\def\ustccover{./figures/ustc_cover_2}
\def\ustcbackground{./figures/ustc_background_2}
\fi
\ifbeamer@black
\definecolor{themecolor}{HTML}{000000} %黑色
\def\ustccover{./figures/ustc_cover_3}
\def\ustcbackground{./figures/ustc_background_3}
\fi
\ifbeamer@violet
\definecolor{themecolor}{cmyk}{0.8,1,0,0} %紫色
\def\ustccover{./figures/ustc_cover_4}
\def\ustcbackground{./figures/ustc_background_4}
\fi
\ifbeamer@blue
\definecolor{themecolor}{cmyk}{0.95,0.45,0,0} %蓝色
\def\ustccover{./figures/ustc_cover_5}
\def\ustcbackground{./figures/ustc_background_5}
\fi
%\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]
%--------------------
%命令
%--------------------
%开始演示
\newcommand{\maketitleframe}{
%取消footline,sidebar
\setbeamertemplate{footline}[footlineoff]
%%设置本命令以后的背景如下
\usebackgroundtemplate{%
\hspace{-0.005\paperwidth}%背景文件左边有一点白
\vspace{-0.005\paperheight}%
\includegraphics[width=1.01\paperwidth,height=1.01\paperheight]{\ustccover}
}%
%封面页
\begin{frame}%
\maketitle%
\end{frame}%
%设置本命令以后的背景如下
\usebackgroundtemplate{%
\hspace{-0.005\paperwidth}%
\vspace{-0.005\paperheight}%
\includegraphics[width=1.01\paperwidth,height=1.01\paperheight]{\ustcbackground}
}%
}%
%