% Copyright 2021 by Jan Benda
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.

\ProvidesPackage{beamerinnerthemelines}[2021/02/28 inner theme for beamer with lines in title page]

\mode<presentation>

\RequirePackage{tikz}


% itemize and enumerate symbols:
\defbeamertemplate{itemize item}{arrow}{%
  \begin{tikzpicture}
    \draw[line width=0.2ex] (0ex, 0ex) -- (0.7ex,0.7ex) -- (0ex, 1.4ex);
  \end{tikzpicture}}

\setbeamertemplate{itemize item}[arrow]      % default, triangle, circle, square, ball
\setbeamertemplate{enumerate item}[default]  % default, circle, square, ball


% block environments:
\setbeamertemplate{blocks}[default]


%%%%% title page %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\defbeamertemplate{title page line}{default}[1][1ex]%
{
  \ifbeamercolorempty[fg]{title page line}{}{%
    \nointerlineskip%
    \begin{beamercolorbox}[wd=1\textwidth,dp=0pt,ht=#1,sep=0pt]{title page line}%
      \rule{1\linewidth}{#1}%
    \end{beamercolorbox}%
  }%
}

\setbeamertemplate{title page line}[default][1.5ex]

\defbeamertemplate{title page author and}{space}{\def\beamer@andtitle{\quad}}
\defbeamertemplate{title page author and}{comma}{\def\beamer@andtitle{,\quad}}
\defbeamertemplate{title page author and}{line}{\def\beamer@andtitle{$\;\;\vert\;\;\;$}}
\defbeamertemplate{title page author and}{and}{\def\beamer@andtitle{$\;$\&$\;\;$}}

\setbeamertemplate{title page author and}[line]

\defbeamertemplate{title page institute and}{space}{\def\beamer@andinst{\quad}}
\defbeamertemplate{title page institute and}{comma}{\def\beamer@andinst{,\quad}}
\defbeamertemplate{title page institute and}{line}{\def\beamer@andinst{$\;\;\vert\;\;\;$}}

\setbeamertemplate{title page institute and}[line]

% title page: lines
\defbeamertemplate*{title page}{lines}
{
  \vbox{}
  \includegraphics[height=6ex]{UT_MNF_RGB}\\[1.2ex]
  \usebeamertemplate{frametitle line}%
  \vspace{1ex}
  {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
  \usebeamertemplate{title page line}%
  \vfill\vfill\vfill
  \begin{beamercolorbox}{title}
    \usebeamerfont{title}\inserttitle\par%
  \end{beamercolorbox}%
  \vfill\vfill
  \begin{beamercolorbox}{author}
    \usebeamertemplate{title page author and}%
    \usebeamerfont{author}\insertauthor
  \end{beamercolorbox}
  \vfill
  \begin{beamercolorbox}{institute}
    \usebeamertemplate{title page institute and}%
    \usebeamerfont{institute}\insertinstitute
  \end{beamercolorbox}
}

\setbeamertemplate{title page}[lines]


%%%%% section page %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% section page separator: space

\defbeamertemplate{section name separator}{space}{}

% section page separator: text

\defbeamertemplate{section name separator}{text}[1][1pt]%
{
  {\usebeamercolor[fg]{section name separator}
    \rule[-0.5ex]{#1}{2.4ex}}
}

\setbeamertemplate{section name separator}[text][1pt]

% section page: left

\defbeamertemplate{section page}{left}%
{
  \begin{columns}[t,onlytextwidth]
    \begin{column}{0.1\textwidth}
      \usebeamerfont{section name}%
      \raggedleft{\usebeamercolor[fg]{section name}%
        \makebox[0.5\linewidth][r]{\insertsectionnumber}%
        \makebox[0.5\linewidth][c]{\usebeamertemplate{section name separator}}}%
    \end{column}
    \begin{column}{0.9\textwidth}
      \usebeamerfont{section title}%
      {\usebeamercolor[fg]{section title} \insertsection}%
    \end{column}
  \end{columns}
}

% start each section with a special slide:
\AtBeginSection{
  \frame[plain,c]{\sectionpage}
}

\setbeamertemplate{section page}[left]

\mode<all>
