4

I am trying to change the vertical and horizontal positions of my frame titles and subtitles. So far I am using

\setbeamertemplate{frametitle}[default][center]

but I would like more control. Is it possible to define a shift to the right using mm or pixels in place of the center argument?

Cheers!

7

\setbeamertemplate{frametitle}[default] is defined in beamerouterthemedefault.sty. If you take the definition from there, you can redefine it according to your needs. For example add a shift with \hspace*{1cm}:

\documentclass{beamer}

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

\begin{document}


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

\end{document}
  • Hi, thanks for this solution it works great for the frame title, how can I also readjust the frame subtitle position if the frame has one? – QuantumPenguin Apr 26 '16 at 16:43
  • @QuantumPenguin As frametitle and framesubtitle are in the same beamercolorbox they both move if you add the \hspace outside from the box. Can you show an example of what additional adjustments you want? – user36296 Apr 26 '16 at 16:46
  • Yes, you are right. Sorry, what I meant is, is it possible to left justify the the Frame title Frame Subtitles with each-other? – QuantumPenguin Apr 26 '16 at 18:43
  • 1
    @QuantumPenguin Maybe put both inside a minipage or similar. But you might have to think about the width of it. – user36296 Apr 26 '16 at 19:38

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.