5

I would like to redefine the way acronym looks when I use \acrfull macro. Now it shows meaning of acronym and then abbreviation in brackets, but I would like it to show the opposite way - abbreviation and then meaning in brackets.

If I put it this way

\newacronym{hsv}{HSV}{eng. Hue, Saturation, Value}

it shows

... eng. Hue, Saturation, Value (HSV) ...

and I would like it to look like

... HSV (eng. Hue, Saturation, Value) ...

Is it possible to do something like this only for \acrfull macro?

3
  • 1
    Hi, please post a MWE with the output of your first quote. That saves us time. Thanks.
    – LaRiFaRi
    Sep 14, 2013 at 11:34
  • Chapter 13.3 on page 99 in mirror.switch.ch/ftp/mirror/tex/macros/latex/contrib/glossaries/… may be of help. You can try to redefine your acronym appearance.
    – LaRiFaRi
    Sep 14, 2013 at 11:41
  • If you need the same behavior for \Acrfull and \ACRfull also, let me know and I'll add something in the answer. Sep 14, 2013 at 14:37

1 Answer 1

4

You can redefine \acrfullformat and swap the arguments:

\renewcommand{\acrfullformat}[2]{#2\space(#1)}

Thus, the following MWE

% arara: pdflatex: {synctex: yes}
% arara: makeglossaries
% arara: pdflatex: {synctex: yes}
% arara: pdflatex: {synctex: yes}

\documentclass{article}

\usepackage[acronym]{glossaries}

\renewcommand{\acrfullformat}[2]{#2\space(#1)}

\newacronym{hsv}{HSV}{eng. Hue, Saturation, Value}

\makeglossaries


\begin{document}

\noindent \acrfull{hsv}.

\printglossaries

\end{document} 

gives:

enter image description here


Obviously, the previous solution also affects commands like \gls.

If you really want that behaviour only for the command \acrfull you can add the following lines to the preamble:

\makeatletter
\def\@acrfull#1#2[#3]{%
  \acrlinkfullformat{\@acrshort}{\@acrlong}{#1}{#2}{#3}%
}
\makeatother

In this way, the following MWE

% arara: pdflatex: {synctex: yes}
% arara: makeglossaries
% arara: pdflatex: {synctex: yes}
% arara: pdflatex: {synctex: yes}

\documentclass{article}

\usepackage[acronym]{glossaries}

\makeatletter
\def\@acrfull#1#2[#3]{%
  \acrlinkfullformat{\@acrshort}{\@acrlong}{#1}{#2}{#3}%
}
\makeatother

\newacronym{hsv}{HSV}{eng. Hue, Saturation, Value}

\makeglossaries


\begin{document}

\noindent \gls{hsv} 

\noindent \acrfull{hsv}

\printglossaries

\end{document} 

gives the desired result only for \acrfull:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .