我想将我的词汇表作为字符串添加到脚注中。因此,我拼凑了以下 MWE。
\documentclass[twocolumn]{article}
\usepackage[nopostdot,acronym,nonumberlist,nogroupskip]{glossaries}
\newcommand{\chapternote}[1]{{%
\let\thempfn\relax% Remove footnote number printing mechanism
\footnotetext[0]{#1}% Print footnote text
}}
\newacronym{dag}{DAG}{directed acyclic graphic}
\newacronym{usa}{USA}{United States of America}
\makeglossaries
\title{Title}
\author{Me \and I}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
This is my banger of a first sentence, it's absolutely glorious.\chapternote{\printglossary[type=\acronymtype,style=long,title={}]}
The \gls{usa} can be visualised in a \gls{dag}.
\end{document}
这有几个问题,因为缺少词汇表标题会留下相当多的空白,而我宁愿没有这种情况。此外,此代码实际上不会生成内联词汇表,而只是传统的两列列表 - 我如何将输出更改为“DAG - 有向无环图,美国 - 美利坚合众国”之类的内容。
答案1
虽然这并非完全自动化,但确实可以工作。某种程度上来说。
\documentclass[twocolumn]{article}
\usepackage[nopostdot,acronym,nonumberlist,nogroupskip]{glossaries}
\usepackage{etoolbox}
\newcommand{\chapternote}[1]{{%
\let\thempfn\relax% Remove footnote number printing mechanism
\footnotetext[0]{#1}% Print footnote text
}}
\newacronym{dag}{DAG}{directed acyclic graph}
\newacronym{usa}{USA}{United States of America}
\makeglossaries
% Define a command to format glossary entries
\newcommand{\formatglossaryentries}[1]{%
\textbf{Acronyms:}%
\renewcommand*{\do}[1]{%
\@ \acrshort{##1} -- \glsdesc{##1},%
}%
\docsvlist{#1}%
}
\title{Title}
\author{Me \and I}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
This is my banger of a first sentence, it's absolutely glorious.
\chapternote{\formatglossaryentries{dag,usa}}
The \gls{usa} can be visualized in a \gls{dag}.
\end{document}