4

I am using the acronym package and have the following problem: In my document, I always want to use \ac{...} for my acronyms, so I don't have to care about whether I already mentioned the full name of the acronym or not. \ac{...}'s default behavior is that it prints the full name and the acronym in brackets when the acronym is mentioned the first time (Example: \ac{HTML} is printed as "HyperText Markup Language (HTML)"). The next time I use it, only the acronym gets printed.

This is okay in most cases. But for some acronyms, like "HTML", it would be better to have the acronym first and the full name in brackets, like "HTML (HyperText Markup Language)". I can achieve this if I write \acs{HTML} (\acl{HTML}), but then I can't use \ac{HTML}, because the next time it will print the full version + acronym in brackets again ;)

Is there any way to reverse the full name and the acronym at the first time \ac{} is used (or is there an alternative command to achieve this)?

I know that it seems to be possible with the glossaries package (see here) but the solution provided there is applied to all acronyms, not only to some of them. Also I would like to keep the acronym package if possible.

4

Pascal Ockert's answer is great, and but for formatting this might be a comment to it. I would define a macro as follows:

\newcommand{\acr}[1]{\acs{#1} (\aclu{#1})}

where r stands for reversed. In case you want the first definition to be plural, you could also define:

\newcommand{\acrp}[1]{\acsp{#1} (\aclp{#1})\acused{#1}}

which uses \acused to mark the macro used in the absence of \aclup or \acsup.

1

I found out that there are \aclu{} and \acsu{}. They print the long/short form of the acronym and mark it as "used" for \ac{}.

To print "HTML (HyperText Markup Language)" at the first time and make the next \ac{HTML} work correctly (= print acronym without long form), I use

\acs{HTML} (\aclu{HTML})
1

Since version 1.1 of acro it's possible to write: \acsetup{first-style=reversed} in the preamble. This will do exactly what was wanted.

  • Isn't that the acro package instead of the acronym package? – Socrates Jun 24 '18 at 14:42
  • @Socrates maybe, I don't know. – Thorbjørn E. K. Christensen Jun 24 '18 at 14:59

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.