0

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:

enter image description here

3
  • You can specify a page range for each frame. A prage without a flowframe will defaut to the normal text area. But you have to know the pages a priori. \lastpage is not available until after \AtBeginDocument, which is too late. See also tex.stackexchange.com/questions/637145/… Commented Jul 7 at 15:39
  • I don't know how flowframe works, I've just take it from linked code. Do you know, what do I need to add in the code to make it work properly? Commented Jul 7 at 17:07
  • Uh, never use linked code without reading the manauls? Commented Jul 7 at 21:05

1 Answer 1

1

I had to add a default flowframe for the first page after all.

\documentclass[addpoints]{exam}%% Grading Table
    %% ----------------------------------------------
    \usepackage{flowfram}
    \newflowframe[1,5]{\textwidth}{\textheight}{0pt}{0pt}
    \newflowframe[2-4]{\textwidth}{\dimexpr \textheight-1in}{0pt}{1in}

    \newdynamicframe[2-4]{\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}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .