I found a code for automatically print grading table on each page. Link to code
But my document include title page and last page without questions, and on field where grading table should be, there is printed a warning. There's my code:
%% Grading Table
%% ----------------------------------------------
\usepackage{flowfram}
\newflowframe{\textwidth}{\dimexpr \textheight-1in}{0pt}{1in}
\newdynamicframe{\textwidth}{1in}{0pt}{0pt}[partial]
\setdynamiccontents*{partial}{\vspace*{\fill}\hspace*{\fill}%
\partialgradetable{page\thepage}[h]}
\newcommand{\nextpage}{\endgradingrange{page\thepage}%
\newpage
\begingradingrange{page\thepage}}
\htword{$\Sigma$} %substitutes text for \Total"
%% ----------------------------------------------
\begin{document}
\begin{center}
{\Large \textbf{EXAM}} \\\bigskip
{\large Subject} \vspace{140pt}
Department \\
Author\\
Date \\
\end{center}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%
%
% questions
%
%%%%%%%%%%%%%%%%%%%%%%%%%
\begingradingrange{page\thepage}
\begin{questions}
\question[2] Solve problem:
\nextpage
\question[3]
Second problem
\question[4]
Third Problem
\nextpage
\question[5]
Fourth problem
\endgradingrange{page\thepage}
\end{questions}
\newpage \noindent
Use this page for extra notes if needed.
\end{document}
How can I improve that to have tables only on pages with questions?
This is printed on pages without questions:
\lastpage
is not available until after\AtBeginDocument
, which is too late. See also tex.stackexchange.com/questions/637145/…