Apologies for creating a duplicate question: I exactly want to achieve what @eDeviser asks in Acronym, swap description and acronym but due to my low reputation, I cannot collaborate there: How to swap the short and long form (putting the long form in parentheses) of an acronym when used for the first time? After that just the short form should be displayed.

I struggle incorporating the suggested solution by @clemens (https://tex.stackexchange.com/a/288328/118158). I use Rmarkdown and pandoc to generate a pdf but get the following error:

! Illegal parameter number in definition of \reserved@a.
<to be read again> 
l.165 ...ring{\protect\@acf{#1}}{#1 (\AC@acl{#1})}

pandoc: Error producing PDF from TeX source

relevant parts of Master.Rmd with YAML snippet:

- \usepackage[nohyperlinks, printonlyused]{acronym}
```{r child = 'Abstract.Rmd'}
```{r child = 'Abbreviations.Rmd'}


  \acro{API}[API]{application programming interface}

Abstract.Rmd based on @clemens solution

% singular:
  \texorpdfstring{\protect\@acf{#1}}{#1 (\AC@acl{#1})}%
    \nolinebreak[3] %


1 Answer 1


I was able to solve the issue by making the changes directly in the original acronym.sty file that in my case is located at /usr/local/texlive/2016/texmf-dist/tex/latex/acronym.

I do not understand why the \renewcommand way did not work, though.

You must log in to answer this question.

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