# Creating my own Beamer Theme

I'm trying to create my own beamer theme based on this answer. My data till now:

beamerthemetexsx.sty

%beamerthemetexsx.sty
\mode<presentation>

% Requirement
\RequirePackage{tikz}
\RequirePackage{xcolor}

%Colour
\definecolor{aublue}{HTML}{0A1439}

% Settings
\useinnertheme{texsx}
\useoutertheme{texsx}
\usecolortheme{texsx}

\mode<all>


beamercolorthemetexsx.sty

%beamercolorthemetexsx.sty
\mode<presentation>

% Settings
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{item}{fg=orange}
% Items
\setbeamertemplate{items}[square]
\setbeamertemplate{sections/subsections in toc}[square]
\mode
<all>


beamerouterthemetexsx.sty

%beamerouterthemetexsx.sty
\mode<presentation>

\setbeamertemplate{background}{
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\fill[color=aublue] (0,0.75) rectangle (\the\paperwidth, 8);
\ifnum\thepage>1\relax%
\fill[white,opacity=1] (0,0) rectangle(\the\paperwidth,\the\paperheight);
\fi
\end{tikzpicture}
}

% Title page
\defbeamertemplate*{title page}{texsx}[1][]
{
\usebeamerfont{title}\inserttitle\par%
\end{beamercolorbox}%
\vskip0.75cm%
\begin{beamercolorbox}[wd=12cm,leftskip=3cm,#1]{author}
\usebeamerfont{author}\insertauthor%
\end{beamercolorbox}
\vskip0.2cm%
\begin{beamercolorbox}[wd=12cm,leftskip=3cm,#1]{date}
\usebeamerfont{author}\insertdate%
\end{beamercolorbox}
\vfill
}

\mode
<all>


beamerinnerthemetexsx.sty

%beamerinnerthemetexsx.sty
\mode<presentation>

% Frame title
\defbeamertemplate*{frametitle}{texsx}[1][]
{
\vskip1cm%
\begin{beamercolorbox}[wd=\paperwidth,ht=1.2cm]{frametitle}
\begin{tikzpicture}
\useasboundingbox[fill=white](0,0) rectangle(\the\paperwidth,1.2);
\fill[aublue] (0,0) rectangle(\the\paperwidth,1.5);
\ifx\insertframesubtitle\@empty%
{\node[anchor=west, white,font=\large] at (3.2,0.61){\insertframetitle};}
\else%
{\node[anchor= west, white,font=\large] at (3.2,0.81){\insertframetitle};%
\node[anchor= west, white,font=\small] at (3.2,0.41){\insertframesubtitle};}
\fi
\end{tikzpicture}
\end{beamercolorbox}
}

\mode<all>


texsx-example.tex

%texsx-example.tex
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\title{There Is No Largest Prime Number}
\date[ISPN ’80]{27th International Symposium of Prime Numbers}
\author[Euclid]{Euclid of Alexandria \texttt{euclid@alexandria.edu}}

\usetheme{texsx}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\frametitle{There Is No Largest Prime Number}
\framesubtitle{The proof uses \textit{reductio ad absurdum}.}
\begin{theorem}
There is no largest prime number. \end{theorem}
\begin{enumerate}
\item<1-| alert@1> Suppose $p$ were the largest prime number.
\item<2-> Let $q$ be the product of the first $p$ numbers.
\item<3-> Then $q+1$ is not divisible by any of them.
\item<1-> But $q + 1$ is greater than $1$, thus divisible by some prime
number not in the first $p$ numbers.
\end{enumerate}
\end{frame}

\begin{frame}{A longer title}
\begin{itemize}
\item one
\item two
\end{itemize}
\end{frame}

\end{document}


Problems

1. Outer

A picture says more than thousand words:

I would like to place the university logo (looks like a square) at point 1, the title in big at point 2 and the name of my university at point 3. I've tried a lot, but it seems like all information just wants to be in the blue field. I don't know how to fix that.

2. Inner

Next image:

I would like to move the titleframe a little more upwards (there should still be some white space). In the white space over the titleframe, I would love to have the name of my university in black, next the name of the authors in grey (all seperated by | ) at point (1).

Second, I would love to place my university logo (from the title frame) at point 2.

More Clarification

I've tried the best I can. If I get a little help, I will try more (since it's just two problems going again and again).

Thank you very much in advance!

• My output doesn't match your screenshot (no red in the title). There is also no reddish color defined in your beamercolorthemetexsx.sty. Can you double-check the file contents you posted? – erik Mar 26 '16 at 22:24
• @erik I've added all the red ereas with Gimp, because that is where I wish to add a logo or a title. :-) – Amabile Scientius Mar 26 '16 at 22:27
• The regions at the top and bottom are the headline and footline, respectively. You probably need to define separate ones for the title slide and other slides, as described in this answer. – erik Mar 26 '16 at 22:58

The following example should in principal display everything you mentioned. I redefined some of your elements, but now the positioning is very flexible. So if you want the frametitle a little bit further up, just play around with its coordinates.

[caution notice: all the coordinates are just to roughly fit our design, you might want to finetune them]

%texsx-example.tex
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\title{There Is No ...}
\date[ISPN ’80]{27th International Symposium of Prime Numbers}
\institute{My University}

\usetheme{texsx}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\frametitle{There Is No Largest Prime Number}
\framesubtitle{The proof uses \textit{reductio ad absurdum}.}
\begin{theorem}
There is no largest prime number. \end{theorem}
\begin{enumerate}
\item<1-| alert@1> Suppose $p$ were the largest prime number.
\item<2-> Let $q$ be the product of the first $p$ numbers.
\item<3-> Then $q+1$ is not divisible by any of them.
\item<1-> But $q + 1$ is greater than $1$, thus divisible by some prime
number not in the first $p$ numbers.
\end{enumerate}
\end{frame}

\begin{frame}{A longer title}
\begin{itemize}
\item one
\item two
\end{itemize}
\end{frame}

\end{document}


%beamercolorthemetexsx.sty
\mode<presentation>

% Settings
\setbeamercolor*{frametitle}{fg=white}
\setbeamercolor*{framesubtitle}{fg=white}
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{title}{fg=red}
\setbeamercolor*{institute}{fg=red}
\setbeamercolor*{item}{fg=orange}
% Items
\setbeamertemplate{items}[square]
\setbeamertemplate{sections/subsections in toc}[square]
\mode
<all>


%beamerinnerthemetexsx.sty
\mode<presentation>

% Frame title
\defbeamertemplate*{frametitle}{texsx}[1][]{
\setlength{\unitlength}{1mm}
\begin{picture}(0,0)(0,0)
%author
\put(10,2){%
\usebeamerfont{footline}
\ifx\insertinstitute\empty\else
\fi
\ifx\insertauthor\empty\else
\insertshortauthor
\fi
}%
% Blue background
\put(-10,-12){\color{aublue}\rule{\paperwidth}{12mm}}
% logo
\put(-10,-12){\includegraphics[height=12mm]{pic}}
% Title
\put(10,-8){%
\begin{minipage}[c][30mm][c]{80mm}
\ifx\insertframetitle\empty\else
\usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle\par%
\fi%
\ifx\insertframesubtitle\empty\else
\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\par%
\fi%
\end{minipage}
}
\end{picture}
}

\mode<all>


%beamerthemetexsx.sty
\mode<presentation>

% Requirement
\RequirePackage{tikz}
\RequirePackage{xcolor}

%Colour
\definecolor{aublue}{HTML}{0A1439}

% Settings
\useinnertheme{texsx}
\useoutertheme{texsx}
\usecolortheme{texsx}
\usefonttheme{texsx}

\mode<all>


%beamerouterthemetexsx.sty
\mode<presentation>

% Title page
\defbeamertemplate*{title page}{texsx}[1][]
{
\setlength{\unitlength}{1mm}
\begin{picture}(0,0)(0,0)
% Blue background
\put(-10,-46.5){\color{aublue}\rule{\paperwidth}{72mm}}
% logo
\put(0,28){\includegraphics[width=.15\textwidth]{pic}}
% Title
\put(23,32){%
\begin{minipage}[c][30mm][c]{80mm}
\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle\par%
\end{minipage}
}
% author etc
\put(23,-5){%
\begin{minipage}[c][30mm][c]{80mm}
\ifx\insertauthor\empty\else
\usebeamerfont{author}\usebeamercolor[fg]{author}\insertauthor%
\vskip0.2cm%
\fi%
\ifx\insertdate\empty\else
\usebeamerfont{author}\usebeamercolor[fg]{author}\insertdate%
\fi%
\end{minipage}
}
% author etc
\put(23,-53){%
\begin{minipage}[c][30mm][c]{80mm}
\ifx\insertinstitute\empty\else
\usebeamerfont{institute}\usebeamercolor[fg]{institute}\insertinstitute%
\fi%
\end{minipage}
}
\end{picture}
}

\mode
<all>


%beamerfontthemetexsx.sty
\mode<presentation>

\setbeamerfont{title}{series=\bfseries,size=\fontsize{18}{22}}
\setbeamerfont{footline}{size=\fontsize{6}{8}}

\mode
<all>


Here's another solution with similar result but with mostly other methods. Hopefully, both solutions are useful for anyone constructing a new theme.

Also, I used \begin{frame}[plain]\titlepage\end{frame} to get rid of the headline from the title page.

The result:

%beamerthemetexsx.sty
\mode<presentation>

% Requirement
\RequirePackage{tikz}
\RequirePackage{xcolor}

%Colour
\definecolor{aublue}{HTML}{0A1439}

%logo

% Settings
\useinnertheme{texsx}
\useoutertheme{texsx}
\usecolortheme{texsx}

\mode<all>


%beamercolorthemetexsx.sty
\mode<presentation>

% Settings
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{item}{fg=orange}
%\setbeamercolor*{logo in frametitle}{bg=magenta}
\setbeamercolor*{titleframe}{bg=aublue,fg=white}
\setbeamercolor*{framesubtitle}{fg=white}
% Items
\setbeamertemplate{items}[square]
\setbeamertemplate{sections/subsections in toc}[square]
\mode
<all>


%beamerouterthemetexsx.sty
\mode<presentation>

\setbeamertemplate{background}{
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\fill[color=aublue] (0,0.75) rectangle (\the\paperwidth,8);
\ifnum\thepage>1\relax%
\fill[white,opacity=1] (0,0) rectangle(\the\paperwidth,\the\paperheight);
\fi
\end{tikzpicture}
}

% Title page
\defbeamertemplate*{title page}{texsx}[1][]
{\vskip5pt\leavevmode%
\pgfuseimage{Logo}%Inserts logo here, the logo is loaded in beamerthemetexsx.sty (so that the logo can be used both in the inner and outer theme)
\end{beamercolorbox}%
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty\vskip1.5em%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip0.75cm%
\begin{beamercolorbox}[wd=12cm,leftskip=3cm,#1]{author}
\usebeamerfont{author}\insertauthor%
\end{beamercolorbox}
\vskip0.2cm%
\begin{beamercolorbox}[wd=12cm,leftskip=3cm,#1]{date}
\usebeamerfont{author}\insertdate%
\end{beamercolorbox}
\vskip6cm%
\begin{beamercolorbox}[wd=12cm,leftskip=3cm,#1,center%center centers the content in the box (horizontally)
]{institute}
\usebeamerfont{author}\strut\insertinstitute\strut%
\end{beamercolorbox}
}

\mode
<all>


%beamerinnerthemetexsx.sty
\mode<presentation>

{%\leavevmode%
\begin{beamercolorbox}[leftskip=.1\paperwidth,%
\end{beamercolorbox}%
% \vskip-1.95pt %if the background of "info in head" is set to something else than white, this line can be used to remove the whitespace
}

\defbeamertemplate*{frametitle}{texsx}[1][]
{\leavevmode%
\begin{beamercolorbox}[wd=.1\paperwidth,%INPUT SUITABLE WIDTH
ht=1.5cm,dp=0cm,#1]{logo in frametitle}%
\vbox{}\hspace*{-\Gm@lmargin}\pgfuseimage{Logo}%\Gm@lmargin is the left text margin, the logo is loaded in beamerthemetexsx.sty
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.9\paperwidth,%INPUT SUITABLE WIDTH
ht=1.5cm,dp=0cm,sep=5pt,#1]{titleframe}%dp=depth,ht=height, wd=width.
\usebeamerfont{frametitle}\strut\insertframetitle\strut\par%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\strut\insertframesubtitle\strut}%
\fi%
\end{beamercolorbox}%=
}

\mode<all>