2

I want to include the subsection navigation on the section slide (through \insertsubsectionnavigation) and align it with the current section. I am having trouble aligning them properly though, see below.

enter image description here

Any thoughts on how to align it such that "Method A" is on the same line as "Methodology"?

MWE:

\documentclass[aspectratio=43]{beamer}

\usepackage{pbox}
\setbeamercolor{section in head/foot}{fg=white}
\setbeamertemplate{section in head/foot}{%
        \usebeamerfont{sectionpage}\usebeamercolor[fg]{titlepages}\raggedright%
        \huge\insertsectionhead%
      \hspace{0.1\textwidth}%
      \begin{minipage}[b]{0.5\textwidth}
        \large\insertsubsectionnavigation{\linewidth}
      \end{minipage}
}
\setbeamertemplate{section in head/foot shaded}{%
    \pbox[c][4ex][c]{0.2\textwidth}{%
      %
      \color{black!75}\Large\centering\insertsectionhead%
    }\hspace*{1pt}%
}
\setbeamercolor{subsection in head/foot}{fg=white}
\setbeamertemplate{subsection in head/foot}{%
    \footnotesize\hspace*{-1pt}\setlength\fboxsep{0pt}%
    \pbox[c][4ex][c]{\textwidth}{%
            \centering\small\insertsubsectionhead%
    }\hspace*{1pt}%
}
\setbeamertemplate{subsection in head/foot shaded}{%
    \footnotesize \hspace*{-1pt}\setlength\fboxsep{0pt}%
    \pbox[c][4ex][c]{\textwidth}{%
      %
      \color{black!75}\small\insertsubsectionhead%
    }\hspace*{1pt}%
}

\AtBeginSection[]{%
        {\setbeamercolor{background canvas}{bg=blue!50}%
        \frame{%
            \huge\insertsectionnavigation{0.6\linewidth}{}{}%
            \addtocounter{framenumber}{-1}}}%
        }

\AtBeginSubsection[]{{\setbeamercolor{background canvas}{bg=blue!50}\frame{\mbox{}\hspace{0.1\textwidth}Subsection \thesubsection\addtocounter{framenumber}{-1}}}}

\begin{document}

\section*{Overview}

\begin{frame}{Overview}

\end{frame}

\section{Methodology}

\subsection{Method A}

\begin{frame}{Method A is good}

    Total: \inserttotalframenumber

\end{frame}

\subsection*{Method B}

\begin{frame}{Method B is better}

    Because it is better.

\end{frame}

\subsection*{Method C}

\begin{frame}{Method C is the best}

    Because it is the best.

\end{frame}

\section{Results}

\subsection*{Preliminary results}

\begin{frame}{Early results}

    Not good.

\end{frame}

\subsection*{Final results}

\begin{frame}{These results are beautiful.}

    Perfect.

\end{frame}

\end{document}
1

Quick hack:

\documentclass[aspectratio=43]{beamer}

\usepackage{pbox}
\setbeamercolor{section in head/foot}{fg=white}
\setbeamertemplate{section in head/foot}{%
        \usebeamerfont{sectionpage}\usebeamercolor[fg]{titlepages}\raggedright%
        \huge\insertsectionhead%
      \hspace{0.1\textwidth}%
      \begin{minipage}[b][.5\textheight][t]{0.5\textwidth}
        \vspace*{4.3cm}
        \large\insertsubsectionnavigation{\linewidth}
      \end{minipage}
}
\setbeamertemplate{section in head/foot shaded}{%
    \pbox[c][4ex][c]{0.2\textwidth}{%
      %
      \color{black!75}\Large\centering\insertsectionhead%
    }\hspace*{1pt}%
}
\setbeamercolor{subsection in head/foot}{fg=white}
\setbeamertemplate{subsection in head/foot}{%
    \footnotesize\hspace*{-1pt}\setlength\fboxsep{0pt}%
    \pbox[c][4ex][c]{\textwidth}{%
            \centering\small\insertsubsectionhead%
    }\hspace*{1pt}%
}
\setbeamertemplate{subsection in head/foot shaded}{%
    \footnotesize \hspace*{-1pt}\setlength\fboxsep{0pt}%
    \pbox[c][4ex][c]{\textwidth}{%
      %
      \color{black!75}\small\insertsubsectionhead%
    }\hspace*{1pt}%
}

\AtBeginSection[]{%
        {\setbeamercolor{background canvas}{bg=blue!50}%
        \frame{%
            \huge\insertsectionnavigation{0.6\linewidth}{}{}%
            \addtocounter{framenumber}{-1}}}%
        }

\AtBeginSubsection[]{{\setbeamercolor{background canvas}{bg=blue!50}\frame{\mbox{}\hspace{0.1\textwidth}Subsection \thesubsection\addtocounter{framenumber}{-1}}}}

\begin{document}

\section*{Overview}

\begin{frame}{Overview}

\end{frame}

\section{Methodology} % if this does not have a star, it works.

\subsection{Method A}
    \subsection{Method A}
        \subsection{Method A}
            \subsection{Method A}
                \subsection{Method A}
                    \subsection{Method A}

\begin{frame}{Method A is good}

    Total: \inserttotalframenumber

\end{frame}

\subsection*{Method B}

\begin{frame}{Method B is better}

    Because it is better.

\end{frame}

\subsection*{Method C}

\begin{frame}{Method C is the best}

    Because it is the best.

\end{frame}

\section{Results}

\subsection*{Preliminary results}

\begin{frame}{Early results}

    Not good.

\end{frame}

\subsection*{Final results}

\begin{frame}{These results are beautiful.}

    Perfect.

\end{frame}

\end{document}

enter image description here

  • Sure that works, but if I now change aspect ratio, font size, or something else, it is again misaligned. – maero21 Jun 19 '18 at 23:36
  • @maero21 To accommodate for different font sizes, you could replace the 4.3cm with a unit relative to the font size, e.g. 1em (replace 1 by a suitable value) – user36296 Jun 20 '18 at 8:15
  • @maero21 If you want more control, you could combine tex.stackexchange.com/a/422965/36296 and tex.stackexchange.com/a/303968/36296 to create your own navigation using tikz – user36296 Jun 20 '18 at 13:41
  • Thanks for the help, I ended up just using a tableofcontents. – maero21 Jun 20 '18 at 19:44

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.