1

The solution to the original problem was resolved here: Acronyms sorted alphabetically in Index , in which I was trying to include acronyms in the index every time the command \gls{acronym} was used. The provided code worked very well, however, I noticed the acronyms are only displayed in the Index when used twice or more (MWE and output below). I have a long list of acronyms only mentioned once throughout the text and I need them all to be displayed in the Index. Any ideas?

\documentclass[11pt]{article}
\usepackage{makeidx}
\makeindex
\usepackage[acronym,toc,shortcuts]{glossaries}
\makeglossaries

\renewcommand*{\CustomAcronymFields}{%
  name={\the\glsshorttok},%
  symbol={\the\glsshorttok},%
  text={\the\glsshorttok\protect\index{\the\glslongtok\space(\the\glsshorttok)}},%
  plural={\the\glsshorttok\noexpand\acrpluralsuffix\protect\index{\the\glslongtok\space(\the\glsshorttok)}},%
  first={\the\glslongtok\space(\the\glsshorttok)},%
  firstplural={\the\glslongtok\noexpand\acrpluralsuffix\space(\the\glsshorttok)},%
  description={\the\glslongtok}%
}

\SetCustomStyle

\newacronym{cd}{CD}{compact disk}
\newacronym{cho}{CHO}{chinese hamster ovary}
\newacronym{bhk}{BHK}{baby hamster kidney}
\newacronym{hek}{HEK}{human embryonic kidney}
\newacronym{hgh}{HGH}{human growth hormone}
\newacronym{scfv}{scFv}{small chain variable fragment}
\newacronym{pi}{pI}{isoelectric point}


\begin{document}
\noindent
First\index{first} use of \gls{cd}\\
subsequent\index{subsequent} use of \gls{cd}
, and
\gls{cho} and
\gls{bhk} and
\gls{hek} and
\gls{hgh} and again \gls{hgh} %used twice and displayed, likewise \gls{cd}
\gls{scfv} and
\gls{pi}.

\printglossaries
\printindex

\end{document}

enter image description here

0
3

Sorry, I forgot to add \index to the first and firstplural keys, which is why the terms on first use weren't being indexed. Here's the corrected MWE:

\documentclass[11pt]{article}
\usepackage{makeidx}
\makeindex
\usepackage[acronym,toc,shortcuts]{glossaries}
\makeglossaries

\renewcommand*{\CustomAcronymFields}{%
  name={\the\glsshorttok},%
  symbol={\the\glsshorttok},%
  text={\the\glsshorttok\protect\index{\the\glslongtok\space(\the\glsshorttok)}},%
  plural={\the\glsshorttok\noexpand\acrpluralsuffix\protect\index{\the\glslongtok\space(\the\glsshorttok)}},%
  first={\the\glslongtok\space(\the\glsshorttok)\protect\index{\the\glslongtok\space(\the\glsshorttok)}},%
  firstplural={\the\glslongtok\noexpand\acrpluralsuffix\space(\the\glsshorttok)\protect\index{\the\glslongtok\space(\the\glsshorttok)}},%
  description={\the\glslongtok}%
}

\SetCustomStyle

\newacronym{cd}{CD}{compact disk}
\newacronym{cho}{CHO}{chinese hamster ovary}
\newacronym{bhk}{BHK}{baby hamster kidney}
\newacronym{hek}{HEK}{human embryonic kidney}
\newacronym{hgh}{HGH}{human growth hormone}
\newacronym{scfv}{scFv}{small chain variable fragment}
\newacronym{pi}{pI}{isoelectric point}


\begin{document}
\noindent
First\index{first} use of \gls{cd}\\
subsequent\index{subsequent} use of \gls{cd}
, and
\gls{cho} and
\gls{bhk} and
\gls{hek} and
\gls{hgh} and again \gls{hgh}
\gls{scfv} and
\gls{pi}.

\printglossaries
\printindex

\end{document}

The index is now:

Image of index

1
  • Dear Nicola, Working on a new document I had the need of using formatted acronyms (such as italic letters) and those get listed inside the Index under a "Symbols" category. I posted a question and I would be very grateful to have your input: [tex.stackexchange.com/questions/215967/…
    – PMG870505
    Dec 8 '14 at 15:46

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.