# Questions regarding conversion from acronym package to glossaries

In my thesis I use the acronym package. I have only one problem with the package, which is the lack of capability to capitalize first letter, a functionality which I read is provided by \makefirstuc in glossaries.

I have reservations though since I have already written most of the Thesis and I am wondering if it is too much trouble converting it, or should I seek ways to go around the limitation while sticking to acronym.

My questions are:

1. I make my own custom table for acronyms, because I want to conserve my own table style rather than rely on built-in ones from acronym or glossaries. As such, I need to be able to access the page reference labels that gives the page number the acronym was fist used. With acronym it is simply \pageref{acro:label}. Is there an analogue with glossaries?

2. To be able to build a custom table of abbreviations, I used the starred commands from acronym package, which does not mark the acronyms in the table as "used". This is important because otherwise all page references for the first use will point to the table itself. Does this problem exist with glossaries and if so is it solvable?

3. What are the direct equivalent in glossaries for the acronym commands of:

\acs  %short form
\acl  %long form
\acf  %long form (short form)
\acfi  %emphasized long form (short form)


and their starred versions if any?

-
The custom table can surely be achieved by defining a custom glossary style (section 16 of the user manual). Then you won't need to worry about pageref at all. This would solve questions 1 and 2. Question 3 should be answered by a look into the user manual –  cgnieder Oct 17 '12 at 15:13
This question, Capitalize the first letter in acronym list, might be of interest to you. –  cgnieder Oct 17 '12 at 22:42

The commands for retrieving short and long forms of glossary entries and acronyms are described in detail in the user manual in section 13.

Instead of writing my own table, though, I would suggest using glossaries' feature of creating a custom style for the list.

The example below should demonstrate how to define a custom style. glossaries comes with lots of examples so it is easy to follow the macros needed for the definition. Section 16 of the user manual describes everything in detail.

This only scratches the surface of the glossaries package. One can use it for completely different tasks, too. And just in case it doesn't suit you after all: Nicola Talbot recently described how to write your own glossary/acronym package.

\documentclass{article}
\usepackage{glossaries}
\usepackage{longtable,booktabs}

\newglossarystyle{custom}{%
\renewenvironment{theglossary}%
{%
\begin{longtable}{lll}
\toprule
Acronym & Abbreviation & Reference \\
\midrule
\bottomrule
\endfoot
}%
{\end{longtable}}%
\renewcommand*\glsgroupskip{}%
\renewcommand*{\glossaryentryfield}[5]{%
\glsentryitem{##1}\glstarget{##1}{##2} & \capitalisewords{##3} & p.\,##5\\}%
}

\newacronym{ny}{NY}{New York}
\newacronym{idn}{idn}{identification number}
\makeglossaries

% only for this example:
\parindent=0pt
\begin{document}

\printglossary[type=\acronymtype,title=Acronyms,style=custom]

\verb=\gls= \gls{ny} \gls{idn} \\
\verb=\gls= \gls{ny} \gls{idn} \\
\verb=\acrshort= \acrshort{ny} \acrshort{idn} \\
\verb=\Acrshort= \Acrshort{ny} \Acrshort{idn} \\
\verb=\ACRshort= \ACRshort{ny} \ACRshort{idn} \\
\verb=\acrlong= \acrlong{ny} \acrlong{idn} \\
\verb=\Acrlong= \Acrlong{ny} \Acrlong{idn} \\
\verb=\ACRlong= \ACRlong{ny} \ACRlong{idn} \\
\verb=\acrfull= \acrfull{ny} \acrfull{idn} \\
\verb=\Acrfull= \Acrfull{ny} \Acrfull{idn} \\
\verb=\ACRfull= \ACRfull{ny} \ACRfull{idn}
\end{document}


-
glossaries also has the shortcuts option which defines acronym like macros for the usage of acronyms, see table 13.1 on page 91 in the manual for details. –  cgnieder Oct 17 '12 at 22:45
Thank you for the extremely helpful comments. Very much appreciated. –  Mobius Pizza Oct 18 '12 at 8:16
I have two problem with the page number references. a) The double dashes -- do not convert to endash b) How do I write a macro to count the number of entries of the comma separated page number to pluralize p. to pp. if there are more than one page? –  Mobius Pizza Oct 18 '12 at 13:59
This is a bit unspecific. Regarding a: are you by any chance using XeLaTeX and fontspec and forgot to load the font with Ligatures=TeX? It would be best to ask a new question including a minimal working example (MWE), maybe also refering to this question. –  cgnieder Oct 18 '12 at 15:49
oops didn't know that is important to set that option; on a MWE with fontspec and setmainfont endashes work without Ligatures=TeX, which baffles me. But thanks alot, would be stuck otherwise. –  Mobius Pizza Oct 18 '12 at 16:00