-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunisa.sty
More file actions
188 lines (161 loc) · 7.16 KB
/
unisa.sty
File metadata and controls
188 lines (161 loc) · 7.16 KB
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
% Custom Beamer Style File
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mystyle}[2024/12/11 Custom Beamer Style]
% Required packages
\RequirePackage{tikz}
\usetikzlibrary{positioning}
\RequirePackage{xcolor}
\RequirePackage{graphicx}
\usepackage{adjustbox}
% Color definitions
\definecolor{progressblue}{HTML}{00008B} % Dark Blue
\definecolor{progressgrey}{HTML}{D3D3D3} % Light Grey
\definecolor{footerorange}{HTML}{FFA500} % Orange
% Command for footer text that handles citations properly
\newcommand{\footertext}[1]{%
\gdef\customfoottext{\vspace*{-0.4cm}#1}%
}
% Command for footer citations only
\newcommand{\footfullcite}[1]{%
\footertext{\fullcite{#1}}%
}
\makeatletter
\gdef\@nofooterstate{0}
\newcommand{\nofooterframe}{\gdef\@nofooterstate{1}}
\BeforeBeginEnvironment{frame}{\gdef\@nofooterstate{0}}
\makeatother
% Remove navigation symbols
\setbeamertemplate{navigation symbols}{}
% Command for both inline citation and footer full citation (authoryear style)
\newcommand{\citewithfooter}[1]{%
\cite{#1}%
\footertext{\fullcite{#1}}%
}
% Command for bracket-number citation with numbered footer (numeric style)
\newcommand{\citefoot}[1]{%
\cite{#1}%
\footertext{\cite{#1}~\fullcite{#1}}%
}
% Auto-clear footer before every frame; content can re-set it if needed
\BeforeBeginEnvironment{frame}{%
\gdef\customfoottext{}%
}
% Footnote counter (resets per frame via auto-clear hook)
\newcounter{customfootnotectr}
\BeforeBeginEnvironment{frame}{\setcounter{customfootnotectr}{0}}
% Override footnote to show superscript number inline and text in footer
\renewcommand{\footnote}[1]{%
\stepcounter{customfootnotectr}%
\textsuperscript{\thecustomfootnotectr}%
\footertext{\textsuperscript{\thecustomfootnotectr}\,#1}%
}
\footertext{} % Default empty footer text
% Full-page image title slide with dark orange background
\newcommand{\titlebackground}[1]{%
{
\setbeamertemplate{background canvas}{%
\begin{tikzpicture}[remember picture,overlay]
% Set dark blue background color for the first slide
\fill[progressblue] (current page.south west) rectangle (current page.north east);
\node[anchor=center, opacity=0.9] at (current page.center) {\includegraphics[height=\paperheight]{#1}};
\node[anchor=north west, xshift=8pt, yshift=0pt] at (current page.north west) {\includegraphics[width=48px]{unisa_written_logo}};
\node[anchor=south east, xshift=-60pt, yshift=10pt] at (current page.south east) {\includegraphics[width=35px]{doinf}};
\node[anchor=south east, xshift=-8pt, yshift=12pt] at (current page.south east) {\includegraphics[width=48px]{isslab}};
\node[anchor=south east, xshift=-100pt, yshift=10pt] at (current page.south east) {\includegraphics[width=35px]{unisa.png}};
\end{tikzpicture}
}%
\begin{frame}[plain]
\begin{tikzpicture}[remember picture, overlay]
% Create the text content first to measure its height
\node[anchor=center, text width=0.9\paperwidth, align=center, inner sep=1.5em] at (current page.center) (textbox) {
\color{white}
\textbf{\Huge \usebeamerfont{title}\inserttitle}\\[0.5em]
\usebeamerfont{author}\insertauthor\\[0.5em]
\usebeamerfont{date}\insertdate
};
% Draw the orange background with full page width but fitting text height
\fill[footerorange, opacity=0.7] (current page.west |- textbox.south) rectangle (current page.east |- textbox.north);
% Redraw the text on top of the background
\node[anchor=center, text width=0.9\paperwidth, align=center, inner sep=1.5em] at (current page.center) {
\color{white}
\textbf{\Huge \usebeamerfont{title}\inserttitle}\\[0.5em]
\usebeamerfont{author}\insertauthor\\[0.5em]
\usebeamerfont{date}\insertdate
};
\end{tikzpicture}
\end{frame}
\setbeamertemplate{background canvas}[default] % Reset template
}
}
% Section title page with subtle blue tint
\newcommand{\makesection}[1]{%
\begin{frame}[plain]
\begin{tikzpicture}[remember picture,overlay]
% Orange background
\fill[footerorange,opacity=0.9] (current page.south west) rectangle (current page.north east);
% Progress bar at the bottom
\fill[progressgrey] (current page.south west) rectangle ([xshift=\paperwidth, yshift=0.05cm]current page.south west);
% Calculate progress safely
\pgfmathsetmacro{\progress}{0}
\ifnum\inserttotalframenumber>1
\ifnum\insertframenumber>1
\pgfmathsetmacro{\progress}{(\insertframenumber - 1) / (\inserttotalframenumber - 1)}
\fi
\fi
% Only draw if progress is valid and positive
\ifdim\progress pt>0pt
\fill[progressblue] (current page.south west) rectangle
([xshift=\progress\paperwidth, yshift=0.05cm]current page.south west);
\fi
\end{tikzpicture}
\begin{center}
\usebeamerfont{frametitle}
\Large\textbf{#1}
\end{center}
\end{frame}
}
% Add footer and progress bar to footline
\makeatletter
\setbeamertemplate{footline}{%
\ifnum\@nofooterstate=1\relax
\else
\begin{beamercolorbox}[wd=\paperwidth,ht=0.7cm,dp=0.3cm,leftskip=0.3cm,rightskip=0.3cm]{footerorange}
% Logo on the far left
\raisebox{-0.25cm}[0cm][0cm]{\includegraphics[height=0.85cm]{unisa.png}}%
% Footnote text positioned to the right of logo with spacing, left-aligned but vertically centered
\hspace{0.5cm}%
\begin{minipage}[c][0.7cm][c]{0.75\paperwidth}
\raggedright
\usebeamerfont{footline}\ifx\customfoottext\@empty\hspace{0pt}\else\customfoottext\fi
\end{minipage}%
% Push page number to the right and align higher
\hfill
\raisebox{-0.1cm}[0cm][0cm]{\usebeamerfont{footline}\insertframenumber}
\end{beamercolorbox}%
\begin{tikzpicture}[remember picture,overlay]
\fill[progressgrey] (0,0) rectangle (\paperwidth,0.05cm);
% Calculate progress safely
\pgfmathsetmacro{\progress}{0}
\ifnum\inserttotalframenumber>1
\ifnum\insertframenumber>1
\pgfmathsetmacro{\progress}{(\insertframenumber - 1) / (\inserttotalframenumber - 1)}
\fi
\fi
% Only draw if progress is valid and positive
\ifdim\progress pt>0pt
\fill[progressblue] (0,0) rectangle ({\progress\paperwidth},0.05cm);
\fi
\end{tikzpicture}%
\fi
}
\makeatother
% Color theme
\setbeamercolor{background canvas}{bg=white}
\setbeamercolor{footerorange}{fg=black,bg=footerorange}
\setbeamercolor{progressblue}{bg=progressblue}
\setbeamercolor{progressgrey}{bg=progressgrey}
\setbeamercolor*{normal text}{fg=black}
\setbeamercolor*{alerted text}{fg=red}
\setbeamercolor*{example text}{fg=green!50!black}
\mode<presentation>
\endinput