Assume I have a big document that uses several macros, say \AAA, \BBB, etc., through the whole document.

Is there a way that I can have a list of all these macros in the final pdf? I want to repeat all the \AAA calls at the beginning for example, to have a very quick glance at them while writing the document.

An optional feature would use hyperref to click on one \AAA of the list to go directly on the pdf page where the macro is actually used.

  • \tracingmacros? – Henri Menke Mar 15 '14 at 9:42
  • This seems overkill. I only want some macros, not all. – wwjoze Mar 15 '14 at 9:48

You could put a \hypertarget in every call of \AAA, where the name uses a counter. Afterwards you can reference it by \hyperlink.

In the example the \AAA No. 1, etc. are clickable links.

\pagestyle{empty}% for cropping
    \advance\countAAA by 1%
    AAA% your replacement text goes here
\newcommand\blindtext{\par\noindent Lorem ipsum dolor sit amet \par\noindent}
\section{Some text with \texttt{\string\AAA} macros}
\section{List of \texttt{\string\AAA} calls}
There are \the\countAAA\ calls of \texttt{\string\AAA} throughout the document.

\foreach \i in {1,...,\the\countAAA} {
    \hyperlink{AAA\i}{\texttt{\string\AAA} No.\ \i}

enter image description here

  • @wwjoze You can also replace the pgffor package with tikz, if you need drawing functionality. – Henri Menke Mar 15 '14 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.