2

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}
  • \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). – Przemysław Scherwentke Aug 15 '15 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 Aug 15 '15 at 19:22
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

| improve this answer | |

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.