Acronym, swap description and acronym

In order to generally swap acronym and description one can redefine \@acf and \acfa for singular forms and \@acfp and \acfpa for plural forms. Their definitions are

\newcommand*{\acfa}[1]{%
   \texorpdfstring{\protect\@acf{#1}}{\AC@acl{#1} (#1)}}
\newcommand*{\@acf}[1]{%
    \ifAC@footnote
       \acsfont{\AC@acs{#1}}%
       \footnote{\AC@placelabel{#1}\AC@acl{#1}{}}%
    \else
       \acffont{%
          \AC@placelabel{#1}\AC@acl{#1}%
          \nolinebreak[3] %
          \acfsfont{(\acsfont{\AC@acs{#1}})}%
        }%
     \fi
     \ifAC@starred\else\AC@logged{#1}\fi}

and

\newcommand*{\acfpa}[1]{%
   \texorpdfstring{\protect\@acfp{#1}}{\AC@aclp{#1} (\AC@acsp{#1})}}
\newcommand*{\@acfp}[1]{%
   \ifAC@footnote
      \acsfont{\AC@acsp{#1}}%
      \footnote{\AC@placelabel{#1}\AC@aclp{#1}{}}%
   \else
      \acffont{%
         \AC@placelabel{#1}\AC@aclp{#1}%
         \nolinebreak[3] %
         \acfsfont{(\acsfont{\AC@acsp{#1}})}%
         }%
   \fi
   \ifAC@starred\else\AC@logged{#1}\fi}

The change is rather trivial – exchange short (\AC@acs{#1}) and long (\AC@acl{#1}) forms and surround the long form with parentheses rather than the short form:

\documentclass{article}
\usepackage{acronym}

\newacro{CSS}{Cascading Style Sheets}
\newacro{CD}{Compact Disc}

\makeatletter
% singular:
\renewcommand*{\acfa}[1]{%
  \texorpdfstring{\protect\@acf{#1}}{#1 (\AC@acl{#1})}%
}
\renewcommand*{\@acf}[1]{%
  \ifAC@footnote
    \acsfont{\AC@acs{#1}}%
    \footnote{\AC@placelabel{#1}\AC@acl{#1}{}}%
  \else
    \acffont{%
      \AC@placelabel{#1}%
      \acfsfont{\acsfont{\AC@acs{#1}}}%
      \nolinebreak[3] %
      (\AC@acl{#1})%
    }%
  \fi
  \ifAC@starred\else\AC@logged{#1}\fi
}

% plural:
\renewcommand*{\acfpa}[1]{%
  \texorpdfstring{\protect\@acfp{#1}}{\AC@acsp{#1} (\AC@aclp{#1})}
}
\renewcommand*{\@acfp}[1]{%
  \ifAC@footnote
    \acsfont{\AC@acsp{#1}}%
    \footnote{\AC@placelabel{#1}\AC@aclp{#1}{}}%
  \else
    \acffont{%
      \AC@placelabel{#1}%
      \acfsfont{\acsfont{\AC@acsp{#1}}}%
      \nolinebreak[3] %
      (\AC@aclp{#1})%
    }%
  \fi
  \ifAC@starred\else\AC@logged{#1}\fi
}
\makeatother

\begin{document}

\ac{CSS}

\acp{CD}

\end{document}

Tags:

Acronyms