-
Notifications
You must be signed in to change notification settings - Fork 52
/
beamerouterthemexjtubeamer.sty
250 lines (228 loc) · 7.37 KB
/
beamerouterthemexjtubeamer.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
%%
%% Copyright 2016-2023 Obster-Y
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Obster-Y.
%%
%% This work contains source codes from `beamerouterthemesjtubeamer.dtx' devloped
%% by sjtuG and distributed under Apache License V2.0
%%
%% This work consists of the files beamerouterthemexjtubeamer.sty.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthemexjtubeamer}[2023/05/28 v1.0.0 xjtubeamer outer theme]
%%%%%%%%%%%%%
%% OPTIONS %%
%%%%%%%%%%%%%
\DefineOption{outer}{nav}{miniframes}
\DefineOption{outer}{nav}{infolines}
\DefineOption{outer}{nav}{sidebar}
\DefineOption{outer}{nav}{default}
\DefineOption{outer}{nav}{smoothbars}
\DefineOption{outer}{nav}{split}
\DefineOption{outer}{nav}{shadow}
\DefineOption{outer}{nav}{tree}
\DefineOption{outer}{nav}{smoothtree}
\ExecuteOptionsBeamer{miniframes}
\DefineOption{outer}{logopos}{topright}
\DefineOption{outer}{logopos}{bottomright}
\ExecuteOptionsBeamer{bottomright}
\ProcessOptionsBeamer
\beamer@compresstrue
\if\EqualOption{outer}{logopos}{topright}
\AtBeginDocument{
\defbeamertemplate*{frametitle}{xjtubeamer}[1][]
{%
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\@tempdima=\textwidth%
\advance\@tempdima by\beamer@leftmargin%
\advance\@tempdima by\beamer@rightmargin%
\begin{beamercolorbox}[sep=0.15cm,leftskip=0.15cm,#1,wd=\the\@tempdima]{frametitle}
\begingroup
\usebeamerfont{frametitle}
\vbox{}
\ifx\insertframesubtitle\@empty\vskip-0.5ex%
\else\vskip-0.7ex\fi%
\if@tempswa\else\csname beamer@fte#1\endcsname\fi%
\strut\insertframetitle\strut\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{
\usebeamerfont{framesubtitle}
\usebeamercolor[fg]{framesubtitle}
\strut\insertframesubtitle\strut\par
}%
\fi
}%
\vskip-1.07ex%
\endgroup%
\raggedleft%
\begingroup
\ifx\insertframesubtitle\@empty\vskip-2.2ex%
\else\vskip-3.05ex\fi%
\resizebox{!}{3ex}{\vphantom{-}\usebeamertemplate{logo}}\hspace*{10pt}%
\endgroup%
\ifx\insertframesubtitle\@empty%
\else\vskip0.75ex\fi%
\if@tempswa\else\vskip-.3cm\fi%
\end{beamercolorbox}%
\vspace*{-.7cm}
}
}
\if\EqualOption{outer}{nav}{default}
\AtBeginDocument{
\setbeamertemplate{frametitle}[xjtubeamer][leftskip=0cm,sep=0.3cm]
}
\fi
\fi
%%%%%%%%%%%%%%%%%%%%
%% NAVIGATION BAR %%
%%%%%%%%%%%%%%%%%%%%
\if\EqualOption{outer}{nav}{miniframes}
\useoutertheme[footline=authortitle]{miniframes}
\else
\if\EqualOption{outer}{nav}{sidebar}
\useoutertheme{sidebar}
\logo{\resizebox{!}{1cm}{\xjtubadge}}
\def\xjtubeamer@outer@logopos{topright}
\AtBeginDocument{
\setbeamertemplate{frametitle}[sidebar theme]
}
\else
\useoutertheme{\xjtubeamer@outer@nav}
\setbeamercolor{title in head/foot}{use=structure,bg=white,fg=structure.fg}
\fi
\fi
\if\EqualOption{outer}{nav}{default}
\setbeamercolor{frametitle}{use=palette primary,
bg=palette primary.bg,fg=palette primary.fg}
\else
\if\EqualOption{outer}{nav}{infolines}
\setbeamercolor{author in head/foot}{use=structure,fg=white,bg=structure}
\setbeamercolor{title in head/foot}{use=structure,fg=structure,bg=structure!10}
\setbeamercolor{date in head/foot}{use=structure,fg=structure,bg=structure!20}
\setbeamercolor{section in head/foot}{parent=author in head/foot}
\setbeamercolor{subsection in head/foot}{parent=date in head/foot}
\setbeamersize{text margin left=1cm,text margin right=1cm}
\else
\setbeamercolor{frametitle}{use=titlelike,bg=white,fg=titlelike.fg}
\setbeamercolor{frametitle right}{parent=subsection in head/foot}
\fi
\fi
\setbeamertemplate{sidebar right}{}
\setbeamertemplate{page number in head/foot}{}
% % ADD PAGE NUMBER TO NAVIGATION BAR
% \addtobeamertemplate{navigation symbols}{}{
% \hbox{
% \raisebox{1.2pt}[0pt][0pt]{
% \usebeamerfont{footline}
% \usebeamercolor{footline}
% \color{footline.fg!50}
% \sffamily
% \insertframenumber/\inserttotalframenumber
% \hspace*{0.2em}
% }
% }
% }
\if\EqualOption{outer}{logopos}{bottomright}
\addtobeamertemplate{footline}{
\hfill%
\usebeamertemplate***{navigation symbols}%
\llap{\raisebox{1pc}[0pt][0pt]{\insertlogo}}
\hspace*{0.1cm}\par
\vskip 4pt
}{}
\else
\addtobeamertemplate{footline}{
\hfill%
\usebeamertemplate***{navigation symbols}%
\hspace*{0.1cm}\par
\vskip 4pt
}{}
\fi
%%%%%%%%%%%%%%%
%% HEADLINES %%
%%%%%%%%%%%%%%%
\setbeamertemplate{headline}{%
\begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[
wd=\paperwidth,%
dp=2.5ex,%
ht=2.5ex,%
leftskip=.3cm,
rightskip=.3cm plus1fil
]{section in head/foot}
\usebeamerfont{section in head/foot}
\insertnavigation{.93\paperwidth}
\end{beamercolorbox}
\begin{beamercolorbox}[
wd=\paperwidth,
dp=1.125ex,
ht=2.5ex,%
leftskip=.3cm,
rightskip=.3cm plus1fil
]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}%
% \insertsubsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
\insertsubsectionhead
\setbox\beamer@tempbox=\hbox{\insertsubsubsectionhead}%
\ifdim\wd\beamer@tempbox>1pt%
:%
% \ \raise1.9pt\hbox{\vrule width 5pt height0.4pt}\ %
\hskip1pt%
\fi%
\insertsubsubsectionhead
\end{beamercolorbox}
\begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}
%%%%%%%%%%%%%%%
%% FOOTLINES %%
%%%%%%%%%%%%%%%
\setbeamertemplate{footline}{%
\begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,left]{title in head/foot}%
\usebeamerfont{title in head/foot}
\inserttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.3\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamercolor{navigation symbols in head/foot}%
\raisebox{-1.5pt}[0pt][0pt]{
\insertslidenavigationsymbol%
\insertframenavigationsymbol%
\insertsubsectionnavigationsymbol%
\insertsectionnavigationsymbol%
\insertdocnavigationsymbol%
\insertbackfindforwardnavigationsymbol%
}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamercolor{navigation symbols in head/foot}%
\insertframenumber/\inserttotalframenumber
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamercolor{author in head/foot}
\insertauthor
\hspace*{0.1cm}
\end{beamercolorbox}%
}%
\vskip0pt%
\begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}
\endinput
%% EOF: beamerouterthemexjtubeamer.sty