I have a large pdflatex document where each chapter is located in an extra text file and included with \include{chapter3.tex}
...
- How can I extract the page numbers of each chapter and write them into a text file?
I want to know how many pages each chapter has (at a certain moment) and get a list with e. g.
(Can this be done with the included text files or would it be better to define labels at the start of each chapter and then read out the page numbers of those labels)?
chapter 1: 5 pages
chapter 2: 10 pages
chapter 3: 4 pagesdocument: 19 pages
- Furthermore I'd like to count the occurences of certain commands like e. g.
\N{note}
or\NK{note}
(which I have defined for creating notes in the document with thefixme
package per chapter and write them also in the text file like:
chapter \N \NK
chapter 1: 20 3
chapter 2: 3 5document: 23 8
.toc
file easily, with a few regexps. I did it once with python, splitting the output PDF file in per-chapter PDF's including meaningful titles. I will post the script for inspiration when I get to my other computer later.