0

I would like to put 2 logos at each sides of the Rochester header with the title center in between. I've redefined \frametitle like this :

\let\oldframetitle\frametitle
\renewcommand{\frametitle}[1]{
   \oldframetitle{\centering\raisebox{3mm}{
         \begin{minipage}[c]{.15\textwidth}
                    \includegraphics[width=\textwidth]{logo/logo1.png}       
         \end{minipage}
         \hfill\parbox[c][][c]{.82\textwidth}{\centering#1}\hfill
         \begin{minipage}[c]{.15\textwidth}
                    \includegraphics[width=\textwidth]{logo/logo2.png}                   
         \end{minipage}
     }
}}

I wonder why I don't get overfull hbox since 0.15+0.82+0.15 > 1 ? Then if #1 is empty, like \begin{frame}{}, logos are sticked in the left corner. At last, it's may be not the best solution.

Thanks for help.

2

Your approach will inevitable fail as soon as you want to enjoy all the possibilities beamer offers you, such as \frametitle<2>{...} or using a \framesubtitle etc. In my opinion the better way is to add the necessary changes to the headline and frametitle template the Rochester theme uses (the code can be found in beamerouterthemesidebar.sty).

\documentclass{beamer}

\usetheme{Rochester}


\makeatletter

  \setbeamertemplate{frametitle}{%
    \nointerlineskip%
    \vskip-\beamer@headheight%
    \vbox to \beamer@headheight{%
      %\vfil
      \leftskip=-\beamer@leftmargin%
      \advance\leftskip by2.1cm%
      \rightskip=-\beamer@rightmargin%
      \advance\rightskip by2.1cm plus1fil%
      \begin{minipage}[t][\beamer@headheight][c]{\dimexpr\paperwidth-4.2cm\relax}
        \usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\centering\insertframetitle\par
        \usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par
      \end{minipage}
      \vbox{}%
      \vskip-1em%
      \vfil
    }%
  }

  \setbeamertemplate{headline}{%
    \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
      \ifx\beamer@sidebarside\beamer@lefttext%
      \else%
        \hfill%
      \fi%
      \ifdim\beamer@sidebarwidth>0pt%  
        \usebeamercolor[bg]{logo}%
        \vrule width\beamer@sidebarwidth height \beamer@headheight%
        \hskip-\beamer@sidebarwidth%
        \hbox to \beamer@sidebarwidth{\hss\vbox to
          \beamer@headheight{\vss\hbox{\color{fg}\insertlogo}\vss}\hss}%
      \else%
        \raisebox{.1\beamer@headheight}{\hspace*{0.1cm}\includegraphics[height=.8\beamer@headheight]{example-image}}
        \vrule width0pt height \beamer@headheight%  
        \hfill
        \raisebox{.1\beamer@headheight}{\includegraphics[height=.8\beamer@headheight]{example-image}}\hspace*{0.1cm}
      \fi%
    \end{beamercolorbox}
  }
\makeatother

\begin{document}

\begin{frame}
    \frametitle{frametitle}
   abc
\end{frame} 

\begin{frame}
    \frametitle{frame title frame title  frame title  frame title frame title frame title frame title}
  abc
\end{frame} 

\begin{frame}
    abc
\end{frame} 

\end{document}

enter image description here

  • Thanks, I will try to guess, but you don't really answered my questions. – dagnic Mar 21 '17 at 12:40
  • @dagnic This may not answer your question, but it solves the problem. – user36296 Mar 21 '17 at 12:43
  • Actually, no. With long title, the text flows on the right logo. That's why I used parbox. Moreover, I'm not looking for an incomprehensible "built-in" solution, but for answers to my questions. – dagnic Mar 21 '17 at 12:50
  • Well, how can I center the title ? – dagnic Mar 21 '17 at 15:22

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.