What I'd like to do is that, every time I reference an acronym, it should be rendered with an \index{} using the same value as either the acronym's short or long form.
M(not)WE:
\documentclass{article}
\usepackage{acronym}
\usepackage{makeidx}
\makeindex
\begin{document}
\begin{acronym}
\acro{SE}{StackExchange}
\acro{TDD}{Test-Driven-Development}
\end{acronym}
lorem ipsum \ac{SE} dolor met \ac{TDD}
% should list "SE" and "TDD", or "StackExchange" and "Test-Driven-Development", or both
\printindex
\end{document}
I tried adding an \index{} inside the \acro commands (as in \acro{TDD}{\index{TDD}Test-Driven-Development}, but that does not work.
One workaround would be using a custom command as below, but I would like to think that there's a better solution (which also works for acronym usage other than just the regular \ac).
\newcommand{\SE}{\index{SE}\ac{SE}\xspace}
Any solutions are appreciated, although those that don't require switching to a different "acronyming" or indexing package would be preferable.
Note: This question is indeed nearly identical, but it still requires overwriting each variant of \ac (\acs, \acl, \acf etc.) separately. I'm hoping there's a shorter solution, but that might be too optimistic.
\ac(i.e.\ac,\acs,\acl,\acfetc.) separately. As a computer scientist, I detest duplication, so I'm still hoping for a shorter solution. But thank you regardless :) – PixelMaster Feb 28 '18 at 15:49acronymare you prepared to accept a solution with a different package? – Nicola Talbot Feb 28 '18 at 18:53