# beamer: position section head in a fixed position

Consider this example:

\documentclass{beamer}
\AtBeginSection[]{
\begin{frame}
\vspace{3cm}
\centering
\end{beamercolorbox}
\vfill
\end{frame}
}

\AtBeginSubsection[]{
\begin{frame}
\vspace{3cm}
\centering
\vspace{0.5cm}
\end{beamercolorbox}
\vfill
\end{frame}
}
\begin{document}
\section{Section 1}
\subsection{Subsection 1 A}
\end{document}


I use \vspace with the intention to fix the positions of section and subsection heads. However, when viewed in a slide mode, the section head is changing position when moving from section title page to subsection title page.

How to solve?

The problem is that by default the frame content is vertically centered and needs to be aligned to the top. This can be achieved by mean of the [t] option given globally as in \documentclass[t]{beamer} or individually for a particular frame as in \begin{frame}[t].

MWE

\documentclass[t]{beamer}
\AtBeginSection[]{
\begin{frame}
\vspace{3cm}
\centering
\end{beamercolorbox}
%\vfill
\end{frame}
}

\AtBeginSubsection[]{
\begin{frame} % or  \begin{frame}[t] (if not set globally)
\vspace{3cm}
\centering