2

I am using the ACRO-package in my masterthesis. Is there a way to tell ACRO to put the abbrevation between a certain word of the long form, when using \acf?

Example:

\documentclass{article}
\usepackage{acro}
\DeclareAcronym{hvac}{short = HVAC, long = heating, ventilating and air conditioning system}

\begin{document}
Full Acronym: \acf{hvac}. 
\end{document}

I want it to be heating, ventilating and air conditioning (HVAC) system

instead of

heating, ventilating and air conditioning system (HVAC)

Any idea?

2
  • Welcome to tex.sx. Dec 20, 2022 at 18:52
  • You may consider removing the word 'system' from the long form and use \acf{hvac} system in the main text.
    – Andrey L.
    Dec 21, 2022 at 15:11

1 Answer 1

2

As the first style should contain the acronym definition inside it while having conventional long and short forms I think this is a case for nested acronym definitions.

\documentclass{article}
\usepackage{acro}
\DeclareAcronym{HVAC}{
  short = HVAC,
  long = {heating, ventilating and air conditioning},
}
\DeclareAcronym{hvac}{
  short = HVAC,
  long = \ac{HVAC} system,
  first-style = long
}

\begin{document}
Full Acronym: \acf{hvac}. 
\end{document}

By setting the first-style of the outer acronym hvac to long we always see \ac{HVAC} system for first/long or \ac{HVAC} for short. Assuming the inner HVAC acronym is never used independently this gives a first appearance of heating, ventilating and air conditioning (HVAC) system, subsequent first/long appearances of HVAC system, and short appearances of HVAC.

Depending exactly what is wanted you may wish to put long = \acf{HVAC} system, or use some additional conditionals.

One can achieve a similar effect by placing conditionals in a single acronym

\DeclareAcronym{hvac}{
  short = HVAC,
  long = {heating, ventilating and air conditioning\acroiffirstT{\acspace(HVAC)} system},
  first-style=long,
}

but this is less resilient to changes in style and utilisation of acro's other features.

1
  • Thank you very much :)
    – Jan Kinder
    Jan 6, 2023 at 16:46

You must log in to answer this question.

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