I am typesetting a book, which has got more number of plants. While entering the text, I have to record the total number of plants recorded in my book.
In fact, I have created an index of all these plants, but the question is should I count manually, or LaTeX can count itself.
Here is my simple document.
\documentclass[a4paper,10pt]{article}
%For multiple index
\usepackage{imakeidx}
\makeindex
\makeindex[name=ch, title=Chemical index]
\makeindex[name=pl,title=Plant Index]
\begin{document}
This is my test docment. It contains total 5 plants. Plant 1\index[pl]{plant 1} has
chemicals 1\index[ch]{chemical 1} and 2\index[ch]{chemical 2}. Another plant\index[pl]
{plant 2} continas the chemicals 2\index[ch]{chemical 2} and 3\index[ch]{chemical 3}.
List of plants:
Plant 3\index[pl]{plant 3}
plant 4\index[pl]{plant 4}
plant 5\index[pl]{plant 5}
\printindex
\indexprologue{\small Index of plants}
\printindex[pl]
\indexprologue{\small Index of chemicals}
\printindex[ch]
\end{document}
\macro{word I want to count}
? Where macros can be different? Theny ou could just increase a counter whenever the macro is called.\plant
macro to format all plant names and which increases a count which can be displayed at the very end.