1

This question is related to the following question.

I would like to know if there exists a way to configure the command \acroauthor so that it's generate (Organization for the Advancement of Structured Information Standards, 2012) when it is used once and (OASIS, 2012) from the second time it is used?

1 Answer 1

1

You have to slightly amend the macro \acroauthor to get that right:

    \begin{filecontents*}{\jobname.bib}
    @article{oasis,
     author={{\acroauthor{Organization for the Advancement of Structured Information Standards}{OASIS}}},
     title={Some title},
     journal={J. Something},
     year={2012},
    }
    \end{filecontents*}
    \documentclass{article}
    \usepackage[authoryear]{natbib}

    \usepackage{etoolbox}

    \newif\ifabbreviation
    \pretocmd{\thebibliography}{\global\abbreviationfalse}{}{}
    \AtBeginDocument{\global\abbreviationfalse}
    \DeclareRobustCommand\acroauthor[2]{%
      \ifabbreviation #2\else #1\global\abbreviationtrue\fi}

    \begin{document}

    Here it is \citep{oasis}

    A second time \citep{oasis}

    \bibliographystyle{plainnat}
    \bibliography{\jobname}

    \end{document}

This will get the desired output.

enter image description here

2
  • How can I add the acronym (OASIS) after Organization for the Advancement of Structured Information Standards in the references? Without changing how the first quote is appearing, that is, [Organization for the Advancement of Structured Information Standards, 2012].
    – Math
    Commented Apr 29, 2020 at 15:40
  • @VictorHugo you can use the acro package or the acronym package, define a suitable abbreviation with the package and use author = {\ac{OASIS}} (or similar) in the bib file
    – cgnieder
    Commented May 1, 2020 at 14:20

You must log in to answer this question.

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