This is my first posting and I would like to thank you in advance for any suggestions. I am typing all my Math papers (quizzes, tests, exams etc) in Latex and I have this problem that I cannot find any decent solution.
Here is a minimal working example. I would like to have the grading table at the very beginning. However, I don't know how to display the final value of a counters at the beginning of the document. I followed some suggestions using totcount package with no success.
Thanks a lot, Veronica
\documentclass[letterpaper,11pt]{exam}
\usepackage{calc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{pointKnowledge}
\newcounter{pointApplication}
\newcounter{pointThinking}
\newcounter{pointCommunication}
\def\K#1{{\sf \hfill [K/U /#1]}\addtocounter{pointKnowledge}{#1}}
\def\A#1{{\sf \hfill [A /#1]}\addtocounter{pointApplication}{#1}}
\def\T#1{{\sf \hfill [T /#1]}\addtocounter{pointThinking}{#1}}
\def\C#1{{\sf \hfill [C /#1]}\addtocounter{pointCommunication}{#1}}
\def\resetPoints{\setcounter{pointKnowledge}{0}}
\def\resetPoints{\setcounter{pointApplication}{0}}
\def\resetPoints{\setcounter{pointThinking}{0}}
\def\resetPoints{\setcounter{pointCommunication}{0}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
I WOULD LIKE THE GRADING TABLE HERE RATHER THEN AT THE END.\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BEGINNING GRADING TABLE\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vspace{0.2cm}
\begin{tabular}{ |r |r |r |r| r |} \hline
Knowledge/Understanding & Application & Communication & Thinking & \hspace{0.5cm} Total \hspace{0.5cm} \\ \hline
/ & /& / & / & / \\ [0.25cm] \hline
\end{tabular}
\begin{questions}
\question Question 1 knowledge \K{1}
\question Question 2 knowledge \K{5}
\question Question 3 application \A{2}
\question Question 4 application \A{5}
\question Question 5 thinking \T{7}
\question Question 6 thinking \T{2}
\question Question 6 communication \C{2}
\question Question 6 communication \C{3}
\end{questions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
END GRADING TABLE\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{FinalMark}
\setcounter{FinalMark}{\value{pointKnowledge}+\value{pointApplication}+\value{pointThinking}+\value{pointCommunication}}
\begin{tabular}{ |r |r |r |r| r |} \hline
Knowledge/Understanding & Application & Communication & Thinking & \hspace{0.5cm} Total \hspace{0.5cm} \\ \hline
/\the\value{pointKnowledge} & /\the\value{pointApplication}& /\the\value{pointCommunication} & /\the\value{pointThinking} & /\the\value{FinalMark} \\ [0.25cm] \hline
\end{tabular}
\end{document}
\usepackage{totcount} \newtotcounter{mycount} \begin{document} \total{mycount} .... your document/ tables, .... \setcounter{mycount}{\the\value{FinalMark}} \end{document}(solution from here worked fine) – Bobyandbob Jul 22 '17 at 16:36