14

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!

1 Answer 1

12

\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}
4
  • 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?
    – user27119
    Commented Apr 26, 2016 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? Commented Apr 26, 2016 at 16:46
  • 1
    Yes, you are right. Sorry, what I meant is, is it possible to left justify the the Frame title Frame Subtitles with each-other?
    – user27119
    Commented Apr 26, 2016 at 18:43
  • 1
    @QuantumPenguin Maybe put both inside a minipage or similar. But you might have to think about the width of it. Commented Apr 26, 2016 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .