2

I've written a report using the acro package. It was reviewed for compliance with organizational standards. In the list of abbreviations at the end, I have to precede each acronym with "(U)". Is there an easy way to do this?

For example, on the first occurrence, I want "read-only memory (ROM)" in the main body, but I want "\textbf{(U) ROM} read only memory" in the list of abbreviations at the end of a report.

1 Answers1

2

This should work:

\documentclass{article}
\usepackage{acro}

\DeclareAcronym{rom}{
  short = ROM,
  long = read-only memory,
}

\newcommand*\mylistformat[1]{(\textbf{U}) #1}

\acsetup{
  list-short-format = \mylistformat
}

\begin{document}

Lorem ipsum \ac{rom}. Long: \acl{rom}. Short: \acs{rom}.

\printacronyms

\end{document}

enter image description here

(The extra boldface around the (U) isn't visible because the default list is built as description list where items are bold, anyway…)

cgnieder
  • 66,645
  • Thanks, clemens! Your answer drills down under the hood in the sense that the mylistformat command doesn't seem to show up in the ACRO documentation. That's fine, it works. From experimentation, I found that if I decided that I don't want bold in the prefixing "(U)", I use \newcommand*\mylistformat[1]{\normalfont{(U)} \textbf{#1}}. – user2153235 Dec 30 '19 at 17:51
  • Well, the new in \newcommand tells that it defines a previously undefined command. \mylistformat doesn't exist in acro. It is a random command name I came up with for the sake of this answer. – cgnieder Dec 30 '19 at 18:02
  • Of course! Thanks for straightening me out on that. The documentation's example for list-short-format is \scshape, which googling reveals as a command put between curly braces, along with text that it should apply to. Your example above of a command that takes an argument reveals how list-sort-format can be more flexibly used. – user2153235 Dec 30 '19 at 20:28