[Tex/LaTex] Print acronym + full name in brackets at the first occurence of \ac{XYZ}

acronyms

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.

Best Answer

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.