0

Most probably a trivial question for you: I have a counter \thetotalnoexercices that I compute while compiling my book, but I want to refer to it in the introduction ("This book contains ... exercises"). I should write it to the .aux file but the mechanism seems unclear to me (according to my trials!). Many thanks in advance! Best, O.

cgnieder
  • 66,645
  • 3
    Maybe https://tex.stackexchange.com/q/34789/35864 can help you. – moewe Jun 20 '20 at 14:36
  • 3
    You can simply set a \label at the last exercise and then use \ref. – Ulrike Fischer Jun 20 '20 at 14:37
  • Many thanks to both of you! I settled for simplicity and used the totcount packages. Ulrike's solution is perfect for simple files, it took me a while to understand it, but my exercises are numbered according to chapter-exerciseno-questionno. And the label mechanism takes care only of one counter (the last one that goes through refstepsounter I think). Thanks! – Olivier Ramaré Jun 20 '20 at 15:27

0 Answers0