3

I getting an error when I try to add a two-line frame title (first frame in MWE). Can someone please point out error here

\documentclass{beamer}
\usetheme{default}
\usecolortheme{default}
\usefonttheme{professionalfonts}
\let\familydefault\rmdefault

\begin{document}

\begin{frame}
\frametitle{\centerline{\textbf{\color{blue}{New Message \\ Hello World }}}}
\end{frame}

\begin{frame}
\frametitle{New Message\\Hello World}
\end{frame}

\end{document}
2
  • \centerline is one line, hence you need to add all closing }'s before `\` (i.e. double backlash, but SE transformed it in a strange way). Commented Aug 15, 2015 at 18:40
  • I tried \frametitle{\centerline{\textbf{\color{blue}{New Message }}}\\\centerline{\textbf{\color{blue}{Hello World }}}} but now the two are not aligned. Any idea?
    – NAASI
    Commented Aug 15, 2015 at 19:22

1 Answer 1

3

For your case you need

  • \setbeamertemplate{frametitle}[default][center] to center the frame title
  • \setbeamercolor{frametitle}{fg=blue} for blue color
  • \setbeamerfont{frametitle}{series=bfseries} to change frame title font

\documentclass{beamer}    
\usetheme{default}    
\usecolortheme{default}    
\usefonttheme{professionalfonts}    
\let\familydefault\rmdefault
\begin{document}
{  
 \setbeamertemplate{frametitle}[default][center]  
 \setbeamercolor{frametitle}{fg=blue} 
 \setbeamerfont{frametitle}{series=bfseries}   
 \begin{frame}   
 \frametitle{New Message \\ Hello World}   
 \end{frame}
}
\begin{frame}   
\frametitle{New Message\\Hello World}  
\end{frame}

\end{document}

We changed color of fg for the frametitle with \setbeamercolor{frametitle}{fg=blue} inside group containing only the fist frame.

enter image description here

You must log in to answer this question.

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