I am currently trying to create an exam template for my institute. What I want to receive is like this:

Task 1 [8 Points]

(text text text)

Subtask 1.1 [3 Points]

(text text text)

Subask 1.2 [5 Points]

(text text text)

And the [8 Points] of Task 1 is actually the result of the subtasks 3+5 Points.

I've been trying to tackle this thing with the package 'calculator'. The problem was to update the final result of the task. Here is my short Latex script:


\section{First Task [\res\, Points]}
\subsection{[\temp\, Points]}
\subsection{[\temp \,Points]}

Thank you very much for your ideas!


There are many packages available for this kind of task (see https://www.ctan.org/topic/exam), but if you want to do it manually, you can use the xcntperchap package:






\section{Sectiona \ObtainTrackedValueExp{section}{points}}

\subsection{subsectiona \ObtainTrackedValueExp[\value{totalsubsection}]{subsection}{points} }

\subsection{subsectionb \ObtainTrackedValueExp[\value{totalsubsection}]{subsection}{points} }

\section{Sectionb \ObtainTrackedValueExp{section}{points}}

\subsection{subsectionc \ObtainTrackedValueExp[\value{totalsubsection}]{subsection}{points} }

\subsection{subsectiond \ObtainTrackedValueExp[\value{totalsubsection}]{subsection}{points} }


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.