At the moment I am writing a template used for homework. For style reasons, I would like to have a title page with a table containing all maximum points per exercise and free space, for the number of points I got.

I defined an own theorem-environment exercise that becomes the maximum amount of points possible in this exercise. e.g. an exercise with 4 points maximum

     Some text here...

I can use this number (stored as a counter) later in the document, but I would like to have the table as first page.

Is it possible to access a value before it is defined? Something like the table-of-contents would be ok. First compilation all values are stored, the table shows zeroes. Second compilation, the table shows the correct numbers. In short words, I would like to see something like in the exam class, where you are able to define points and they are shown on titlepage. But since our exercises are quite more complex, I would like to use my own package and replicate this mechanic.

  • 2
    Welcome to TeX.SE. You don't mean 'counters' itself that aren't defined, you mean that counter values are used before they are assigned, rather
    – user31729
    Oct 25, 2017 at 22:40

1 Answer 1


This stores the credit points to a .exer file, which is like a .toc, begin displayed with \listofcredits, the total number of credit points is displayed at the end of the list.

The \@starttoc macro loads the .exer file.

More information is needed however, to improve design and features.





  \section*{Credit points}







enter image description here

  • Since exercise is apparently defined without any title, there's not much left to write to the .exer file, giving more information on the exercise in \listofcredits
    – user31729
    Oct 26, 2017 at 8:31

You must log in to answer this question.

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