Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am looking for a way to setup acronym list such that, on first reference the full name will be listed and the acronym in brackets. From thereon, future reference to the acronym will only give the abbreviated form.

For example, "This is an Association for Computing Machinery (ACM) article. ACM is very popular in computer science."

For both reference to ACM above, I would refer it just like cite, say \abr{ACM}. So the above would be written in tex file as: "This is an Association for \abr{ACM} article. \abr{ACM} is very popular in computer science."

Similar to Bibliography, what ACM stands for would be mentioned somewhere.

I hope the question is clear.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

The glossaries package is widely used for this kind of things.

MWE:

% arara: pdflatex: {synctex: yes}
% arara: makeglossaries
% arara: pdflatex: {synctex: yes}
% arara: pdflatex: {synctex: yes}

\documentclass{IEEEtran}
\usepackage[shortcuts,acronym]{glossaries}

\makeglossaries % generates the acronym list

\newacronym{acm}{ACM}{Association for Computing Machinery}

\begin{document}

This is an \ac{acm} article. \ac{acm} is very popular in computer science.

\printglossaries % prints the acronym list

\end{document} 

Output:

enter image description here

To generate the output you can choose different methods. Supposing that your file is called myfile.tex, you can run

  1. If you have arara installed

    arara myfile

  2. If not, but you have Perl installed

    pdflatex myfile

    makeglossaries myfile

    pdflatex myfile

    pdflatex myfile

  3. If you don't have either arara or Perl

    pdflatex myfile

    makeindex.exe -s myfile.ist -t myfile.alg -o myfile.acr myfile.acn

    pdflatex myfile

    pdflatex myfile

share|improve this answer
    
Working as per requirement. However, the glossary list is not printed. Not sure if it's not printed for the same reason I mentioned earlier. Please look at the comment I left for Harish Kumar. –  Shamim Hafiz Feb 15 at 6:04
    
@ShamimHafiz Which of the ways I mentioned are you using for compiling it? –  karlkoeller Feb 15 at 6:07
    
I am using TexMaker/MixTex on windows, so not sure which step applies. I think, the third one sounds closest to what I want, but haven't tried it. –  Shamim Hafiz Feb 25 at 18:34

You can use acro package that provides numerous options.

\documentclass{IEEEtran}
\usepackage{acro}

% class `abbrev': abbreviations:

% class `nomencl': nomenclature
\DeclareAcronym{acm}{
  short = ACM ,
  long  = Association for Computing Machinery ,
  sort  = A ,
}

\begin{document}

\ac{acm}, is an abbreviation. \Ac{acm} is an association.

\printacronyms    %% put this where you want the list of abbreviations

\end{document}

enter image description here

share|improve this answer
    
Thanks for the reply. I tried using it using TexMaker/MikTex and I got error saying the translations.sty not found. Should this not install automatically. TexMaker did download bunch of packages. –  Shamim Hafiz Feb 15 at 5:56
    
I manually added translations.sty and it appears to do what I want. Although nothing is listed after acronyms, I am good for now. –  Shamim Hafiz Feb 15 at 5:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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