Hello, Johannes,
first of all thank you for your answer. I apologize for the late reply, but I was out of work for some days.
Well, what I would like to achieve in my code is: the amount of pages of each appendix must be literally written in the table of contents. For example, if appendix A has 5 pages, the table of contents should look like that:
......
Appendix A - 5 pages ....... page 89
......
The question is that I would like to do it automatically, i. e., not counting manually the amount of pages of each appendix and writting it in the table of contents. In order to achieve it, I made a file - called
Test in my example - that should be fed with the total number of pages of a particular appendix in this way:
Code: Select all
\section*{Appendix A --- Title of Appendix A}
\setcounter{paginaini}{\value{page}}
\addtocounter{paginaini}{-1}
Text of Appendix A.
\setcounter{paginas}{\value{page}}
\addtocounter{paginas}{-\value{paginaini}}
\newwrite\temporario
\immediate\openout\temporario=Test
\immediate\write\temporario{\thepaginas}
\immediate\closeout\temporario
\addcontentsline{toc}{section}{\input{Test} pages}
So I should run the code twice to get the correct amount of pages written in the table of contents. Would you have a suggestion for my case?
Thank you very much!