1

I am trying to print a list of acronyms using the glossaries package.

Sometimes, I have nested acronyms, where an acronym includes another. Here is a MWE:

\documentclass[12pt, a4paper]{article}
\usepackage[indexonlyfirst,numberline,nopostdot,toc,hyperfirst=false]{glossaries}

\newacronym{QKD}{QKD}{Quantum Key Distribution}
    \newacronym[parent=QKD]{CV-QKD}{CV-QKD}{Continuous Variable \glstext{QKD}}
    \newacronym[parent=QKD]{DV-QKD}{DV-QKD}{Discrete Variable \glstext{QKD}}
    \newacronym[parent=QKD]{MDI-QKD}{MDI-QKD}{Measurement Device Independent \glstext{QKD}}
\newacronym{OA}{OA}{Other Acronym}
\newacronym{AE}{AE}{Acronym Example}


\makeglossaries{}

\begin{document}
    \printglossary[type=\acronymtype,title={Abbreviations}]
    \section{Section 1}
        \gls{QKD} is the main acronym. We can also have subcategories of \gls{QKD} such as \gls{CV-QKD}, \gls{DV-QKD}, or \gls{MDI-QKD}.

        Other acronyms exist such as \gls{OA} or \gls{AE}.
\end{document}

However, this produces the following:

enter image description here

I would like to have a list formatted like this:

- Acronym + Definition
- Acronym + Definition
--Subacronym + Definition
--Subacronym + Definition
-Acronym + Definition

An alternative might be using the alttree style:

\usepackage[indexonlyfirst,numberline,nopostdot,toc,hyperfirst=false,style=alttree]{glossaries}

Which seems to do what I want, but it results in an overlap between the acronym and its definition:

enter image description here

Is it possible to solve this (either by fixing this or by using another style), as well as increasing the indentation of the sub-acronyms?


EDIT:

I did manage to sort this out, as per this guide:

If you forget to set the widest entry, the description will overlap the name.

This solves the issue, however the indentation of the sub-acronyms is now too big, as it indents it at the description level.

enter image description here

My question now becomes, how do I reduce the indentation?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.