
從給出的程式碼的解決方案來看此處刷新左側縮寫列表,如何在清單中僅顯示文件中提到的縮寫?在這種情況下,列表應僅包含 EEPROM 和 LED。
我知道您可以刪除其他條目,但在不刪除額外條目的情況下,是否可以對其進行編程,以免出現在列表中?
這是代碼:
\documentclass{article}
\usepackage[acronym,toc]{glossaries}
\makeglossaries
\newacronym{uri}{URI}{Unique Resonance Identifier}
\newacronym{led}{LED}{light-emitting diode}
\newacronym{eeprom}{EEPROM}{electrically erasable programmable
read-only memory}
\glsaddall[types=\acronymtype]
\newglossarystyle{custom_acronyms}
{
\setglossarystyle{long3colheader}%
\renewcommand*{\glossaryheader}{}%
\renewcommand{\glossentry}[2]{%
\textbf{\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}}
& \glossentrydesc{##1}
& ##2
\tabularnewline}%
}
\begin{document}
Just show \gls{eeprom} and \gls{led}
%\printglossaries
\printglossary[type=acronym,style=custom_acronyms]
\end{document}
答案1
預設僅顯示文件中提到的首字母縮寫。但是,您告訴它還使用以下行添加所有其他內容:
\glsaddall[types=\acronymtype]
所以刪除該行。