If I understand this correctly you still need to use the acronyms in the document with macros like \gls
or \glslink
. The entries in the acronyms file only define the acronyms, but only the one which are actually used in the document will be listed.
The idea behind this is that you can have a central acronyms definition file used by many different documents, but only the one you actually use in the current document are really displayed. Its the same for .bib
file and BibTeX.
See the glossaries manual, especially section 1.4 Q10 on page 22, for more information.
I suspect the reason why this question has remained unanswered for two years is because it's actually more than one question which doesn't fit in with the way this site works, but it needs to be either answered or closed to get it off the unanswered list.
Your first question (and the question title) you have already answered in a comment. The package option indexonlyfirst
will only add the first use to the location list.
MWE:
\documentclass{article}
\usepackage[nopostdot,% remove dot after description
indexonlyfirst,% only index first use
nomain,acronym,xindy,toc,numberline]{glossaries}
\makeglossaries
\newacronym{MC}{MC}{Monte Carlo}
\newacronym{L}{L}{bond length}
\begin{document}
\printglossaries
\newpage
This is the first use of \gls{MC}.
\newpage
This is the first use of \gls{L}.
\newpage
This is the second use of \gls{MC}.
\newpage
This is the second use of \gls{L}.
\end{document}
Your second question (which really ought to be a separate post) is a little confusing.
For all the comumns, I need to add column names:
Symbol ....... Name and Units ....... First used on Page No.
The dots means white space.
This suggests a 3-column tabular layout, but your example code has six columns. Assuming that you're storing the unit in the user1
field and by "Symbol" you mean the short form (such as L
) and by "Name" you mean the long form (such as bond length
) then the following will produce a three column style (I've just used \AA
for the ångström sign for simplicity, but it would be better to use siunitx
to deal with the units):
\documentclass{article}
\usepackage[nopostdot,% remove dot after description
indexonlyfirst,% only index first use
nomain,acronym,xindy,toc,numberline]{glossaries}
\makeglossaries
\newacronym[user1={\AA}]{L}{L}{bond length}
\newglossarystyle{myunitstyle}{%
\setglossarystyle{long3col}% base it on the long3col style
\renewenvironment{theglossary}%
{\begin{longtable}{llc}}%
{\end{longtable}}%
\renewcommand*{\glossaryheader}{%
\bfseries Symbol&\bfseries Name and Units&
\bfseries First used on Page No.\tabularnewline\endhead}%
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrydesc{##1} \glsentryuseri{##1} & ##2\tabularnewline
}%
}
\setglossarystyle{myunitstyle}
\begin{document}
\printglossaries
\newpage
This is the first use of \gls{L}.
\newpage
This is the second use of \gls{L}.
\end{document}
This produces:
Best Answer
Putting my comments into an answer: the answer can be found in the user manual of
glossaries
. One can either turn off the hyperlinks of individual occurences by using\gls[hyper=false]{}
or the shortcut\gls*{}
. This is described in detail in section 6 “Links to Glossary Entries”.If one wants to disable the links in general one can use the command
\glsdisablehyper
. (There is also\glsenablehyper
which can be used to turn the links on again. Both commands act locally.) They are explaind in section 6.2 “Enabling and disabling hyperlinks to glossary entries”.