[Tex/LaTex] How to obtain mini frames without navigation bullets and subsection titles in beamer

beamermini-framesnavigationsectioningsections-paragraphs

I would like to use the miniframes theme exactly like the MWE below, except without navigation bullets and subsection titles. The only solutions I've found modify the section titles as well (e.g. by removing the other sections). I would like to keep the first line of the miniframes theme as it is, with all sections visible.

Thanks in advance for your help !

\documentclass[17pt,t,compress]{beamer}


\useoutertheme{miniframes}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{section in head/foot shaded}{\color{gray}\usebeamertemplate{section in head/foot}}


\input{pre}
\begin{document}
\section{Section A}

\subsection{Subsection 1}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}

\subsection{Subsection 2}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}

\section{Section B}

\subsection{Subsection 1}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}


\subsection{Subsection 2}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}



\section{Section C}
\subsection{Subsection 1}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}

\subsection{Subsection 2}
\begin{frame}
One frame
\end{frame}


\section{Section D}
\subsection{Subsection 1}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}

\subsection{Subsection 2}
\begin{frame}
One frame
\end{frame}


\end{document}

enter image description here

Best Answer

\documentclass[17pt,t,compress]{beamer}


\useoutertheme{miniframes}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{section in head/foot shaded}{\color{gray}\usebeamertemplate{section in head/foot}}

\setbeamertemplate{headline}{%
  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
    \vskip2pt\insertsectionnavigationhorizontal{\paperwidth}{}{}\vskip2pt
  \end{beamercolorbox}%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}
}



\begin{document}
\section{Section A}

\subsection{Subsection 1}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}

\subsection{Subsection 2}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}

\section{Section B}

\subsection{Subsection 1}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}


\subsection{Subsection 2}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}



\section{Section C}
\subsection{Subsection 1}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}

\subsection{Subsection 2}
\begin{frame}
One frame
\end{frame}


\section{Section D}
\subsection{Subsection 1}
\begin{frame}
One frame
\end{frame}

\begin{frame}
One frame
\end{frame}

\subsection{Subsection 2}
\begin{frame}
One frame
\end{frame}


\end{document}

enter image description here