In continuation of the previous question How to show the frametitle only on the first slide of a frame , there was a problem with text alignment. The problem is that I am trying set bottomsep and top sep for every frame such as pictures

so for the text, it is necessary to set indents of 4 pt from the bottom and top, as shown in the figure, so that there is also allow break a new page of content for each section (a separate title page is the title of a new lecture).
TeX exmaple code:
\documentclass[aspectratio=169, 10pt]{beamer}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usefonttheme{professionalfonts}
\usepackage{concmath}
\usefonttheme{serif}
\usepackage{setspace}
\usepackage{indentfirst}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{ragged2e}
\usepackage{etoolbox}
\usepackage{lipsum}
% 1. Line spacing 1.15
\setstretch{1.0}
% 2. Indent margin 1.25 cm
\setlength{\parindent}{1.15cm}
% 3. Indentation between adjacent paragraphs 12pt (double)
\setlength{\parskip}{4pt}
\setlength{\emergencystretch}{3em}
\expandafter\def\expandafter\normalsize\expandafter{%
\normalsize
\setlength\abovedisplayskip{4pt}
\setlength\belowdisplayskip{4pt}
\setlength\abovedisplayshortskip{4pt}
\setlength\belowdisplayshortskip{4pt}
}
\makeatletter
\long\def\beamer@@frametitle[#1]#2{%
\ifblank{#2}{}{%
\ifnum\beamer@autobreakcount<2
\gdef\insertframetitle{{%
#2%
}}%
\gdef\beamer@frametitle{#2}%
\gdef\beamer@shortframetitle{#1}%
\fi%
}%
}
\newcommand{\repar}{\vspace{-4pt}}
\renewcommand{\indent}{\hspace*{20pt}}
\setbeamertemplate{frametitle}[default][center]
%% Set the left and right margins
\setbeamersize{text margin left=2em,text margin right=2em}
%% FONTS
\setbeamerfont{title}{size=\LARGE}
\setbeamerfont{subtitle}{size=\Large}
\setbeamerfont{frametitle}{size=\Large}
\setbeamerfont{block title}{size=\normalsize}
\setbeamerfont{footline}{size=\normalsize}
%% COLOURS
%% If you'd like everything to have the same colour
\usebeamercolor{structure}
\setbeamercolor{normal text}{fg=black}
\setbeamercolor{structure}{bg=black!20,fg=black}
%% Add a line after the frametitle
% \addtobeamertemplate{frametitle}{}{\vspace*{-1ex}\rule{\textwidth}{1pt}}
%% Remove default navigation symbols (We'll add the ones we need in the footline
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{section in toc}[sections numbered]
%% And before the footline... actually we'd like to re-define
%% the footline
\setbeamertemplate{footline}{%
%% Beamer headlines and footlines are always full-paperwidth, so if you want the horizontal line to
%% not span it entirely you'll need to do a bit of arithmetic
\centering
\begin{minipage}{\dimexpr\paperwidth-\beamer@leftmargin-\beamer@rightmargin\relax}
\vspace{-4ex}
\centering
\rule{\linewidth}{1pt} \vskip 1pt
\usebeamerfont{footline}%
\usebeamercolor{footline}%
%% The frame number smack in the middle
% \hfill\insertpagenumber/\inserttotalframenumber
\hfill\insertpagenumber
\hfill%
%% ONLY the navigation symbols we want at the far right.
%% We use an \llap so that it takes up zero width, and doesn't throw the page number off-centre!
\llap{\insertframenavigationsymbol\insertbackfindforwardnavigationsymbol}\par
\end{minipage}\vskip1pt
}
\define@key{beamerframe}{t}[true]{% top
\beamer@frametopskip=4pt%
\beamer@framebottomskip=4pt%
\beamer@frametopskipautobreak=4pt%
\beamer@framebottomskipautobreak=4pt
%
}
\makeatother
\AtBeginSection[]{
\begin{frame}
\vfill
\centering
\begin{beamercolorbox}[sep=8pt,center,shadow=false,rounded=true]{title}
\usebeamerfont{title}\insertsectionhead\par%
\end{beamercolorbox}
\vfill
\end{frame}
}
\title{\textbf{Linear Algebra}}
\author{Author}
\date{August 2023}
\apptocmd{\frame}{}{\justifying}{}
\begin{document}
\begin{frame}
\thispagestyle{empty}
\titlepage
\end{frame}
\begin{frame}[allowframebreaks,allowdisplaybreaks]\frametitle{Outlist}
\tableofcontents[sections=1]
\tableofcontents[sections=2]
\tableofcontents[sections=3]
\tableofcontents[sections=4]
\tableofcontents[sections=5]
\tableofcontents[sections=6]
\tableofcontents[sections=7]
\tableofcontents[sections=8]
\tableofcontents[sections=9]
\tableofcontents[sections=10]
\tableofcontents[sections=11]
\end{frame}
\section{Introduction}
\subsection{Intro}
\begin{frame}[allowframebreaks,allowdisplaybreaks,t] \frametitle{Intro}
\lipsum[1-2]
\end{frame}
\subsection{Intro II}
\begin{frame}[allowframebreaks,allowdisplaybreaks] \frametitle{Intro II}
\lipsum[1-5]
\end{frame}
\section{Mathematics}
\section{Mathematics II}
\section{Mathematics III}
\begin{frame}[allowframebreaks,allowdisplaybreaks]
\frametitle{Readable Mathematics III}
\lipsum[1-6]
\end{frame}
\section{Mathematics IV}
\section{Mathematics V}
\section{Mathematics VI}
\section{Mathematics VII}
\section{Mathematics VIII}
\section{Mathematics IX}
\section{Mathematics X}
\end{document}
and I try to to set top skip, but this no effect
\define@key{beamerframe}{t}[true]{% top
\beamer@frametopskip=4pt%
\beamer@framebottomskip=4pt%
\beamer@frametopskipautobreak=4pt%
\beamer@framebottomskipautobreak=4pt
%
}
And my troubleshooting: How to align text vertically in beamer frame with this top and bottom skip 4pt and correct text aligment at the page?

It just seems to me that if you set the alignment correctly, then the page break will automatically be corrected.
– Alex Aug 22 '23 at 15:14