1

in the acro package the first appearance of the acronym is something like:

deoxyribonucleic acid (DNA)

I would like to know if there is a way to change the parentheses for -, or , to do something like:

deoxyribonucleic acid -DNA-

deoxyribonucleic acid, DNA,

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{chemformula}
\usepackage{acro}
%
\DeclareAcronym{DNA}{
short=DNA,
long=deoxyribonucleic acid
}
\begin{document}
\printacronyms\par
%
How it looks: \acf{DNA}\par
%
How I want: deoxyribonucleic acid -DNA- or
deoxyribonucleic acid, DNA,
\end{document}

enter image description here

1 Answer 1

3

acro allows you to define a custom first-style appearance, for the dashes case, it's sufficient to use \DeclareAcroFirstStyle{dashes}{inline}{brackets=--} which takes the default inline style and uses - and - instead of ( and ) toe enclose the short form. For the comma variant, there's a space which acro inserts by default which needs to then be removed for which this answer does the job and therefore more bracing is required, with \DeclareAcroFirstStyle{commas}{inline}{brackets-type={{\leavevmode\unskip,\space}{,}}}

\documentclass[12pt,a4paper]{article}
\usepackage{acro}
\DeclareAcronym{DNA}{
short=DNA,
long=deoxyribonucleic acid,
first-style=dashes
}
\DeclareAcronym{DNAtwo}{
short=DNA,
long=deoxyribonucleic acid,
first-style=commas
}
\DeclareAcroFirstStyle{dashes}{inline}{
brackets-type=--
}
\DeclareAcroFirstStyle{commas}{inline}{
brackets-type={{\leavevmode\unskip,\space}{,}}
}

\begin{document}
\printacronyms

How it looks: \acf{DNA}

How it looks: \acf{DNAtwo}

How I want: deoxyribonucleic acid -DNA- or
deoxyribonucleic acid, DNA,
\end{document}

which produces

enter image description here

2
  • Hi, by the way, how to set first-style globally?
    – DangeRS2
    Jan 7, 2020 at 8:37
  • 1
    @DangeRS2 have you looked at \acsetup?
    – bers
    Dec 1, 2020 at 19:08

You must log in to answer this question.

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