4

I defined acronyms like:

\newacronym{sdk}{SDK}{Software Development Kit}

use it in the text:

  • Page 3: Test test \acrshort{sdk}
  • Page 6: test test \acrshort{sdk}.
  • Page 9: Test \acrshort{sdk}

and print it like this:

\printglossary[type=\acronymtype]

with this outcome:

SDK Software Development Kit. 3, 6, 9

Question:

How can i manage to display only the first appearance?

Like this:

SDK Software Development Kit. 3

Thx in Advance.

Edit - Minimal Example:

\documentclass{memoir}

\usepackage{bookmark,hyperref}
\usepackage[toc]{glossaries}
\makeglossaries

\newacronym{sdk}{SDK}{Software Development Kit}

\begin{document}
Test \acrshort{sdk}
\newpage
Test \acrshort{sdk}.
\newpage
Test \acrshort{sdk}\newpage
Test \newpage
Test \acrshort{sdk}\newpage
Test \newpage
Test \newpage
Test \acrshort{sdk}\newpage
Test \acrshort{sdk}\newpage
\printglossary[type=\acronymtype]
\end{document}
3
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – cfr
    Aug 23, 2014 at 21:20
  • Can you not just write SDK after the first occurrence? That is, if you don't want the package to count it as the use of an acronym, then just don't tell the package that it is an acronym.
    – cfr
    Aug 23, 2014 at 21:21
  • @ minimal example: ok added it. @ your suggestion: Yes but i would also like to have the link of the acronym to the glossary. otherwise i could just introduce it once and glossary is not needed
    – ddd
    Aug 24, 2014 at 9:36

1 Answer 1

3

Ok i figured it out..

The indexonlyfirst parameter and the switch to \gls did the trick (i custumized it so that also the short version is used the first time) as mentioned here: List of Acronyms: only first use in numberlist and table of content style dots

Solution:

\documentclass{memoir}

\usepackage{bookmark,hyperref}
\usepackage[toc,indexonlyfirst]{glossaries}
\setlength{\glslistdottedwidth}{\textwidth} % adjust to suit

\newglossarystyle{mydottedstyle}{
 \glossarystyle{list}%
 \renewcommand*{\glossaryentryfield}[5]{%
    \item[]\makebox[\glslistdottedwidth][l]{%
      \glsentryitem{##1}\glstarget{##1}{\textbf{##2} ##3}%
      \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##5}%
}       
\glossarystyle{mydottedstyle}   

\renewcommand*{\CustomAcronymFields}{%
  name={\the\glsshorttok},% name is abbreviated form
  description={\the\glslongtok},% description is long form
  first={\noexpand\the\glsshorttok},%
  firstplural={\noexpand\the\glsshorttok},%
  text={\the\glsshorttok},%
  plural={\the\glsshorttok\noexpand\acrpluralsuffix}%
}   
\SetCustomStyle 

\makeglossaries 

\newacronym{sdk}{SDK}{Software Development Kit}

\begin{document}
Test \gls{sdk}
\newpage
Test \gls{sdk}.
\newpage
Test \gls{sdk}\newpage
Test \newpage
Test \gls{sdk}\newpage
Test \newpage
Test \newpage
Test \gls{sdk}\newpage
Test \gls{sdk}\newpage

\printglossary[type=\acronymtype]
\end{document}

You must log in to answer this question.

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