Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{book}
- %compile twice
- \usepackage{xassoccnt}
- \NewTotalDocumentCounter{totalfigures}
- \NewTotalDocumentCounter{totaltables}
- \NewTotalDocumentCounter{appendixchapters}
- \DeclareAssociatedCounters{figure}{totalfigures}
- \DeclareAssociatedCounters{table}{totaltables}
- \NewTotalDocumentCounter{totalpages}
- \DeclareAssociatedCounters{page}{totalpages}
- \makeatletter
- \DeclareAssociatedCounters{page}{totalpages}
- \AtBeginDocument{%
- \addtocounter{xassoccnt@total@totalpages}{1}
- }
- \makeatother
- \begin{document}
- There are \TotalValue{totalfigures} figures in this document
- There are \TotalValue{totaltables} tables in this document
- There are \TotalValue{appendixchapters} appendix chapters in this document
- There are \TotalValue{totalpages} pages in this document
- \chapter{First}
- \begin{figure}
- \caption{Figure foo \thefigure}
- \end{figure}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \chapter{Second}
- \begin{figure}
- \caption{Figure foo \thefigure}
- \end{figure}
- \begin{figure}
- \caption{Figure foo \thefigure}
- \end{figure}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \appendix
- \AddAssociatedCounters{chapter}{appendixchapters}
- \chapter{Foo Appendix}
- \chapter{FooBar Appendix}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \begin{table}
- \caption{Table foo \thetable}
- \end{table}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement