我目前正在撰写论文,并使用词汇表包在手稿末尾创建了一个首字母缩略词列表:
\usepackage[acronym,toc,shortcuts]{glossaries}
...
\printglossary[type=\acronymtype,title=List of Acronyms, toctitle=List of Acronyms]
在某个时候,我想参考一下双向和单向长短期记忆算法:
\newacronym{LSTM}{LSTM}{Long Short Term Memory}
\newacronym{B-LSTM}{B-LSTM}{Bidirectional LSTM}
\newacronym{U-LSTM}{U-LSTM}{Unidirectional LSTM}
但为了使其更简短,我想像这样显示它:U- 和 B-LSTM:(U- and \acrshort{B-LSTM})
有没有办法U-LSTM
通过打印来使用首字母缩略词U-
,并且仍然将其完整地保留在首字母缩略词列表中?
答案1
下面的最小示例对我有用:
\documentclass[a4paper,12pt]{report}
\usepackage[pdftex, colorlinks]{hyperref}
\usepackage[hyperfirst = false, acronym]{glossaries}
\makeglossaries{}
\newacronym{LSTM}{LSTM}{Long Short Term Memory}
\newacronym{B-LSTM}{B-LSTM}{Bidirectional LSTM}
\newacronym{U-LSTM}{U-LSTM}{Unidirectional LSTM}
\begin{document}
\chapter{Introduction}
Here, I'm referring to \glslink{U-LSTM}{U-} and \acrshort{B-LSTM}.
\printglossary[type=\acronymtype,title=List of Acronyms]
\end{document}
正如 @likethevegetable 所指出的,使用子条目(例如这个问题;用户指南第 4.5 节)可能更合适。例如:
...
\usepackage[hyperfirst = false, acronym, style=tree]{glossaries}
\makeglossaries{}
\newacronym{LSTM}{LSTM}{Long Short Term Memory}
\newacronym[parent=LSTM]{B-LSTM}{B-LSTM}{Bidirectional \glstext{LSTM}}
\newacronym[parent=LSTM]{U-LSTM}{U-LSTM}{Unidirectional \glstext{LSTM}}
...
This is about \gls{LSTM}. Here, I'm referring to \glslink{U-LSTM}{U-} and \acrshort{B-LSTM}.
...