I knew how to resume the page number after the pdflscape at the footer if the content is the text as in the case.
But if the following content after the pdflscape are equations, the next page number will not be shown. As:
\documentclass{article}
\usepackage{lipsum,tabularray,afterpage,geometry,pdflscape,amsmath}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\fancyhf{}
\cfoot{\thepage}
\pagestyle{fancy}
\begin{document}
\section{New section}
\lipsum[1-6]
\afterpage{\newgeometry{left=2cm,right=2cm,bottom=0.5cm,top=0.5cm}
\begin{landscape}
\begin{longtblr}{
colspec={X[l,3em] X[c,4em] X[c,4em] X[c,3.5em] X[c,3em] X[c,3em] X[c,4em] X[c,2em] X[c,3em] X[c,3em] X[c,4em] X[c,4em] X[c,4em] X[c,3.5em] X[c,4em] X[c,3em] X[c,6em] X[c,3.2em]},colsep=1pt,rowhead=1
}
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18\\
\end{longtblr}
\end{landscape}\aftergroup\restoregeometry\clearpage
}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\begin{equation}
\mathrm{NPI}=\sqrt{\dfrac{{\left[\dfrac{1}{n}\sum\limits_{i=1}^n \dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right]}^2+{\left[\mathrm{Max}{\left(\dfrac{\mathrm{C_i}}{\mathrm{S_i}}\right)}\right]}^2}{2}}
\end{equation}
\lipsum[1-16]
\end{document}


\aftergroupfrom inside\aferpage???, the effect of that is well defined but very weird and hard to define. Almost the entire afterpage package code is concerned with juggling\aftergroup– David Carlisle Jun 08 '22 at 07:15\aftergroup, the next page number after the table will not be shown. I don't know the reason and another person told me this would resolve this problem. – Y. zeng Jun 08 '22 at 08:18\aftergroupfrom\afterpageis taking you in to uncharted and untested waters and any behaviour that does or does not happen is the result of unexpected consequeces and not really fixable or maintainable. There is nothing here that I can see to make the page number go from any page, so if it does go, fix that first not add extra broken code to try to bring it back. – David Carlisle Jun 08 '22 at 08:47\end{landscape}\aftergroup\restoregeometry\clearpagewith\end{landscape}\restoregeometry\clearpageand you will see no page number on the page after the table page. If not use\aftergroup, how should we bring the page number of the next page after the table back? – Y. zeng Jun 08 '22 at 08:52\cfootline to\usepackage[T1]{fontenc}\usepackage{lmodern}\cfoot{\smash{\fontsize{3in}{3in}\selectfont\thepage}}so that you see (parts of) the page number even when you are placing the page foot off the page. As I said above, you should fix the bug that the page numbers are not shown in the landscape pages first, – David Carlisle Jun 08 '22 at 08:58\cfoot{}is a deprecated macro and\fancyfoot[]{}is recommended instead (see p. 45 offancyhdr- Users' manual) – Celdor Jun 08 '22 at 10:31