1

I am missing something on how to enter a sub-entry in the index generated by acro/imakeidx.

enter image description here

enter image description here

enter image description here

assetclass not understood as a sub-entry of asset.

\documentclass{book}
\usepackage{acro}
\usepackage{imakeidx}
\makeindex

\acsetup{
    index/use=true
}

\DeclareAcronym{asset}{%
    short=asset, 
    long= underlying asset
}

\DeclareAcronym{assetclass}{%
    short=asset class, 
    long=asset class, 
%    index = {\ac{asset}!class}
    index = {asset!class}    
}

\begin{document}

This is the demonstration of the usage of \ac{asset}---which is not to be confused with \ac{assetclass}.

\printacronyms

\printindex

\end{document}
2
  • 1
    acro is giving a unique ID to each acronym, and then (by default) using the short name for sorting. Set an index={asset}, in the other acronym to override this. Also, set \makeindex[columns=1] to see the spacing. Two-column mode fills up top-bottom, left-right, and it's hard to see the subitem indentation that way for one item one subitem. P.S.: technically, asset class should/could be indexed as index={asset!asset class},
    – Cicada
    Jul 12, 2021 at 16:07
  • @Cicada Works perfectly ! Merci :)
    – JeT
    Jul 12, 2021 at 16:12

1 Answer 1

1

Just for the record, @Cicada's comment answers my question.

\documentclass{book} 

\usepackage{acro} 
\usepackage{xcolor} 
\usepackage{imakeidx} 
\makeindex[columns  = 1]

\acsetup{ index/use=true } 

\DeclareAcronym{asset}{% 
    short=asset, 
    long= underlying asset, 
    index={asset}, }

\DeclareAcronym{assetclass}{% 
    short=asset class, 
    long=asset class, 
    index = {asset!class} } 

\begin{document} 

This is the demonstration of the usage of \ac{asset}---which is not to be confused with \ac{assetclass}. 

\printacronyms 

\printindex 

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .