我不确定这是否是可接受的印刷惯例 - 但我的博士生导师希望我扩展每个首字母缩略词在第一次使用时每章我的博士论文。
其理由是,如果读者(可能是专家)选择跳过介绍(某个特定缩略词的首次使用部分)并直接进入中间章节,那么扩展每章中首次使用的缩略词将非常有帮助。
如何使用该glossaries-extra
包在 LaTeX 中实现这种行为?
以下是演示该场景的简单示例。结果输出中还解释并突出显示了所需的行为。
\documentclass{report}
\usepackage{glossaries-extra}
\setabbreviationstyle[acronym]{long-short}
\newacronym{tla}{TLA}{three letter acronym}
\newacronym{adc}{adc}{Analog to Digital Converter}
\begin{document}
\chapter{Introduction}
Hello world. We have too many \gls{tla}. The acronym in the previous sentence shall expand.
Note that the second usage here \gls{tla} will not expand, and is the expected
(and correct) behavior.
\chapter{Important Stuff}
The \gls{tla} acronym has been expanded before. But since the reader might read
this chapter first, it is nice to have its first usage in the previous sentence
expand.
Note that the second usage here \gls{tla} will not expand, and is the expected
(and correct) behavior.
\end{document}
输出为
答案1
\glsresetall
最简单的方法是在每章开头插入。由于etoolbox
是自动加载的(由基础glossaries
包加载),您可以使用etoolbox
的\preto
命令:
\documentclass{report}
\usepackage{glossaries-extra}
\preto\chapter{\glsresetall}
\setabbreviationstyle[acronym]{long-short}
\newacronym{tla}{TLA}{three letter acronym}
\newacronym{adc}{adc}{Analog to Digital Converter}
\begin{document}
\chapter{Introduction}
Hello world. We have too many \gls{tla}. The acronym in the previous sentence shall expand.
Note that the second usage here \gls{tla} will not expand, and is the expected
(and correct) behavior.
\chapter{Important Stuff}
The \gls{tla} acronym has been expanded before. But since the reader might read
this chapter first, it is nice to have its first usage in the previous sentence
expand.
Note that the second usage here \gls{tla} will not expand, and is the expected
(and correct) behavior.
\end{document}
如果您使用不同的类(例如memoir
或scrbook
),可能会有一个方便的钩子可供使用。如果您想将重置限制为特定的词汇表类型,则可以使用 的可选参数\glsresetall
。