samcarter
How to create a Star Trek inspired beamer theme?
Top Answer
samcarter
The following theme needs lualatex or xelatex for compilation and the `Horizon` font, which is available e.g. from https://www.myfonts.com/fonts/bitstream/horizon/
`beamerthemeStarTrek.sty`:
```
\usepackage{tikz}
\usepackage{fontspec}
% Colours %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{StarTrekYellow}{RGB}{250, 210, 35}
\setbeamercolor{structure}{fg=StarTrekYellow}
\setbeamercolor{normal text}{fg=StarTrekYellow}
\setbeamertemplate{footline}{fg=StarTrekYellow}
% Fonts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newfontfamily{\horizon}{Horizon.ttf}
\setbeamerfont{title}{family=\horizon,size=\Huge}
\setbeamerfont{author}{family=\horizon,size=\large}
\setbeamerfont{frametitle}{family=\horizon,size=\huge}
\setbeamerfont{institute}{size=\normalsize}
% Background stars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pgfmathsetseed{\number\randomseed}
\newsavebox{\backgroundstars}
\savebox{\backgroundstars}{%
\begin{tikzpicture}[remember picture, overlay]
\fill[black] (0,0) rectangle (\paperwidth,-\paperheight);
\foreach \i in {0,...,300}{
\pgfmathsetmacro{\x}{rnd}%
\pgfmathsetmacro{\y}{rnd}%
\pgfmathsetmacro{\s}{rnd}%
\fill[white!90!yellow] ({\x*\paperwidth},{-\y*\paperheight}) circle (\s*0.035);
}
\end{tikzpicture}
}
\setbeamertemplate{background}{\usebox{\backgroundstars}}
% Footline %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{page number in head/foot}[totalframenumber]
\setbeamertemplate{footline}[text line]{%
\usebeamercolor{frametitle}
$\bigstar$\hfill
\ifx\insertdate\empty\else
\insertshortdate\hfill$\bigstar$\hfill
\fi
\ifx\insertauthor\empty\else
\insertshortauthor\hfill$\bigstar$\hfill
\fi
\ifx\insertinstitute\empty\else
\insertshortinstitute\hfill$\bigstar$\hfill
\fi
\insertshorttitle\hfill$\bigstar$
}
% itemize %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{itemize item}{\scalebox{0.8}{$\bigstar$}}
\setbeamertemplate{itemize subitem}{\scalebox{0.8}{$\bigstar$}}
\setbeamertemplate{itemize subsubitem}{\scalebox{0.8}{$\bigstar$}}
\settowidth{\leftmargini}{\usebeamertemplate{itemize item}}
\addtolength{\leftmargini}{\labelsep}
% misc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{frametitle}[default][center]
```
Example for a presentation using the `StarTrek` theme:
```
% !TeX TS-program = xelatex
\documentclass{beamer}
\usetheme{StarTrek}
\title{Title}
\author{Names}
\institute{Institute}
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\begin{frame}
\frametitle{title}
content
\begin{itemize}
\item test
\begin{itemize}
\item test
\begin{itemize}
\item test
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
```
![Screen Shot 2020-08-31 at 21.58.45.png](/image?hash=f4ea134a7482e492494de0060a3b9dd78293d15a827a776b4e673640b482cdde)