在acro
包中,该首字母缩略词的第一次出现是这样的:
脱氧核糖核酸(DNA)
我想知道是否有办法改变的括号-
,或者,
执行以下操作:
脱氧核糖核酸-DNA-
脱氧核糖核酸,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}
答案1
acro
允许您定义自定义的第一样式外观,对于破折号的情况,使用\DeclareAcroFirstStyle{dashes}{inline}{brackets=--}
采用默认inline
样式并使用-
和而-
不是和来括住短格式就足够了。对于逗号变体,有一个空格(
)
acro
默认插入,然后需要将其删除这个答案完成这项工作,因此需要更多的支撑,\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}
产生