beamer add tag
Dr. Manuel Kuehner
* This question is related to https://topanswers.xyz/tex?q=2004.
* I love the `beamer` theme `metropolis` and have a question regarding using `\appendix`.
* **Problem:** I need the navigation be visible in teh appendix part, by default it is empty, see first screenshot.

![image.png](/image?hash=05351abfab6857ac5cb045f499759e41853ebecb26e613c7aa56e9fa71a60671)

*(No navigation visible in appendix.)*

---

![image.png](/image?hash=d8d993c8115cfb0189b746eb64dcb07572a19ab2e53d0e7b0d6b1d4db7d2e4da)

*(Navigation visible in normal part.)*

```
% Based on https://topanswers.xyz/tex?q=2004 (samcarter)
\documentclass{beamer}

\usetheme[
	background = dark
]{metropolis}

\usepackage{noto}

\setbeamertemplate{headline}{%
  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
    \vskip1pt\strut \insertsectionnavigationhorizontal{\paperwidth}{}{} \vskip1pt % @samcarter: I inserted \strut to reserve the space for a fill line width
    \vskip1pt\strut \insertsubsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll} \vskip3pt
  \end{beamercolorbox}%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}
}

\makeatletter
\def\sectionentry#1#2#3#4#5{% section number, section title, page
  \beamer@xpos=0\relax%
  \beamer@ypos=1\relax%
  \beamer@ypos@offset=0\relax%
  \ifnum#5=\c@part%
  \beamer@section@set@min@width%
  \box\beamer@sectionbox\hskip1.875ex plus 1fill%
  \setbox\beamer@sectionbox=
  \hbox{\def\insertsectionhead{#2}%
    \def\insertsectionheadnumber{#1}%
    \def\insertpartheadnumber{#5}%
    {%
%      \usebeamerfont{section in head/foot}
      \usebeamercolor[fg]{section in head/foot}%
      \ifnum\c@section=#1%
        \usebeamerfont{section in head/foot}%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot}}}%
      \else%
        \usebeamerfont{section in head/foot shaded}%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}%
      \fi}%
  }%
  \ht\beamer@sectionbox=1.875ex%
  \dp\beamer@sectionbox=0.75ex%
  \fi\ignorespaces}
  
\def\insertsubsectionnavigationhorizontal#1#2#3{%
  \hbox to #1{{%
%    \usebeamerfont{subsection in head/foot}
    \usebeamercolor[fg]{subsection in head/foot}%
    \beamer@currentsubsection=0%
    \def\sectionentry##1##2##3##4##5{}%
    \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\c@section%
      \ifnum##2>\beamer@currentsubsection%
      \beamer@currentsubsection=##2%
      \box\beamer@sectionbox\hskip1.875ex plus1fill%
      \setbox\beamer@sectionbox=
      \hbox{\def\insertsubsectionhead{##5}%
         \def\insertsectionheadnumber{##1}%
         \def\insertsubsectionheadnumber{##2}%
         \def\insertpartheadnumber{##6}%
         \ifnum\c@subsection=##2%
        \beamer@link(##4){{\usebeamerfont{subsection in head/foot}\usebeamertemplate{subsection in head/foot}}}\else%
        \beamer@link(##4){{\usebeamerfont{subsection in head/foot shaded}\usebeamertemplate{subsection in head/foot shaded}}}\fi}%
      \ht\beamer@sectionbox=1.875ex%
      \dp\beamer@sectionbox=0.75ex%
      \fi\fi\fi\ignorespaces}%
    #2\hskip.3cm\setbox\beamer@sectionbox=\hbox{}%
    \hskip-1.875ex plus-1fill\dohead%
    \box\beamer@sectionbox\hfil\hskip.3cm%
    #3}}}


\makeatother

% My attempts to make it happen
% ---
\setbeamerfont{section in head/foot}{series=\bfseries}
\setbeamerfont{section in head/foot shaded}{series=\normalfont}

\setbeamerfont{subsection in head/foot}{series=\bfseries}
\setbeamerfont{subsection in head/foot shaded}{series=\normalfont}

\setbeamercolor{section in head/foot}{bg=normal text.bg, fg=structure.fg}
\setbeamercolor{subsection in head/foot}{bg=normal text.bg, fg=structure.fg}
 % ---

\begin{document}

\section{section 1}
\subsection{subsection}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\section{section 2}
\subsection{subsection 1}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\subsection{subsection 2}
\begin{frame}
\frametitle{blub}
    abc test
\end{frame} 

\appendix

\section{section A}
\subsection{subsection}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\end{document}
```
Top Answer
samcarter
### With the `moloch` theme:

The problem can be avoided by using the `moloch` theme, which is a more modern fork of the `metropolis` theme:

```
% Based on https://topanswers.xyz/tex?q=2004 (samcarter)
\documentclass{beamer}

\usetheme[
	background = dark
]{moloch}% modern fork of the metropolis theme

\usepackage{noto}

\setbeamertemplate{headline}{%
  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
    \vskip1pt\strut \insertsectionnavigationhorizontal{\paperwidth}{}{} \vskip1pt % @samcarter: I inserted \strut to reserve the space for a fill line width
    \vskip1pt\strut \insertsubsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll} \vskip3pt
  \end{beamercolorbox}%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}
}

\makeatletter
\def\sectionentry#1#2#3#4#5{% section number, section title, page
  \beamer@xpos=0\relax%
  \beamer@ypos=1\relax%
  \beamer@ypos@offset=0\relax%
  \ifnum#5=\c@part%
  \beamer@section@set@min@width%
  \box\beamer@sectionbox\hskip1.875ex plus 1fill%
  \setbox\beamer@sectionbox=
  \hbox{\def\insertsectionhead{#2}%
    \def\insertsectionheadnumber{#1}%
    \def\insertpartheadnumber{#5}%
    {%
%      \usebeamerfont{section in head/foot}
      \usebeamercolor[fg]{section in head/foot}%
      \ifnum\c@section=#1%
        \usebeamerfont{section in head/foot}%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot}}}%
      \else%
        \usebeamerfont{section in head/foot shaded}%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}%
      \fi}%
  }%
  \ht\beamer@sectionbox=1.875ex%
  \dp\beamer@sectionbox=0.75ex%
  \fi\ignorespaces}
  
\def\insertsubsectionnavigationhorizontal#1#2#3{%
  \hbox to #1{{%
%    \usebeamerfont{subsection in head/foot}
    \usebeamercolor[fg]{subsection in head/foot}%
    \beamer@currentsubsection=0%
    \def\sectionentry##1##2##3##4##5{}%
    \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\c@section%
      \ifnum##2>\beamer@currentsubsection%
      \beamer@currentsubsection=##2%
      \box\beamer@sectionbox\hskip1.875ex plus1fill%
      \setbox\beamer@sectionbox=
      \hbox{\def\insertsubsectionhead{##5}%
         \def\insertsectionheadnumber{##1}%
         \def\insertsubsectionheadnumber{##2}%
         \def\insertpartheadnumber{##6}%
         \ifnum\c@subsection=##2%
        \beamer@link(##4){{\usebeamerfont{subsection in head/foot}\usebeamertemplate{subsection in head/foot}}}\else%
        \beamer@link(##4){{\usebeamerfont{subsection in head/foot shaded}\usebeamertemplate{subsection in head/foot shaded}}}\fi}%
      \ht\beamer@sectionbox=1.875ex%
      \dp\beamer@sectionbox=0.75ex%
      \fi\fi\fi\ignorespaces}%
    #2\hskip.3cm\setbox\beamer@sectionbox=\hbox{}%
    \hskip-1.875ex plus-1fill\dohead%
    \box\beamer@sectionbox\hfil\hskip.3cm%
    #3}}}


\makeatother

% My attempts to make it happen
% ---
\setbeamerfont{section in head/foot}{series=\bfseries}
\setbeamerfont{section in head/foot shaded}{series=\normalfont}

\setbeamerfont{subsection in head/foot}{series=\bfseries}
\setbeamerfont{subsection in head/foot shaded}{series=\normalfont}

\setbeamercolor{section in head/foot}{bg=normal text.bg, fg=structure.fg}
\setbeamercolor{subsection in head/foot}{bg=normal text.bg, fg=structure.fg}
 % ---

\begin{document}

\section{section 1}
\subsection{subsection}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\section{section 2}
\subsection{subsection 1}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\subsection{subsection 2}
\begin{frame}
\frametitle{blub}
    abc test
\end{frame} 

\appendix

\section{section A}
\subsection{subsection}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\end{document}
```

---

### For the original `metropolis` theme:

The problem is that the metropolis theme will automatically remove its progress bar in the appendix. To do this it overwrites the healdine template. You can work around this problem by re-setting the custom headline at the start of the appendix.

To avoid duplicating the code, I'm first defining a new headline template` myheadline` and then use `\setbeamertemplate{headline}[myheadline]` twice to apply it at the respective places.


```
% Based on https://topanswers.xyz/tex?q=2004 (samcarter)
\documentclass{beamer}

\usetheme[
	background = dark
]{metropolis}

\usepackage{noto}

\defbeamertemplate*{headline}{myheadline}{%
  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
    \vskip1pt\strut \insertsectionnavigationhorizontal{\paperwidth}{}{} \vskip1pt % @samcarter: I inserted \strut to reserve the space for a fill line width
    \vskip1pt\strut \insertsubsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll} \vskip3pt
  \end{beamercolorbox}%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}
}

\setbeamertemplate{headline}[myheadline]

\makeatletter
\def\sectionentry#1#2#3#4#5{% section number, section title, page
  \beamer@xpos=0\relax%
  \beamer@ypos=1\relax%
  \beamer@ypos@offset=0\relax%
  \ifnum#5=\c@part%
  \beamer@section@set@min@width%
  \box\beamer@sectionbox\hskip1.875ex plus 1fill%
  \setbox\beamer@sectionbox=
  \hbox{\def\insertsectionhead{#2}%
    \def\insertsectionheadnumber{#1}%
    \def\insertpartheadnumber{#5}%
    {%
%      \usebeamerfont{section in head/foot}
      \usebeamercolor[fg]{section in head/foot}%
      \ifnum\c@section=#1%
        \usebeamerfont{section in head/foot}%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot}}}%
      \else%
        \usebeamerfont{section in head/foot shaded}%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}%
      \fi}%
  }%
  \ht\beamer@sectionbox=1.875ex%
  \dp\beamer@sectionbox=0.75ex%
  \fi\ignorespaces}
  
\def\insertsubsectionnavigationhorizontal#1#2#3{%
  \hbox to #1{{%
%    \usebeamerfont{subsection in head/foot}
    \usebeamercolor[fg]{subsection in head/foot}%
    \beamer@currentsubsection=0%
    \def\sectionentry##1##2##3##4##5{}%
    \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\c@section%
      \ifnum##2>\beamer@currentsubsection%
      \beamer@currentsubsection=##2%
      \box\beamer@sectionbox\hskip1.875ex plus1fill%
      \setbox\beamer@sectionbox=
      \hbox{\def\insertsubsectionhead{##5}%
         \def\insertsectionheadnumber{##1}%
         \def\insertsubsectionheadnumber{##2}%
         \def\insertpartheadnumber{##6}%
         \ifnum\c@subsection=##2%
        \beamer@link(##4){{\usebeamerfont{subsection in head/foot}\usebeamertemplate{subsection in head/foot}}}\else%
        \beamer@link(##4){{\usebeamerfont{subsection in head/foot shaded}\usebeamertemplate{subsection in head/foot shaded}}}\fi}%
      \ht\beamer@sectionbox=1.875ex%
      \dp\beamer@sectionbox=0.75ex%
      \fi\fi\fi\ignorespaces}%
    #2\hskip.3cm\setbox\beamer@sectionbox=\hbox{}%
    \hskip-1.875ex plus-1fill\dohead%
    \box\beamer@sectionbox\hfil\hskip.3cm%
    #3}}}


\makeatother

% My attempts to make it happen
% ---
\setbeamerfont{section in head/foot}{series=\bfseries}
\setbeamerfont{section in head/foot shaded}{series=\normalfont}

\setbeamerfont{subsection in head/foot}{series=\bfseries}
\setbeamerfont{subsection in head/foot shaded}{series=\normalfont}

\setbeamercolor{section in head/foot}{bg=normal text.bg, fg=structure.fg}
\setbeamercolor{subsection in head/foot}{bg=normal text.bg, fg=structure.fg}
 % ---

\begin{document}

\section{section 1}
\subsection{subsection}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\section{section 2}
\subsection{subsection 1}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\subsection{subsection 2}
\begin{frame}
\frametitle{blub}
    abc test
\end{frame} 

\appendix

\setbeamertemplate{headline}[myheadline]

\section{section A}
\subsection{subsection}
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 
\begin{frame}
\frametitle{blub}
    abc
\end{frame} 

\end{document}
```

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.