# How to set different headers for different slides in beamer [closed]

I designed a few slides for a quiz show that I hosted. This question is about editing the headers differently in each slide. For reference, please find my output pdf here.

1. In the first slide, the headers should go blank, as they are.
2. In the second slide, the first (red) header should contain the word "Rules".
3. The third slide should have "1. Question" in the first (red) header.
4. The fourth slide should have "1. Answer" in the second (grey) header.
5. Slides 5, 6, 7 should have " the question number. Question" in the first (red) header.
6. The eighth slide should have "Answers" in the second (grey) header and so on.

Please tell me how do I achieve this. Also, I need to have a counter and sub-counter for questions and another counter for the answers which will spread through different slides. What I mean is something like this:

\begin{questions}

\begin{frame}
\question
question. %Output will have the question no. "1. Question"
\end{frame}

\begin{frame}
\subquestion
question. %Output will have the question no. "1.1. Question"
\end{frame}

\end{questions}


And similar for the answers as well. I am asking two questions here because I think my first query about headers can be achieved by defining counters. My full code is given below:

\documentclass[a4paper]{beamer}
\usepackage{nccmath}
\usefonttheme{serif}
\usepackage{xcolor}
\definecolor{sapphire}{rgb}{0.03, 0.15, 0.4}
\definecolor{zinnwalditebrown}{rgb}{0.17, 0.09, 0.03}
\newcommand{\bg}[1]{\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{#1}}}
\setbeamertemplate{enumerate subitem}{(\textbf{\alph{enumii}})}
\setbeamertemplate{enumerate item}{\textbf{\alph{enumi}.}}
\usepackage{tfrupee}
\usepackage{ragged2e}
\usepackage{etoolbox}
\usetheme{CambridgeUS}
\author[\textsc{Wagon Round}]{}
\title[QUIZZOMANIA]{\color{sapphire}\huge \textsc{Wagon Round}}
\date[\today]{}

\begin{document}
%
%Title Page
%
\bg{qn.jpg}
\begin{frame}
\titlepage
\end{frame}
%
%Rules
%
\bg{qn.jpg}
\begin{frame}[c]\huge
\vspace{2ex}
\begin{center}
\color{zinnwalditebrown}\Large\underline{\textbf{RULEs:}}
\end{center}
\begin{itemize}\color{black}\large
\item There will be four main questions with 3 bonus questions to each question.
\item You need to press the buzzer to answer the main question. If you answer it correctly, three bonus questions will be there only for your team to answer.
\item Correct answer to the main questions will fetch you 20 points and wrong answer will deduct 20 points.
\item Bonus questions will carry 10 marks each. You need to answer them within 10 seconds. There is no negative marking for the bonus questions.
\end{itemize}
\end{frame}
%
%
%Qn 1.
%
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{1. Question:}}
\end{center}
\Large\normalcolor What is the value of $\dfrac{1^{3}+2^{3}+3^{3}+4^{3}+5^{3}}{1+2+3+4+5}?$
\end{frame}
%
%Ans 1.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\begin{center}\Large
\end{center}
\vspace{5ex} \normalcolor\centering\textbf{\huge 15.}\vspace{2ex}
\large$\dfrac{1^{3}+2^{3}+3^{3}+4^{3}+5^{3}}{1+2+3+4+5}=\dfrac{(1+2+3+4+5)^{2}}{1+2+3+4+5}=15.$
\end{frame}
%
%Qn 1.1.
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{1.1. Question:}}
\end{center}
\centering\Large\normalcolor Which instrument is used to measure the force and velocity of the wind?
\end{frame}
%
%Qn 1.2.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{1.2. Question:}}
\end{center}
\centering\Large\normalcolor Which probability distribution has its expectation same as its variance?
\end{frame}
%
%Qn 1.3.
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{1.3. Question:}}
\end{center}
\centering\Large\normalcolor Which company invented the GUI (Graphical User Interface)?
\end{frame}
%
%Ans 1.1-1.3.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\begin{center}\Large
\end{center}
\vspace{2ex} \normalcolor
\Large\begin{itemize}
\item 1.1: Anemometer.
\item 1.2: Poisson distribution.
\item 1.3: Xerox.
\end{itemize}
\end{frame}
%
%
%Qn 2.
%
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{2. Question:}}
\end{center}
\Large\normalcolor The measure of kurtosis of a distribution is $\gamma_2=\frac{\mu_4}{\mu_2^2}-3.$
Why do we subtract 3 from $\frac{\mu_4}{\mu_2^2}$?
\end{frame}
%
%Ans 2.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\begin{center}\Large
\end{center}
\vspace{5ex} \normalcolor\Large To compare it with Normal distribution. For a Normal distribution, $\frac{\mu_4}{\mu_2^2}=3$.
\end{frame}
%
%Qn 2.1.
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{2.1. Question:}}
\end{center}
\centering\Large\normalcolor What is the SI unit of magnetic field strength?
\end{frame}
%
%Qn 2.2.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{2.2. Question:}}
\end{center}
\centering\Large\normalcolor Which company invented BlueTooth technology?
\end{frame}
%
%Qn 2.3.
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{2.3. Question:}}
\end{center}
\centering\Large\normalcolor Which principle does optical fibre work on?
\end{frame}
%
%Ans 2.1-2.3.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\begin{center}\Large
\end{center}
\vspace{2ex} \normalcolor
\Large\begin{itemize}
\item 2.1: Tesla.
\item 2.2: Ericsson.
\item 2.3: Total internal reflection.
\end{itemize}
\end{frame}
%
%
%Qn 3.
%
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{3. Question:}}
\end{center}
\Large\normalcolor What is the value of $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}xe^{-\frac{x^2}{2}}dx\ ?$
\end{frame}
%
%Ans 3.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\begin{center}\Large
\end{center}
\vspace{5ex}
\begin{center}
\normalcolor\textbf{\huge 0.}
\end{center}
\Large It is an odd function integrated over a symmetric interval around 0. Also it is the first order central moment of the standard normal distribution.
\end{frame}
%
%Qn 3.1.
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{3.1. Question:}}
\end{center}
\Large\normalcolor What is the minimum number of steps required to shift a Tower of Hanoy with $n$ disks and 3 pegs from one peg to other?
\end{frame}
%
%Qn 3.2.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{3.2. Question:}}
\end{center}
\Large\normalcolor\centering What is the anti-particle of electron?
\end{frame}
%
%Qn 3.3.
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{3.3. Question:}}
\end{center}
\Large\normalcolor\centering What is the fastest memory in a Computer system?
\end{frame}
%
%Ans 3.1-3.3.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\begin{center}\Large
\end{center}
\vspace{2ex} \normalcolor
\Large\begin{itemize}
\item 3.1: $2^{n}-1$.
\item 3.2: Positron.
\item 3.3: Register.
\end{itemize}
\end{frame}
%
%
%Qn 4. NOT DONE!!!!!!
%
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{4. Question}}
\end{center}
\Large\normalcolor What is the simplified boolean expression of the function $F(A,B,C)=\sum_{m}(0,2,3,4,6,7)\ ?$
\end{frame}
%
%Ans 3.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\begin{center}\Large
\end{center}
\begin{center}
\normalcolor\textbf{\huge $B+\bar{C}.$}
\end{center}
\end{frame}
%
%Qn 4.1.
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{4.1. Question:}}
\end{center}
\Large\normalcolor\centering Which programming language was used mostly to develop MicroSoft Office?
\end{frame}
%
%Qn 4.2.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{4.2. Question:}}
\end{center}
\Large\normalcolor\centering Which phenomenon is involved in the soaking of ink by blotting papers?
\end{frame}
%
%Qn 4.3.
%
\bg{qn.jpg}
\begin{frame}[c]
\vspace{2ex}
\begin{center}\Large
\color{zinnwalditebrown}{\textbf{4.3. Question:}}
\end{center}
\Large\normalcolor\centering Which American Computer company is also known as the Big Blue"?
\end{frame}
%
%Ans 4.1-4.3.
%
\bg{ans.jpg}
\begin{frame}[c]\vspace{2ex}
\begin{center}\Large
\end{center}
\vspace{2ex} \normalcolor
\Large\begin{itemize}
\item 4.1: C++.
\item 4.2: Capillary action.
\item 4.3: IBM.
\end{itemize}
\end{frame}
%
%
%
\end{document}

• \begin{frame}{This is the title of this frame}{This is the subtitle}...\end{frame}? Or use \frametitle{} etc. – cfr Oct 20 '19 at 22:19
• That creates another row like like this, which, for me looks gross. – Subhajit Paul Oct 21 '19 at 4:10
• That's just the theme you're using. Pick a theme which doesn't look gross. I use frame titles and subtitles all the time and they're just headers (on the left in larger fonts in my case) with no change in background colour. – cfr Oct 21 '19 at 17:28