1

The default headline setting in the Warsaw theme in Latex Beamer is to show all the sections in the headline.When I have a lot of sections, headline can take up too much space and push some content of the slide to the edge.

enter image description here

Here is the sample code I used for creating the slides

\documentclass[12pt]{beamer}
\mode<presentation>{}
\usetheme{Warsaw}

\begin{document}

%%normal frame
\section{Introduction}

\begin{frame}{Background}

1.jpg (updated figure)
\end{frame}

\section{Data}

\begin{frame}{Data}

2.jpg (updated figure)
\end{frame}

\section{Methodology}

\begin{frame}{Identification Strategies}

3.jpg (updated figure)
\end{frame}

\section{Results}

\begin{frame}{Results}

4.jpg (updated figure)
\end{frame}

\end{document}

I would like the headline to only show the title of current section, such as "Data" or "methodology" etc.

I checked other posts on stackexchange about displaying only current section in beamer. Most answers suggest to use outer themes such as infolines or use \setbeamertemplate{headline}{} to have empty headline and then use \setbeamertemplate{headline}{\leavevmode% \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{mysection}% \hbox to .5\paperwidth{\hspace{.5em}\insertsectionhead\hfil} \end{beamercolorbox}% \vskip0pt}

to set customized headline.

Warsaw is the default theme used in my subfield. I am wondering if there is anyway to have the headline to show only the current section in the Warsaw theme as illustrated in the picture below.

enter image description here

2
  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Commented Nov 13, 2022 at 18:40
  • @samcarter_is_at_topanswers.xyz thanks for your comment! I am new to stackexchange and did not have much experience with posting with codes. I just updated the post and added the sample code used for creating the slides in the warsaw theme.
    – Aggie Sun
    Commented Nov 14, 2022 at 0:49

2 Answers 2

0

Add \useoutertheme{smoothtree}

b

\documentclass{beamer}  

\usetheme{Warsaw}   

\useoutertheme{smoothtree} % <<<<<<<<<<<<<<<<<<

\begin{document}
    
    \section{Introduction}
    \begin{frame}{Introduction}{First section}
        Start of the First section
    \end{frame}
    
    \section{Data}
    \begin{frame}{Data}{Second section}
        In the Second section
    \end{frame}
    
    \section{Methods}
    \begin{frame}{Methods}{Third section}
        In the Third section
    \end{frame}
    
    \section{Metrics}
    \begin{frame}{Metrics}{Fourth section}
        In the Fourth section
    \end{frame}
    
    \section{Results}
    
    \begin{frame}{Results}{Last section}
        Start of the Last section
    \end{frame}         
\end{document}

Or try the compress option.

a

\documentclass[compress]{beamer}    

\usetheme{Warsaw}   

\begin{document}
    
    \section{Introduction}
    \begin{frame}{Introduction}{First section}
        Start of the First section
    \end{frame}
    
    \section{Data}
    \begin{frame}{Data}{Second section}
        In the Second section
    \end{frame}
    
    \section{Methods}
    \begin{frame}{Methods}{Third section}
        In the Third section
    \end{frame}
    
    \section{Metrics}
    \begin{frame}{Metrics}{Fourth section}
        In the Fourth section
    \end{frame}
    
    \section{Results}
    
    \begin{frame}{Results}{Last section}
        Start of the Last section
    \end{frame}
    
\end{document}

If the section titles are long use \section[short title]{Full version of section title}

0

You could redefine the headline like this:

\documentclass[12pt]{beamer}
\mode<presentation>{}
\usetheme{Warsaw}

\makeatletter
\setbeamertemplate{headline}{%
  \leavevmode%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.5ex]{section in head/foot}%
    \hfill\strut\insertsectionhead\hspace{.5em}\mbox{}%
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.5ex]{subsection in head/foot}%
    \mbox{}\hspace{.5em}\strut\insertsubsectionhead\hfill%
  \end{beamercolorbox}%
}
\makeatother

\begin{document}

%%normal frame
\section{Introduction}

\begin{frame}{Background}

1.jpg (updated figure)
\end{frame}

\section{Data}

\begin{frame}{Data}

2.jpg (updated figure)
\end{frame}

\section{Methodology}

\begin{frame}{Identification Strategies}

3.jpg (updated figure)
\end{frame}

\section{Results}

\begin{frame}{Results}

4.jpg (updated figure)
\end{frame}

\end{document}

enter image description here

You must log in to answer this question.

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