# Use different titles - and styles - for lists and sub-lists of acronyms (glossaries package)

I am trying to add one main list of abbraviations and two subsection that contain other sub-lists of abbreviations with different titles in the frontmatter of my document, using the "acronym" from the glossaries package, and having the titles appear in the table of content as "List of Abbreviations" (main title), "Time" (subsection), "Cities" (subsection).

Is there a way to split the acronyms in main and subsets with a a title each? I can see that this is possible for example using the \newglossary command if it is a glossary and then specifying the "type" when defining a new term for the glossary, but is there a similar function for acronyms? I am also trying to slightly change the style of the two lists acronyms by for example adding \texttt.

Thanks very much for any help, muuuuch appreciated!

\documentclass{article}

% Abbreviations
\usepackage[acronym,nonumberlist,toc]{glossaries}
%Remove the dot at the end of glossary descriptions
\renewcommand*{\glspostdescription}{}
\renewcommand*{\acronymname}{List of Abbreviations}
\renewcommand*\acronymname{Time}
\newacronym{utc}{UTC}{Coordinated Universal Time}

\renewcommand*\acronymname{Cities}
\newacronym{la}{LA}{Los Angeles}
\newacronym{ny}{NY}{New York}

\makeglossaries

\begin{document}
\frontmatter

\listoffigures  % print list of figures
\listoftables  % print list of tables

\printglossaries

\mainmatter
\chapter{Introduction}

% Use the acronyms
\gls{utc} is 3 hours behind \gls{adt}.
\gls{ny} is 3 hours ahead of \gls{la}.

\end{document}


I have something working OK, but I still cannot get it to print the main acronyms and then the others as sub-lists correctly:

\documentclass{article}

\usepackage{hyperref}
\usepackage[style=long, nonumberlist, nogroupskip]{glossaries}
\makenoidxglossaries
% The main title "List of Abbreviations with some acronyms should be printed first, followed by the subsections "Time" and "Cities"
%\setglossarysection{section}
\newglossary[alg1,nonumberlist, type=\acronymtype, section=subsection]{time}{acn1}{acr1}{Time}
\newglossary[alg2,nonumberlist,type=\acronymtype, section=subsection]{cities}{acn2}{acr2}{Cities}

% This entry is part of the main glossary
\newglossaryentry{orange}{name=orange, description={an orange coloured fruit},first={Orange}}

\newglossaryentry{utc}{type=time, name=\textsf{UTC}, description={Coordinated Universal Time},first={Coordinated Universal Time (UTC)}}

\newglossaryentry{la}{type=cities, name=\textrm{LA}, description={Los Angeles},first={Los Angeles (LA)}}

%: ----------------------- list of figures/tables/acronyms ------------------------

\begin{document}
\frontmatter

\listoffigures % print list of figures
\listoftables  % print list of tables

\clearpage
\phantomsection
\printglossary[title=List of Abbreviations, toctitle=List of Abbreviations]
\printnoidxglossary[type=time]
\printnoidxglossary[type=cities]

\mainmatter
\chapter{Introduction}

% Use the acronyms
\gls{orange} is a main acronym, while \gls{utc} is part of a sub-list of acronyms called Time and \gls{la} is part of another sub-list of acronyms called Cities.

\end{document}


\newacronym internally uses \newglossaryentry and has an optional argument that can be used to add any extra keys that the entry requires. There are two possible approaches. The first is to use child entries:

\documentclass{book}

% Abbreviations
\usepackage[acronym,nonumberlist,
nopostdot,% Remove the dot at the end of glossary descriptions
style=tree,% use hierarchical style
toc]{glossaries}

\makeglossaries

\renewcommand*{\acronymname}{List of Abbreviations}

\newglossaryentry{time}{name=Time,description={}}

\newacronym[parent=time]{utc}{UTC}{Coordinated Universal Time}

\newglossaryentry{cities}{name=Cities,description={}}

\newacronym[parent=cities]{la}{LA}{Los Angeles}
\newacronym[parent=cities]{ny}{NY}{New York}

\begin{document}
\frontmatter

\printglossaries

\mainmatter
\chapter{Introduction}

% Use the acronyms
\gls{utc} is 3 hours behind \gls{adt}.
\gls{ny} is 3 hours ahead of \gls{la}.

\end{document}


This produces:

In this case the glossary style must be one that supports hierarchical entries, so I've chosen the tree style for the MWE. See the Predefined Glossary Styles table in the user manual for other options (the maximum level needs to be 1 or more, but should not be one of the homograph styles).

The second approach is to define different glossaries and use the type key. For example:

\documentclass{book}

\usepackage[nonumberlist,
nopostdot,% Remove the dot at the end of glossary descriptions
style=tree,% change as appropriate
toc]{glossaries}

\newglossary{time}{gls2}{glo2}{Time}
\newglossary{cities}{gls3}{glo3}{Cities}

\makeglossaries

\newglossaryentry{sample}{name=sample,description={an example}}

\newacronym[type=time]{utc}{UTC}{Coordinated Universal Time}

\newacronym[type=cities]{la}{LA}{Los Angeles}
\newacronym[type=cities]{ny}{NY}{New York}

\begin{document}
\frontmatter

\printglossary

\chapter{List of Abbreviations}
\setglossarysection{section}

\printglossary[type=time]
\printglossary[type=cities]

\mainmatter
\chapter{Introduction}

\gls{utc} is 3 hours behind \gls{adt}.
\gls{ny} is 3 hours ahead of \gls{la}.

\gls{sample} entry.

\end{document}


This puts the main glossary in a chapter (assuming you want that) but the two abbreviation glossaries are placed in sections. The result looks like:

The style no longer needs to be one that supports child entries, so you can change it to whatever is suitable.