4

We have a cooperate design template for exams. The disadvantage is, that we have to count the point for each task manually. My idea was to this automatically with counters.

What I am looking for:

\task{Java}
Hello World \points{2}
for-each \points{1}

\task{C++}
Bla bla \points{2}
Blub blub \points{4}

\task{Latex}
Foo foo \points{2}
bar bar \points{2}

I want to have a document which looks as follows after compiling:


Java (3 Points)

Hello World (2 Points)

for-each (1 Point)

C++ (6 Points)

Bla bla (2 Points)

Blub blub (4 Points)

Latex (4 Points)

Foo foo (2 Points)

bar bar (2 Points)


My idea was to create a counter within the \task-command, and to use it with th \addtocounter-command within the \points-command. Actually, I did not manage to change the name for each counter dynamically.

Here is a MWE extracted from our template, were we are counting the points manually in the `\task``command:

\documentclass[12pt,oneside,a4paper,final]{scrartcl}

\newcounter{task}
\setcounter{task}{0}

\newcommand{\points}[1]{
    (#1~Points)
}

\newcommand{\task}[2]{
    \refstepcounter{task}
    \begin{flushleft}
        {\LARGE\bf Task \arabic{task}}
    \end{flushleft}
    {\Large \textbf{#1}}
    \leavevmode\hfill ({#2}~Points)\\
}

\begin{document}

    \task{Java}{3}

    Hello World \points{2}

    for-each \points{1}

    \task{C++}{5}

    Bla bla \points{2}

    Blub blub \points{4}

    \task{Latex}{4}

    Foo foo \points{2}

    bar bar \points{2}

\end{document}

from: https://github.com/boldt/tex.stackexchange.com-186897/blob/master/exam.tex

  • 1
    That's one of the features provided by the excellent exsheets package. – jub0bs Jun 27 '14 at 10:30
  • @Jubobs not quite: exsheets doesn't provide a possibility to add points within the environment and have the sum printed in the title automatically. Until now you have to sum them up yourself. v0.14 will provide a possibility but it is not quite ready to be published (in a few days...) – cgnieder Jun 27 '14 at 10:47
  • @Jubobs I stand corrected: there is a possibility already – cgnieder Jun 27 '14 at 10:53
  • 1
    Now the question remains: can exsheets be used with the template (that we know nothing about...) – cgnieder Jun 27 '14 at 11:07
  • 2
    You'll need two compilation passes unless you are happy with providing the various parts of a task as arguments so they can be processed and then typeset... – Bordaigorl Jun 27 '14 at 12:05
1

It looks like that user cslstr and I had the same idea ;-) I used a changed command from a former question of mine to write a label to the .aux file and read it later one using \nameref*.

The closing of a task would be much easier, if it would be inside an environment, however.

\documentclass[12pt,oneside,a4paper,final]{scrartcl}
\usepackage{nameref}

\newcounter{task}
\setcounter{task}{0}


\newcounter{creditspertask}[task]
\setcounter{creditspertask}{0}%

\newcommand{\points}[1]{
    (#1~Points)
\addtocounter{creditspertask}{#1}%
}


\makeatletter
\newcommand{\WriteCreditsToFile}[1]{%
\immediate\write\@auxout{%
\string\newlabel{credits::\number\value{task}}{{\thesection}{\thepage}{#1}{}}
}% End of writing to AUX file
}%
\makeatother


\AtEndDocument{% For the last one only
\WriteCreditsToFile{\number\value{creditspertask}}%
}%

% 

\newcommand{\task}[1]{
  \WriteCreditsToFile{\number\value{creditspertask}}
    \refstepcounter{task}
    \begin{flushleft}
        {\LARGE\bfseries Task \arabic{task}}
    \end{flushleft}
    {\Large \textbf{#1}}
    \leavevmode\hfill ({\nameref*{credits::\number\value{task}}}~Points)\\
}

\begin{document}

    \task{Java}

    Hello World \points{2}

    for-each \points{1}

    \task{C++}

    Bla bla \points{2}

    Blub blub \points{4}

    \task{Latex}

    Foo foo \points{2}

    bar bar \points{2}

\end{document}

Edit Updated version with 0.5 credits also possible and rudimentary \listofcredits

\documentclass[12pt,oneside,a4paper,final]{scrartcl}
\usepackage{nameref}
\usepackage{calculator}%
\usepackage{calc}%
\usepackage{totcount}%
\usepackage{forloop}


\newcounter{task}
\setcounter{task}{0}


\xdef\TotalCredits{0}%
\xdef\TaskCredits{0}%
\xdef\SubCredits{0}%

\newcommand{\points}[2]{
\item #1   (#2~Points)
\ADD{\TaskCredits}{#2}{\SubCredits}%
\xdef\TaskCredits{\SubCredits}%
}%


\makeatletter
\newcommand{\WriteCreditsToFile}[1]{%
\immediate\write\@auxout{%
\string\newlabel{credits::\number\value{task}}{{\thesection}{\thepage}{#1}{}}
}% End of writing to AUX file
}%
\makeatother
%

\makeatletter
\AtEndDocument{%
\immediate\write\@auxout{%
\string\newlabel{totalcredits}{{\thesection}{\thepage}{\TotalCredits}{}}
}
}
\makeatother


\newenvironment{Task}[1]{%
\xdef\TaskCredits{0}%
\xdef\SubCredits{0}%
\xdef\CreditsSoFar{0}%
    \refstepcounter{task}
    \begin{flushleft}
        {\LARGE\bfseries Task \arabic{task}}
    \end{flushleft}
    {\Large \textbf{#1}}
    \leavevmode\hfill ({\nameref*{credits::\number\value{task}}}~Points)\\
    \begin{itemize} % Just for 'better' typography
}{% Close it
\end{itemize}
\WriteCreditsToFile{\TaskCredits}%
% Count all credits for the summary%
\ADD{\TotalCredits}{\TaskCredits}{\CreditsSoFar}%
\xdef\TotalCredits{\CreditsSoFar}%
}%


\regtotcounter{task}%

\makeatletter%

\newcounter{loop@@counter}%

\newcounter{totaltask@@counter}%
\newcommand{\listofcredits}{%
\setcounter{totaltask@@counter}{\number\totvalue{task}+1}%
\begin{tabular}{lll}
Task number & Total credits & Achieved\tabularnewline
\hline
\forloop{loop@@counter}{1}{\number\value{loop@@counter} < \number\value{totaltask@@counter}}{%
Task \number\value{loop@@counter} & \nameref*{credits::\number\value{loop@@counter}} & \tabularnewline% 
} %
& \tabularnewline
\hline
\multicolumn{1}{r}{Total:} & \nameref*{totalcredits} & \tabularnewline%
\end{tabular}
}%
\makeatother


\begin{document}

\listofcredits
\newpage

    \begin{Task}{Java}
      \points{Hello World}{2.5}
      \points{for-each}{2}
  \end{Task}%

    \begin{Task}{C++}
     \points{Bla bla}{2}
     \points{blub blub}{4}
    \end{Task}

    \begin{Task}{Latex}
     \points{Foo}{2}
     \points{bar}{2}
    \end{Task}

\begin{Task}{Fortran54} % ;-)
  \points{Write a Fortran 54 code to  \LaTeX ;-)}{100}
  \points{Write a Babbage machine  code to replace \LaTeX ;-)}{1000}
\end{Task}




\end{document}

Edit New version

Since \nameref*{} is not expandable, another approach must be used for summing up etc. The new version writes the total credits per task into an external file which is read afterwards again to complete the total task credits at the top position and for the \listoftask commands.

The code

  • works if all tasks are written to the \jobname.credits file
  • works if there are true numbers and not mathematical expressions for credits

  • requires two runs

  • does not work for section wise task numbering

  • fails if another task is added somewhere, because the writing of \jobname.credits is done only during the first run. In this case remove \jobname.aux and \jobname.credits, then run again twice.

Of course, I could not check everything and the output formatting etc. is just a proposition, where I borrowed code from the OP answer, which was a direct reaction on my first version, so I think, this is ok.

\documentclass[paper=a4,12pt]{scrbook}

\usepackage{calculator}
\usepackage{morewrites}

\usepackage{etoolbox}%
\usepackage{xcolor}%
\usepackage{calc}%
\usepackage{forloop}%
\usepackage{totcount}%
\usepackage{ifthen}%
\usepackage{tikz}%




\newwrite\CreditsFileHandle%

\newcounter{NumberOfLaTeXRuns}%
\newcommand{\WriteFileThreshold}{2}%


\newcommand{\CounterValue}[1]{%
\ifltxcounter{#1}{%
\number\value{#1}}{%
#1}%
}%



\xdef\tempsum{0}%
\xdef\othersum{0}%

\newcommand{\sumup}[1]{%
\ADD{\tempsum}{#1}{\othersum}%
\xdef\tempsum{\othersum}%
}%


\makeatletter

\newcommand{\WriteToFile}[2][\CreditsFileHandle]{%
\immediate\write#1{%
#2%
}%
}%


\newcommand{\CloseForReading}[1][\CreditsFileHandle]{%
\immediate\closein#1%
}%

\newcommand{\CloseForWriting}[1][\CreditsFileHandle]{%
\immediate\closeout#1%
}%


\newcommand{\OpenForReading}[2][\CreditsFileHandle]{%
\immediate\openin#1=#2%
}%

\newcommand{\OpenForWriting}[2][\CreditsFileHandle]{%
\immediate\openout#1=#2%
}%





\xdef\@@TotalCreditsValue{1}%
\listgadd{\CreditsSumList}{}%

\newcommand{\DisplayQuestionAndCredits}[2]{%
\item #1 (\DisplayCredits{#2})% 
\listgadd{\CreditsSumList}{#2}%
}%


\newcommand{\CreditsName}{point}%
\newcommand{\CreditsNamePlural}{points}%

\newcommand{\DisplayCredits}[1]{%
\pgfmathequal{#1}{1}%
\ifnumequal{\pgfmathresult}{1}{
#1 \CreditsName%
}{%
#1 \CreditsNamePlural%
}%%
}%



\newcommand{\ReadCreditValueWithSumUp}[2][\CreditsFileHandle]{%
\ReadCreditValue[#1]{#2}%
#2\sumup{#2}%
}%

\newcommand{\ReadCreditValue}[2][\CreditsFileHandle]{%
\read#1 to #2% Read in from file
}%



\newcounter{task}%
\newenvironment{Task}[1]{%
\refstepcounter{task}%
\ifnumequal{\CounterValue{NumberOfLaTeXRuns}}{\WriteFileThreshold}{%
\ReadCreditValue{\@@TotalCreditsValue}%
}{}%
\begin{flushleft}
{\Large \textbf{Task} \textbf{\thetask} -- \textbf{#1}}%%
\hfill  \fcolorbox{black}{yellow}{\DisplayCredits{\@@TotalCreditsValue}}% 
\end{flushleft}%
\begin{itemize}
}{%
\end{itemize}
\ifnumless{\CounterValue{NumberOfLaTeXRuns}}{\WriteFileThreshold}{%
%Do only sum up when not in final output mode 
\sumuplist{\CreditsSumList}%
\WriteToFile{\tempsum}%
}{% No, the number of runs is greater than zero, so ... do nothing
}% 
\xdef\CreditsSumList{}%
}%



\newcommand{\sumuplist}[1]{%
\xdef\tempsum{0}%
\forlistloop{\sumup}{#1}%
}%




\regtotcounter{task}%
\newcounter{totaltask@@counter}%
\newcounter{last@@counter}%
\newcounter{loop@@counter}%


\newcommand{\mk}[1]{%
}%





\newcommand{\listoftasks}{%
\gdef\CurrentSumValue{0.0}%
\IfFileExists{\jobname.credits}{%
\CloseForWriting% 
\OpenForReading{\jobname.credits}%
\begin{center}
  \setcounter{totaltask@@counter}{\number\totvalue{task}+1}%
  \setcounter{last@@counter}{\number\totvalue{task}}%
  \Huge \textbf{List of Tasks}\normalsize 

  \vspace{\baselineskip} %
  \begin{tabular}{|c||r|c|c|}
    \hline
    Task number & Total credits & Achieved credits\\
    \hline
    \hline
    \forloop{loop@@counter}{1}{\CounterValue{loop@@counter} < \CounterValue{totaltask@@counter}}{%
      \CounterValue{loop@@counter} & %
      \ReadCreditValueWithSumUp{\CurrentSumValue}% Do not delete that % character before!
      & %
      \ifnum\number\value{loop@@counter}<\CounterValue{last@@counter}%  %\number\value{last@@counter}
      \tabularnewline\hline
      \fi%
      \xdef\CurrentSumValue{0}%
    }%
    \tabularnewline%
    \hline%
    \hline\hline%
    \multicolumn{1}{|l||}{Total:} & \tempsum & \tabularnewline%
    \hline%
  \end{tabular}%
\end{center}%
\newpage% Well, later an \clearpage?
% Now close the handle than open it again for reading total values in the individual tasks to complete
%the values.
\CloseForReading%
\OpenForReading{\jobname.credits}%
}{}%
}%



\AtBeginDocument{%
  \refstepcounter{NumberOfLaTeXRuns}%
  \ifnumequal{\CounterValue{NumberOfLaTeXRuns}}{\WriteFileThreshold}{%
    \CloseForWriting%
    \OpenForReading{\jobname.credits}%
  }{%
    \OpenForWriting{\jobname.credits}%
  }%
}%

\AtEndDocument{%
  \immediate\closeout\CreditsFileHandle%
  \ifnumequal{\CounterValue{NumberOfLaTeXRuns}}{\WriteFileThreshold}{%
    \setcounter{NumberOfLaTeXRuns}{1}}{}%
  \immediate\write\@auxout{%
    \string\setcounter{NumberOfLaTeXRuns}{\number\value{NumberOfLaTeXRuns}}%
  }%
}%
\makeatother


\begin{document}


\listoftasks


\begin{Task}{Java}%
\DisplayQuestionAndCredits{Hello World in Java}{10}%
\end{Task}%


\begin{Task}{C++}%
\DisplayQuestionAndCredits{Virtual methods}{10}%
\DisplayQuestionAndCredits{Operator overloading}{15}%
\end{Task}%

\begin{Task}{\LaTeXe}
\DisplayQuestionAndCredits{Reproduce this document ;-)}{2000}%
\DisplayQuestionAndCredits{Are there better sites than TeX.SX?}{10000.14159}%
\end{Task}


\begin{Task}{Fortran 54}
\DisplayQuestionAndCredits{Write a Fortran program better than \LaTeXe }{100}
\DisplayQuestionAndCredits{Write code for a Babbage machine with objects}{200}
\end{Task}


\end{document}

enter image description here

enter image description here

| improve this answer | |
  • I did something like this (with an environment) 5 min ago. (see comment under my question and under cslstr's answer) – Dennis Jun 27 '14 at 12:21
  • Well, it was not working then? I am just working on the environment version... – user31729 Jun 27 '14 at 12:23
  • It looks like my env-version works :) – Dennis Jun 27 '14 at 12:24
  • @Dennis: So all efforts by us were useless ;-) – user31729 Jun 27 '14 at 12:25
  • Not really, I just found a way (quite similar to yours) in the same moment. You're versions are "similar", but different. I am still learning from you guys! – Dennis Jun 27 '14 at 12:26
5

With a current version of exsheets the package provides a possibility for this. exsheets has a command \addpoints that prints and saves the points for the current {question} environment. The sum of points of a question is available as a question property named points that can be retrieved via \GetQuestionProperty{<property>}{<question ID>}

In combination with exsheets' possibility to create custom headings instances and the command \CurrentQuestionID it is possible to define a heading type that prints the sum of the points saved with \addpoints in the {question} body.

\documentclass{article}
\usepackage{exsheets}

% custom headings instance:
\DeclareInstance{exsheets-heading}{custom}{default}{
  % write the sum of points after the title of the question:
  title-post-code =
    \bfseries~(\GetQuestionProperty{points}{\CurrentQuestionID} Points) ,
  % print the title:
  attach = { main[l,vc]title[l,vc](0pt,0pt) }
}

% use the newly defined heading instance:
\SetupExSheets{
  headings = custom ,
  points/name = Point/s
}

\begin{document}

\begin{question}[name=Java]
  \begin{enumerate}
    \item Hello World (\addpoints{2})
    \item for-each (\addpoints{1})
  \end{enumerate}
\end{question}

\begin{question}[name=C++]
  \begin{enumerate}
    \item Bla bla (\addpoints{2})
    \item Blub blub (\addpoints{4})
  \end{enumerate}
\end{question}

\begin{question}[name=\LaTeX]
  \begin{enumerate}
    \item Foo foo (\addpoints{2})
    \item bar bar (\addpoints{2})
  \end{enumerate}
\end{question}

\end{document}

enter image description here

The spacing looks a bit weird but that could be adjusted, e.g., by adding below = .5\baselineskip to the definition of the headings instance.


With an even more recent version of exsheets (v0.14 2014/06/28, it's already on CTAN and in TeX Live 2014) it is possible with a little bit of effort to define a grading table. The trick is to use question properties. For this I use the properties subtitle, counter and points that are already defined by exsheets. The commands \GetQuestionProperty{<property>}{<question id>} and \ForEachQuestion{<code where #1 refers to the question id>} I loop through all questions and retrieve the needed data:

\documentclass{article}
\usepackage{exsheets}[2014/06/28]

% a custom headings instance that uses the `subtitle' property:
\DeclareInstance{exsheets-heading}{custom}{default}{
  subtitle-format = \bfseries ,
  subtitle-post-code =
    \bfseries~(\GetQuestionProperty{points}{\CurrentQuestionID} Points) ,
  join = {
    title[r,B]number[l,B](.333em,0pt) ;
    title[r,B]subtitle[l,B](.333em,0pt)
  } ,
  attach = { main[l,vc]title[l,vc](0pt,0pt) } ,
  below  = .5\baselineskip
}

% use the new instance, other settings:
\SetupExSheets{
  question/name = Task ,
  headings = custom ,
  points/name = Point/s
}

% define a grading table that retrieves subtitles and points:
\newcommand*\gradingtable{%
  \begin{tabular}{|l|*{3}{c|}c|}\hline
    Task &
      \ForEachQuestion{%
        \GetQuestionProperty{counter}{##1}
        \GetQuestionProperty{subtitle}{##1}\iflastquestion{}{&}%
      }
      & Total \\ \hline
    Points   &
     \ForEachQuestion{\GetQuestionProperty{points}{##1}\iflastquestion{}{&}} &
       \pointssum* \\ \hline
    Reached  &
      \ForEachQuestion{\iflastquestion{}{&}} &
      \\ \hline
  \end{tabular}%
}

\begin{document}

\begin{center}
  \gradingtable
\end{center}

\begin{question}[subtitle=Java,ID=Java]
  \begin{enumerate}
    \item Hello World (\addpoints{2})
    \item for-each (\addpoints{1})
  \end{enumerate}
\end{question}

\begin{question}[subtitle=C++,ID=C++]
  \begin{enumerate}
    \item Bla bla (\addpoints{2})
    \item Blub blub (\addpoints{4})
  \end{enumerate}
\end{question}

\begin{question}[subtitle=\LaTeX,ID=LaTeX]
  \begin{enumerate}
    \item Foo foo (\addpoints{2})
    \item bar bar (\addpoints{2})
  \end{enumerate}
\end{question}

enter image description here

| improve this answer | |
3

This answer leverages the existing \labeling capabilities to write the totals out to the aux file. Then the label value can be used with \ref{} where needed.

As mentioned in the comments, two passes will be required for it to work properly.

Also note, \AtEndDocument is used to call the final \closetask command. This could maybe cause problems if you don't ever use \task... this could be either put into a conditional with a flag that is set on first use of \task, or \task could be turned into an environment to use \begin{task}...\end{task}. Using an environment may actually make more sense semantically, though sub-tasks would not be supported out of the box.

\documentclass[12pt,oneside,a4paper,final]{scrartcl}

\newcounter{task}
\setcounter{task}{0}

% Create a new counter to keep track of points for each task
\newcounter{taskpoints}
\setcounter{taskpoints}{0}

% Create \pointslabel{}{} for saving the points total as a label
\makeatletter
\@ifpackageloaded{hyperref}{%
\newcommand{\pointslabel}[2]{%
   \protected@write \@auxout {}{\string \newlabel {#1}{{#2}{\thepage}{#2}{#1}{}} }%
   \hypertarget{#1}{#2}
}}{%
\newcommand{\pointslabel}[2]{%
\protected@write \@auxout {}{\string \newlabel {#1}{{#2}{}}}}}
\makeatother

% Call \closetask at the end of each task, before beginning next task
\def\closetask{%
\pointslabel{taskpoints:\arabic{task}}{\arabic{taskpoints}}}
\AtEndDocument{\closetask} % Automatically close the last task

% Reset the taskpoints whenever the task increments
\usepackage{chngcntr}
\counterwithin{taskpoints}{task}


\newcommand{\points}[1]{
    % Add #1 points to the taskpoints counter
    \addtocounter{taskpoints}{#1}
    (#1~Points)
}

\newcommand{\task}[1]{
    \closetask % Close out previous task
    \refstepcounter{task}
    \begin{flushleft}
        {\LARGE\bf Task \arabic{task}}
    \end{flushleft}
    {\Large \textbf{#1}}
    % Addition of points with \ref to label
    \leavevmode\hfill (\ref{taskpoints:\arabic{task}} Points)\\
}

\begin{document}

    \task{Java}

    Hello World \points{2}

    for-each \points{1}

    \task{C++}

    Bla bla \points{2}

    Blub blub \points{4}

    \task{Latex}

    Foo foo \points{2}

    bar bar \points{2}


\end{document}
| improve this answer | |
1

This improved version is based on the answer by Christian Huper:

  • it has a more fancy table to print the list of tasks (fixed line wrapping in the table)
  • it prints "1 point" instead of "1 points"

\documentclass[12pt,oneside,a4paper,final]{scrartcl}
\usepackage{nameref}
\usepackage{calculator}%
\usepackage{calc}%
\usepackage{totcount}%
\usepackage{forloop}
\usepackage{tikz}

\newcounter{task}
\setcounter{task}{0}


\xdef\TotalCredits{0}%
\xdef\TaskCredits{0}%
\xdef\SubCredits{0}%

\newcommand{\printpoints}[1]{#1~\pgfmathequal{#1}{1}\ifnum\pgfmathresult=1 point\else points\fi}

\newcommand{\points}[2]{
\item #1 (\printpoints{#2})
\ADD{\TaskCredits}{#2}{\SubCredits}%
\xdef\TaskCredits{\SubCredits}%
}%


\makeatletter
\newcommand{\WriteCreditsToFile}[1]{%
\immediate\write\@auxout{%
\string\newlabel{credits::\number\value{task}}{{\thesection}{\thepage}{#1}{}}
}% End of writing to AUX file
}%
\makeatother
%

\makeatletter
\AtEndDocument{%
\immediate\write\@auxout{%
\string\newlabel{totalcredits}{{\thesection}{\thepage}{\TotalCredits}{}}
}
}
\makeatother


\newenvironment{Task}[1]{%
\xdef\TaskCredits{0}%
\xdef\SubCredits{0}%
\xdef\CreditsSoFar{0}%
    \refstepcounter{task}
    \begin{flushleft}
        {\LARGE\bfseries Task \arabic{task}}
    \end{flushleft}
    {\Large \textbf{#1}}
    \leavevmode\hfill (\nameref*{credits::\number\value{task}}~Points)\\
    \begin{itemize} % Just for 'better' typography
}{% Close it
\end{itemize}
\WriteCreditsToFile{\TaskCredits}%
% Count all credits for the summary%
\ADD{\TotalCredits}{\TaskCredits}{\CreditsSoFar}%
\xdef\TotalCredits{\CreditsSoFar}%
}%


\regtotcounter{task}%

\makeatletter%

\newcounter{loop@@counter}%

\newcounter{totaltask@@counter}%
\newcounter{last@@counter}%

\newcommand{\listoftasks}{%
    \begin{center}
    \setcounter{totaltask@@counter}{\number\totvalue{task}+1}%
    \setcounter{last@@counter}{\number\totvalue{task}}%
    \begin{tabular}{|c||r|c|c|}
    \hline
    Task number & Total credits & Achieved credits\\
    \hline
    \hline
    \forloop{loop@@counter}{1}{\number\value{loop@@counter} < \number\value{totaltask@@counter}}{
        \number\value{loop@@counter} & \nameref*{credits::\number\value{loop@@counter}} Points &
        \ifnum\number\value{loop@@counter}<\number\value{last@@counter}
            \tabularnewline\hline
        \fi
    }
    \tabularnewline
    \hline
    \hline\hline
    Total: & \nameref*{totalcredits} Points & \tabularnewline%
    \hline
    \end{tabular}
    \end{center}
}%

\makeatother


\begin{document}

\listoftasks
\newpage

    \begin{Task}{Java}
      \points{Hello World}{1}
  \end{Task}%

    \begin{Task}{C++}
      \points{for-each}{0.5}
     \points{blub blub}{0.5}
    \end{Task}

    \begin{Task}{Latex}
     \points{Foo}{2}
     \points{bar}{2}
    \end{Task}

\begin{Task}{Fortran54} % ;-)
  \points{Write a Fortran 54 code to  \LaTeX ;-)}{100}
  \points{Write a Babbage machine  code to replace \LaTeX ;-)}{1000}
\end{Task}

\end{document}
| improve this answer | |
  • Sorry about the delay, but you mentioned an issue with \nameref? – user31729 Jul 10 '14 at 12:16
  • Now I know what you mean: The problem is that \nameref* is not expandable, in this case \pgfmathresult contains the command \nameref* but not the reference value. I am working on different solution, but it takes time! – user31729 Jul 12 '14 at 15:14

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.