有人曾在 LaTeX 词汇表中使用过尾注吗?

有人曾在 LaTeX 词汇表中使用过尾注吗?

在我花费大量时间尝试构建 MWE 之前,我想问一下是否存在“结构性”原因会阻止我在词汇表中使用尾注?

我创建了一个系统,只需几行 LaTeX 代码,我就可以轻松决定是否在我的任何章节或部分中添加脚注或尾注。

在我的项目中,我大量使用脚注和尾注。当我在页面上有一个大图时,我可能会选择在该章节或部分中使用尾注代替脚注,以避免脚注和大图之间的空间冲突。

然而,当我尝试将这“几行 LaTeX 代码”添加到词汇表中时,我遇到了错误“LaTeX 错误:缺少 \begin{document}。”这对我来说暗示了尾注和词汇表不能混合可能存在结构原因。

如果有由于结构原因导致尾注和词汇表不能共存,我会花一些时间研究如何做到这一点,如果遇到问题,我会发布另一个问题。

谢谢阅读。

答案1

距离我最初发帖已经过去了几天,但我的最初帖子还没有得到任何回复。这似乎是很少有人会采用的一种选择。

所以我尝试了一下,看看有什么可能。这不是最好的解决方案,但这是朝着正确方向迈出的一步。我还没有将代码应用到我自己的项目中,这也是最初发布的原因。因此,我可能需要进行额外的更改才能做到这一点。

我需要在词汇表中使用尾注的原因是词汇表中的许多图片与经常出现在页面底部的脚注之间存在竞争。如果没有脚注,图片通常会很好地适合词汇表页面,但有了脚注,图片通常会太大,留下大片空白区域,而这些区域本来可以容纳图片。

希望我可以采用我在这里创建的内容将我自己项目中的脚注更改为我所有词汇表中的尾注。

以下是 MWE 代码:

\documentclass{book}
\usepackage{glossaries}
\usepackage{glossaries-extra}
\usepackage{hyperref}
% \usepackage{pagenote}     % I may need to use the pagenote package in my own project
\usepackage{xcolor}
\usepackage{url}

\usepackage{endnotes}
\let\footnote=\endnote

% Here are a few glossary entries for testing purposes

        \newglossaryentry{anthropogenic}{
        name={anthropogenic},
        description={Of, relating to, or resulting from the influence of human beings on nature\footnote{Merriam-Webster's Unabridged Dictionary. (n.d.). \textit{Definition of Anthropogenic}. Www.Merriam-Webster.Com; © 2020 Merriam-Webster, Incorporated. Retrieved September 14, 2020, from \url{https://www.merriam-webster.com/dictionary/anthropogenic}} (Merriam-Webster, n.d.); created by people or caused by human activity\footnote{Dictionary.com. (n.d.). \textit{Definition of anthropogenic | Dictionary.com}. Www.Dictionary.Com. Retrieved September 14, 2020, from \url{https://www.dictionary.com/browse/anthropogenic}} (Dictionary.com, n.d.)} }

        \newglossaryentry{metric}{
        name={metric},
        description={(\textit{plural} \href{https://en.wiktionary.org/wiki/metrics}{metrics} \textit{or} \href{https://en.wiktionary.org/wiki/metrices}{metrices}) A \href{https://en.wiktionary.org/wiki/measure}{measure} for something; a means of deriving a \href{https://en.wiktionary.org/wiki/quantitative}{quantitative} \href{https://en.wiktionary.org/wiki/measurement}{measurement} or \href{https://en.wiktionary.org/wiki/approximation}{approximation} for otherwise \href{https://en.wiktionary.org/wiki/qualitative}{qualitative} \href{https://en.wiktionary.org/wiki/phenomena}{phenomena} (especially used in engineering)\footnote{metric. (2021, May 10). \textit{Wiktionary, The Free Dictionary}. Retrieved 20:25, July 15, 2021 from \url{https://en.wiktionary.org/w/index.php?title=metric&oldid=62505762} } } }

       \newglossaryentry{ocean gyre}{
        name={ocean gyre},
        description={A circular or spiral motion or form; especially a giant circular oceanic surface current. \ldots Gyre is also frequently encountered as an oceanographic term that refers to vast circular systems of ocean currents, such as the North Atlantic Gyre, a system of currents circling clockwise between Europe, Africa, and the Americas; gyre comes via the Latin gyrus from the Greek gyros, meaning "ring" or "circle"\footnote{Merriam-Webster. (n.d.). \textit{Definition of Gyre}. Www.Merriam-Webster.com. Retrieved July 23, 2019, from \url{https://www.merriam-webster.com/dictionary/gyre} } } }

\makeglossaries

% \makepagenote     % This is part of the pagenote package, but it is not needed here

\newlength\myl      % Used in \noteNnames macro

%_____ Add horizontal rule below "Notes" heading _____
\makeatletter
\newcommand\noteNnames[1]{\settowidth{\myl}%
{\textbf{#1}}\def\enoteheading{\section*{#1}%
\mbox{}\par\vskip-3.8\baselineskip\noindent%    % 3.8 controls  distance between the rule line and 'Notes ...'
\textcolor{red}{\rule{1.4\myl}{0.5pt}}%
\par\vskip-0.1\baselineskip}}   % The 0.1 is the distance between the rule line and the first endnote
\makeatother

\begin{document}

% \noteNnames{Notes for \textit{<$title>}}      % Sets the Notes Title = <$title> (if it exists)
\noteNnames{Notes for the Glossary}     % Sets the Notes Title to 'Notes for the Glossary'

    Testing the glossary endnotes for \textbf{\gls{anthropogenic}}, \textbf{\gls{metric}} and \textbf{\gls{ocean gyre}} glossary entries.

\printunsrtglossary

% \printnotes*      % This is part of the pagenote package, but it is not needed here

% \newpage  % This controls whether there is a new page between the Glossary and the 'Notes ...'
\begingroup
\parindent 0pt
\parskip 2ex
\def\enotesize{\normalsize}
\theendnotes    % Prints the endnotes
\endgroup

\end{document}

虽然它可能不美观,但确实有效。我希望它能帮助其他考虑使用尾注来制作词汇表的人。

相关内容