I managed to repeat this example for customizing a beamer style. Now I would like to automatically insert the section and sub-section titles in the head of each slide, without necessity of setting \frametitle, ideally through the .sty files (i.e. beamer outer theme) and not in the .tex file.
I adapted the beamerouterthemetexsx.sty of the cited example in this way (see the comments):
\mode<presentation>
% Frame title
\defbeamertemplate*{frametitle}{texsx}[1][]
{
\vskip1cm%
\begin{beamercolorbox}[wd=\paperwidth,ht=1.2cm]{frametitle}
\begin{tikzpicture}
\useasboundingbox[fill=white](0,0) rectangle(\the\paperwidth,1.2);
\fill[orange] (0,0) rectangle(2.95,1.2);
\fill[blue!50!cyan!80] (3.05,0) rectangle(\the\paperwidth,1.2);
% In the next part I replaced \insertframetitle by \insertsection
% In the same way I replaced \insertframesubtitle by \insertsubsection
\ifx\insertframesubtitle\@empty%
{\node[anchor=west, white,font=\large] at (3.2,0.61){\insertsection};}
\else%
{\node[anchor= west, white,font=\large] at (3.2,0.81){\insertsection};%
\node[anchor= west, white,font=\small] at
(3.2,0.41){\insertsubsection};}%
\fi
\end{tikzpicture}
\end{beamercolorbox}
}
\mode<all>
My document's source looks like this:
\documentclass[aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\title{My first attempt}
\date[today]{\today}
\author[Miguel]{Miguel Alvarez}
% use custom theme
\usetheme{texsx}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{The first lesson}
\subsection{Before the first break}
\begin{frame}
Blank frame
\end{frame}
\begin{frame}{auto}
Frame with title
\end{frame}
\begin{frame}{auto}{auto}
Frame with title and sub-title
\end{frame}
\end{document}
Is there a simple way to get automatically the title and subtitle in a slide by \begin{frame} without necessity of setting frame title and subtitle, which won't be used in any case (as by \begin{frame}{auto}{auto})?
In other words, for the code
\begin{frame}
Blank frame
\end{frame}
I got:
BUT I was expecting:


\RequirePackagein your.styjust after\mode<presentation>and replaced\usetheme{texsx}with\useoutertheme{texsx}and everything seems to work fine. Or I totally missed your question. – BambOo Apr 27 '20 at 17:19autois the one) and frame sub-title to get the head-bar, although section and subsection are already set. – Migue Lo Apr 27 '20 at 17:23.texpreamble, which is not the optimal way. I inserted the suggested lines inbeamerthemetexsx.styand it is working but only for the section and not for the sub-section. – Migue Lo Apr 27 '20 at 20:00\begin{frame}[t]{auto}{auto}for start a slide in the desired layout. – Migue Lo Jul 28 '20 at 20:15