# How to define an acronym by using other acronym and print the abbreviations together when first used?

I am using acro package and like it. However, I have the following problem.

I would like to define for example "dsDNA" using the acronym of "DNA". When I do that, everything is fine as long as I first use "DNA" in the text (section "good" in the working example). However, if I first use "dsDNA" in the text, "DNA" and "dsDNA" are separately displayed in parentheses as shown below (section "bad" in the working example).

\documentclass{scrbook}

\usepackage[single=true,macros=true,xspace=true]{acro}

\DeclareAcronym{dna}{
short = DNA ,
long = deoxyribonucleic acid
}

\DeclareAcronym{dsdna}{
short = ds\acs{dna} ,
long = double-stranded \ac*{dna}
}

\begin{document}

\section*{good}

\Ac{dna} is a very important molecule.
The virus xyz contains \dsdna.

Apart from that, \dna exists in almost all cells of the body. In most cases it is \dsdna.

\acresetall

The virus xyz contains \dsdna.
\Ac{dna} is a very important molecule. Apart from that, \dna exists in almost all cells of the body. In most cases it is \dsdna.

\end{document}


Then it looks like this:

What I would like to get would be something like this:

The virus xyz contains double-stranded deoxyribonucleic acid (dsDNA).
DNA is a very important molecule.
Apart from that, DNA exists in almost all cells of the body. In most cases it is dsDNA.


Is it possible to achieve this somehow? Using an abbreviation for "double-stranded" doesn't seem feasible to me. In this case I would probably get something like

double-stranded (ds) deoxyribonucleic acid (DNA)


which is not what I want.

This is exactly the kind of use case I had in mind when I decided to provide

\acifused{<id>}{<true>}{<false>}


With it you can do the following:

\DeclareAcronym{dsdna}{
short = ds\acs*{dna} ,
long = double-stranded \acifused{dna}{\acs*{dna}}{\acl*{dna}}
}


This means that the short form will be typeset if the acronym dna has been used before but the long form if it hasn't. You may notice that I also use the starred form \acs* in the short form of dsdna.

\documentclass{scrbook}

\usepackage[single=true,macros=true,xspace=true]{acro}

\DeclareAcronym{dna}{
short = DNA ,
long = deoxyribonucleic acid
}

\DeclareAcronym{dsdna}{
short = ds\acs*{dna} ,
long = double-stranded \acifused{dna}{\acs*{dna}}{\acl*{dna}}
}

\begin{document}

\section*{good}

\Ac{dna} is a very important molecule.  The virus xyz contains \dsdna.  Apart
from that, \dna exists in almost all cells of the body. In most cases it is
\dsdna.

\section*{also good}
\acresetall

The virus xyz contains \dsdna.  \Ac{dna} is a very important molecule.  Apart
from that, \dna exists in almost all cells of the body. In most cases it is
\dsdna.

\end{document}

• Thanks for the answer, this seems like what I have been looking for. However, when trying to use \acifused the console tells me "Undefined control sequence". I am using TexLive-2013 distribution on Mac OS X 10.8.4. This should be included, right? I saw in the documentation that is a feature that was (recently?) added in v1.3 of the package. I am a latex beginner, I don't know how to check if packages are up to date. Oct 1, 2013 at 19:34
• @MarlinaH \acifused has been introduced in v1.3e, the current version on CTAN is 1.4b. I guess you're using MacTeX? it should include the tlmgr for updating the TeX distribution. You should be able to find some posts regarding updates on this site... Oct 1, 2013 at 20:00
• That was it, it works now. Oct 2, 2013 at 5:55