1

Goal

I'm trying to create a beamer theme where in the top we have the following layout:

________________________________________
|                       |               |
| Author & Insitute     | L O G O       |
|_______________________|_         _____|
|                         \_______/     |
| Frame Title                           |
|_______________________________________|
|                                       |
|  C O N T E N T   H E R E    . . .     |

ie. an overlapping logo.

Approaches

I have three approaches but I haven't gotten either to work:

  1. Put the Frame Title into the Head Line as well, then try to achieve the wanted layout using beamercolorbox -- but not only did I not achieve the layout, it seems that you cannot also put the Frame Title into the Head Line.
  2. Have the Head Line only contain Authorship Info and Logo, but make the latter somehow "overlap" into the stuff below, without pushing the Frame Title down.
  3. Make the Head Line vertically bigger, containing also the overlapping area, this'd mean that also the background (if existing) of the Head Line needed to be colored in two colors, because it actually just took some part of the Frame Title area-wise.

The three approaches I've tried to illustrate here:

Approach 1 Approach 1


Approach 2 Approach 2


Approach 3 Approach 3


MWE / Code

What I've done code-wise so far is:

main.tex:

\documentclass{beamer}

\usetheme{mytheme}

\title{The Title}
\author{S.~Author}
\institute{The Institute}

\usepackage{graphicx}
\pgfdeclareimage[height=0.5cm]{logo}{example-image}
\logo{\pgfuseimage{logo}}


\begin{document}

\begin{frame}[plain]
  \titlepage
\end{frame}

\begin{frame}{Outline}
  \tableofcontents
\end{frame}

\end{document}

and in my local TEXMF: tex/latex/beamertheme-mytheme/

beamerthememytheme.sty:

\mode<presentation>

\useinnertheme{mytheme}
\useoutertheme{mytheme}
\usecolortheme{mytheme}

\mode<all>

beamerouterthememytheme.sty:

\mode<presentation>

% background: transparent    
\setbeamercolor{background}{bg=}
% Grid overlay, to test alignment, 0.028 is given magic value
\setbeamertemplate{background}[grid][step=0.028\pagewidth]

\defbeamertemplate*{headline}{mytheme}
{%
    % either make headline contain
    %  1. both logo and frame title (not possible?)
    %  2. only logo, and let it somehow "grow" or "overlap" into the frame title
    %  3. only logo + some vertical space to make it seem like it's overlapping, but this would create more problems, probably.
}

\mode
<all>

Can you give me any pointers which of these might be the best approach (or if none, what would be better)? I tried searching and there might really well be a solution to this, but I think I lack the terminology for finding anything useful right now.

  • 2
    It's always a good idea to provide a minimal working example. – Dr. Manuel Kuehner Feb 18 '18 at 15:46
  • @Dr.ManuelKuehner I tried to make one but there's nothing "working" I could provide, I'm failing and even getting this layouted roughly the way as described. – larkey Feb 18 '18 at 16:38
  • Working isn't meant literally: tex.meta.stackexchange.com/questions/228. Provide a framework that only includes relevant code. – Dr. Manuel Kuehner Feb 18 '18 at 16:47
  • @Dr.ManuelKuehner Yes, but with not-working I mean, there's nothing to show but the usual boilerplate of \defbeamertemplate*{headline}. My question is about not having even an approach to how to solve this. – larkey Feb 19 '18 at 13:48
  • 1
    @larkey Even if you only have the "usual boilerplate", some ready to compile code would save us from setting up a new document form scratch. – user36296 Feb 21 '18 at 10:29
2

A bit hacky, but the basic idea is to have the logo and the coloured areas in the background. For the following example I used https://i.stack.imgur.com/XXQjl.png as image.

caveat: frames without frametitle will still have the Gray line

\documentclass{beamer}

\setbeamerfont{headline}{size=\normalfont}
\setbeamercolor{headline}{bg=white}

\setbeamertemplate{headline}{%
  \begin{beamercolorbox}[sep=0.3cm,left,wd=.67\paperwidth]{headline}
        \usebeamerfont{headline}%
        \insertshortauthor~\&~\insertshortinstitute 
  \end{beamercolorbox}%
}

\setbeamercolor{frametitle}{bg=}
\setbeamercolor{framesubtitle}{bg=gray!55!white}

\makeatletter
\setbeamertemplate{frametitle}{%
    \vspace*{-0.1cm}
  \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
  \@tempdima=\textwidth%
  \advance\@tempdima by\beamer@leftmargin%
  \advance\@tempdima by\beamer@rightmargin%
  \begin{beamercolorbox}[sep=0.3cm,left,wd=\the\@tempdima]{frametitle}
    \usebeamerfont{frametitle}%
    \vbox{}\vskip-1ex%
    \if@tempswa\else\csname beamer@fteleft\endcsname\fi%
    \strut\insertframetitle\strut\par%
   \end{beamercolorbox}
%    {%
      \ifx\insertframesubtitle\@empty%
      \else%
        \vskip-0.3cm%
        \begin{beamercolorbox}[sep=0.1cm,left,wd=\the\@tempdima]{framesubtitle} 
        {\hspace{0.2cm}\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\strut\par}%
        \end{beamercolorbox}        
      \fi
%    }%
    \vskip-1ex%
    \if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
%  \end{beamercolorbox}%
}
\makeatother

\setbeamercolor{background}{bg=}
\setbeamertemplate{background}{\includegraphics[width=\paperwidth,height=.17\paperheight]{XXQjl}}

\logo{\includegraphics[width=.2\paperwidth]{example-image}}


\title{The Title}
\author{S.~Author}
\institute{The Institute}

\begin{document}

{
\setbeamertemplate{background}{}
\begin{frame}[plain]
  \titlepage
\end{frame}
}

\begin{frame}{Outline}
  \tableofcontents
\end{frame}

\begin{frame}
\frametitle{title}
\framesubtitle{subtitle}
\end{frame}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.