我使用glossaries
包中的首字母缩略词,这样我就可以做到这一点:
\newacronym{MIRDD}{MIRDD}{Mid-Infrared Diagnostic Diagram}
\gls{MIRDD}
\gls{MIRDD}
这将存储缩写词,然后打印
Mid-Infrared Diagnostic Diagram (MIRDD)
MIRDD
不过,如果我能这样做就好了:
\newacronym[\citep{Person2018}]{MIRDD}{MIRDD}{Mid-Infrared Diagnostic Diagram}\gls{MIRDD}
\gls{MIRDD}
\gls{MIRDD}
有可能
\glscite{MIRDD}
这样它就会打印:
Mid-Infrared Diagnostic Diagram (MIRDD; Person et al. 2018)
MIRDD
有可能
MIRDD (Person et al. 2018)
使用常见的 natbib 内容。
这可能吗??
我查看了文档,虽然支持前缀,但似乎不支持后缀或类似的东西。
答案1
最简单的方法是glossaries-extra
:
\documentclass{article}
\usepackage{natbib}
\usepackage[postdot]{glossaries-extra}
\makeglossaries
\setabbreviationstyle[acronym]{long-short-user}
\renewcommand*{\glsxtruserparen}[2]{% requires glossaries-extra v1.04+
\glsxtrfullsep{#2}%
\glsxtrparen
{#1\ifglshasfield{\glsxtruserfield}{#2}{;
\expandafter\citet\expandafter{\glscurrentfieldvalue}}{}}%
}
\glsdefpostdesc{acronym}{% requires glossaries-extra v1.31+
\ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}%
{~\expandafter\citep\expandafter{\glscurrentfieldvalue}}%
{}%
}
\newacronym[user1={article-minimal}]{MIRDD}{MIRDD}{Mid-Infrared Diagnostic Diagram}
\begin{document}
First use: \gls{MIRDD}. Next use: \gls{MIRDD}.
\printglossary
\bibliographystyle{plainnat}
\bibliography{xampl}
\end{document}
基础glossaries
包被隐式加载,但至少需要 4.23 版本才能\glscurrentfieldvalue
在 的真实部分中使用\ifglshasfield
。此示例生成:
该user1
字段可能包含以逗号分隔的引用标签列表。
此示例效果不佳,hyperref
因为首次使用时会出现嵌套超链接。最简单的解决方法是在首次使用时禁用超链接:
\documentclass{article}
\usepackage{natbib}
\usepackage[colorlinks]{hyperref}
\usepackage[postdot]{glossaries-extra}
\makeglossaries
\setabbreviationstyle[acronym]{long-short-user}
\glssetcategoryattribute{acronym}{nohyperfirst}{true}
\renewcommand*{\glsxtruserparen}[2]{% requires glossaries-extra v1.04+
\glsxtrfullsep{#2}%
\glsxtrparen
{#1\ifglshasfield{\glsxtruserfield}{#2}{;
\expandafter\citet\expandafter{\glscurrentfieldvalue}}{}}%
}
\glsdefpostdesc{acronym}{% requires glossaries-extra v1.31+
\ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}%
{~\expandafter\citep\expandafter{\glscurrentfieldvalue}}%
{}%
}
\newacronym[user1={article-minimal}]{MIRDD}{MIRDD}{Mid-Infrared Diagnostic Diagram}
\begin{document}
First use: \gls{MIRDD}. Next use: \gls{MIRDD}.
\printglossary
\bibliographystyle{plainnat}
\bibliography{xampl}
\end{document}