Closed ratmice closed 1 year ago
You could redefine the template for the list (or define your own template) in a way that it just prints nothing if the list is empty:
\documentclass{article}
\usepackage{acro}
\RenewAcroTemplate[list]{description}{%
\acronymsmapT{}{%
\acroheading
\acropreamble
\begin {description}
}%
\acronymsmapT{
\item[\acrowrite{short}\acroifT{alt}{/}\acrowrite{alt}]
\acrowrite{list}%
\acroifanyT{foreign,extra}{ (}%
\acrowrite{foreign}%
\acroifallT{foreign,extra}{, }%
\acrowrite{extra}%
\acroifanyT{foreign,extra}{)}%
\acropagefill
\acropages
{\acrotranslate{page}\nobreakspace}
{\acrotranslate{pages}\nobreakspace}%
}
{\end{description}}
}
\DeclareAcronym{HS}{%
short = HS,
long = Hockey Sticks ,
long-plural = es ,
tag = equipment
}
\DeclareAcronym{he2xHS}{%
short = he2xHS ,
long = Hell ,
tag = badwords
}
\begin{document}
\printacronyms[include=equipment, display = used, name={Equipment}]
\printacronyms[include=badwords, display = used, name={Bad Words}]
Bring your \ac{HS}% to \ac{he2xHS}
\end{document}
Thanks, I'll give that a go, and leave it up to you whether you think something should be added or alternately if this should just be closed
I would like to do something like the following for a series of documents which share tags and potentially unused tags, Currently, when using an empty list, it still shows the heading, and complains:
I assume rather than making an entire setting for not printing the heading of an empty list, a conditional might be more flexible? Something to the effect of:
\ifthenelse{\FictionalIfAcronymsEmptyTest[include=badwords]}{\printacronyms[include=badwords, display = used, name={Bad Words}]}{}
I figure that could be problematic due to the 're-compile to get the list filled', and that I would also need something which filled the acronyms without printing them.
I am new to the package, and have just been reading through the manual today, but haven't seen any documented way to do this kind of thing.
below is a moderately silly minimal example: