summaryrefslogtreecommitdiff
path: root/beamerthemeOptics.sty
blob: 6df7188d3fa0829b253558edee291fcf10875d4c (plain)
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
% Optics Beamer Theme
% Author: admin
% Usage: \usetheme{Optics}
% Optics Beamer Theme
% Professional minimal theme which I use for optics presentations
% Author: admin
% Usage: \usetheme{Optics}


\mode<presentation>
\usepackage[default]{lato}
\usepackage[T1]{fontenc}

% Base theme
\usetheme{default}
\usecolortheme{default}

% Improved color palette
\definecolor{primary}{RGB}{20,40,120}      % Darker blue for better contrast
\definecolor{secondary}{RGB}{95,95,95}     % Professional gray
\definecolor{accent}{RGB}{0,82,155}        % Accessible blue
\definecolor{lightgray}{RGB}{248,249,250}  % Very light gray for backgrounds

% Keep original darkblue for compatibility
\definecolor{darkblue}{RGB}{20,40,120}
\newcommand{\descr}[1]{{\footnotesize\color{secondary}#1}}

% Remove navigation symbols
\setbeamertemplate{navigation symbols}{}
% Captions
\setbeamerfont{caption}{size=\tiny}
\setbeamerfont{caption name}{size=\tiny} 
\setbeamertemplate{caption}{\tiny\color{darkblue}\insertcaptionname~\insertcaptionnumber: \color{black}\insertcaption}
\setlength{\abovecaptionskip}{-6pt}
\setlength{\belowcaptionskip}{6pt}

% Clean header with presentation title in dark blue
\setbeamertemplate{headline}{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1ex]{title in head/foot}%
    \usebeamerfont{title in head/foot}%
    \begin{minipage}[c]{0.5\paperwidth}%
      \color{darkblue}\hspace{1em}\insertsection%
    \end{minipage}%
    \begin{minipage}[c]{0.5\paperwidth}%
      \raggedleft%
      \ifnum\value{framenumber}>1% Only show author after title page
        \color{darkblue}%
        \ifx\insertemail\empty%
          \insertauthor\hspace{1em}%
        \else%
              \href{mailto:\insertemail}{\faEnvelope\ \insertauthor}\hspace{1em}%
        \fi%
      \fi%
    \end{minipage}%
  \end{beamercolorbox}%
  \vskip0pt%
  % \begin{beamercolorbox}[wd=\paperwidth,ht=0.5pt]{primary}%
  %   \color{darkblue}\hrule height 0.5pt%
  % \end{beamercolorbox}%
}

% Custom command for location
\newcommand{\location}[1]{\def\insertlocation{#1}}
\location{} % Default empty
\newcommand{\email}[1]{\def\insertemail{#1}}
\email{} % Default empty

% Custom title page with location
\setbeamertemplate{title page}{%
  \vbox{}
  \vfill
  \begingroup
    \centering
    \begin{beamercolorbox}[sep=8pt,center]{title}
      \usebeamerfont{title}\color{darkblue}\bfseries\inserttitle\par%
      \ifx\insertsubtitle\@empty%
      \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\insertsubtitle\par}%
      \fi%     
    \end{beamercolorbox}%
    \vskip1em\par
    \begin{beamercolorbox}[sep=8pt,center]{author}
      \usebeamerfont{author}%
      \ifx\insertemail\empty%
        \insertauthor%
      \else%
            \href{mailto:\insertemail}{\faEnvelope\ \insertauthor}%
      \fi%
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center]{date}
        \usebeamerfont{date}\textit{\insertdate}
      \ifx\insertlocation\empty%
      \else%
        \par\vskip0.25em%
        \insertlocation%
      \fi%
    \end{beamercolorbox}
  \endgroup
  \vfill
}

% Enhanced footer with title, date, location, and page numbers
\setbeamertemplate{footline}{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=0.5pt]{primary}%
    \color{darkblue}\hrule height 0.5pt%
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1ex]{title in head/foot}%
    \usebeamerfont{title in head/foot}%
    \color{secondary}%
    \begin{minipage}[c]{0.33\paperwidth}%
      \hspace{1em}\insertshorttitle : \insertsubtitle%
    \end{minipage}%
    \begin{minipage}[c]{0.34\paperwidth}%
      \centering%
      \ifx\insertlocation\empty%
        \insertdate%
      \else%
        \insertdate\ $\cdot$ \insertlocation%
      \fi%
    \end{minipage}%
    \begin{minipage}[c]{0.33\paperwidth}%
      \raggedleft%
      \insertframenumber{} / \inserttotalframenumber\hspace{1em}%
    \end{minipage}%
  \end{beamercolorbox}%
}

% Frame title with dark blue and underline
% Fixed positioning for consistency
\setbeamertemplate{frametitle}{%
  \nointerlineskip%
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.2ex,dp=0.8ex,leftskip=1em]{frametitle}%
    \usebeamerfont{frametitle}\color{darkblue}\bfseries\Large\insertframetitle%
  \end{beamercolorbox}%
  \nointerlineskip%
  \begin{beamercolorbox}[wd=\paperwidth,ht=0.1pt,dp=0pt,leftskip=1em,rightskip=1em]{frametitle}%
    \color{darkblue}\hrule height 0.8pt%
  \end{beamercolorbox}%
    \vspace{-0.8em}%
}

% List items
\setbeamertemplate{itemize item}{\raisebox{0.2ex}{\textcolor{accent}{\rule{0.4em}{0.4em}}}\hspace{0.3em}}
\setbeamertemplate{itemize subitem}{\raisebox{0.2ex}{\textcolor{darkblue}{\textbullet}}\hspace{0.3em}}
\setbeamertemplate{itemize subsubitem}{\raisebox{0.1ex}{\textcolor{darkblue}{--}}\hspace{0.3em}}

% Improved spacing for readability
\setlength{\leftmargini}{1.5em}
\setlength{\leftmarginii}{1.2em}
\setbeamertemplate{itemize/enumerate body begin}{\vspace{0.5em}}
\setbeamertemplate{itemize/enumerate body end}{\vspace{0.3em}}

% Add space between items
\let\olditem\item
\renewcommand{\item}{\olditem\vspace{0.4em}}

% Table of contents customization
\setbeamertemplate{section in toc}{\Large\bfseries\color{darkblue}\inserttocsection}
\setbeamertemplate{section in toc shaded}{\Large\bfseries\color{secondary}\inserttocsection}
\setbeamertemplate{subsection in toc}{\normalsize\par\hspace{1.2em}$\bullet$~\inserttocsubsection}
\setbeamertemplate{subsection in toc shaded}{\normalsize\par\hspace{1.2em}\color{secondary}$\bullet$~\inserttocsubsection}

% Color Scheme
\setbeamercolor{title}{fg=darkblue}
\setbeamercolor{frametitle}{fg=darkblue,bg=white}
\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{item}{fg=darkblue}
\setbeamercolor{title in head/foot}{fg=darkblue}

% Bibliography formatting
\setbeamercolor{bibliography entry author}{fg=darkblue}
\setbeamercolor{bibliography entry title}{fg=black}
\setbeamercolor{bibliography entry location}{fg=gray}
\setbeamercolor{bibliography entry note}{fg=gray}
\setbeamertemplate{bibliography item}{\insertbiblabel}

\AtBeginSection[ ]
{
\begingroup
\def\insertsection{}
\begin{frame}{Contents}
    \tableofcontents[currentsection,hideallsubsections]
\end{frame}
\endgroup
}
\addtobeamertemplate{frame begin}{%
  \ifx\insertsubsectionhead\empty%
  \else%
    \frametitle{\insertsubsectionhead}%
  \fi%
}{}
\mode<all>
Back to https://optics-design.com