使用该包的cite
和功能对我来说似乎至少有两个问题。cite-cmd
acro
当首字母缩略词只出现一次时,会直接拼写出来,不用缩写,这样没问题。但是,我希望引用仍然能够打印出来(至少第一次出现时)!
使用作者-年份引用格式时,连续两个括号不太美观。我希望使用类似 (AIS, Neal 2009) 的格式,而不是 (AIS) (Neal 2009)。这可能吗?
以下 MWE 说明了这些要点:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{sample.bib}
@article{neal2001annealed,
title = {{Annealed importance sampling}},
author = {Neal, R},
journal = {Statistics and Computing},
year = {2001},
}
\end{filecontents*}
\usepackage[natbib,citestyle=authoryear,backend=bibtex]{biblatex}
\addbibresource{sample.bib}
\usepackage{acro}
\acsetup{single,sort,cite-cmd=\citep}
\DeclareAcronym{AIS}{
short=AIS,long=Annealed Importance Sampling,cite={neal2001annealed}
}
\DeclareAcronym{AIS2}{
short=AIS,long=Annealed Importance Sampling,cite={neal2001annealed}
}
\begin{document}
This \ac{AIS} lacks the citation, because it only occurs once!
This \ac{AIS2} occurs twice (\ac{AIS2}), but has double parenthesis, I'd prefer (AIS, \textbackslash \texttt{citealp\{key\}})
\printacronyms
\end{document}
答案1
自 v2.0 (2015/08/17) 以来,有以下group-citation
选项group-cite-cmd
:
\acsetup{
group-citation = true ,
group-cite-cmd = \citealp
}
acro
现在(自 v2.0 起)还将引用添加到单一用途(恕我直言,这比省略它更有意义)。
完整示例:
% http://tex.stackexchange.com/q/246008/
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{neal2001annealed,
title = {Annealed importance sampling} ,
author = {Neal, R} ,
journal = {Statistics and Computing} ,
year = {2001}
}
\end{filecontents*}
\usepackage[natbib,citestyle=authoryear,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{acro}[2015/08/16]
\acsetup{
single = true ,
sort = true ,
cite-cmd = \citep ,
group-citation = true ,
group-cite-cmd = \citealp
}
\DeclareAcronym{AIS}{
short = AIS,
long = Annealed Importance Sampling,
cite = {neal2001annealed}
}
\DeclareAcronym{AIS2}{
short = AIS,
long = Annealed Importance Sampling,
cite = {neal2001annealed}
}
\begin{document}
\ac{AIS} -- only used once
\ac{AIS2} and \ac{AIS2} -- used twice
\printacronyms
\end{document}