Latex 从术语表中排除条目?

Latex 从术语表中排除条目?,latex,glossaries,Latex,Glossaries,我用的是乳胶的词汇表。我的文档中有\gls{foo},但我不希望“foo”的条目出现在词汇表中。如何在文档正文中保留一个工作(即扩展)\gls{foo},但从词汇表中排除“foo”条目 编辑:我想用\gls{foo}来表示“在这里使用时,'foo'在本文档中有其特定的含义。”不过,在一些情况下,我最终得到了一个“foo”,它的定义太明显,或者很难在词汇表中表达出来 因此,我希望像往常一样扩展\gls{foo},但我不希望“foo”条目出现在词汇表中 我希望这能为我的目标提供更多的信息。这可能是对

我用的是乳胶的词汇表。我的文档中有
\gls{foo}
,但我不希望“foo”的条目出现在词汇表中。如何在文档正文中保留一个工作(即扩展)
\gls{foo}
,但从词汇表中排除“foo”条目

编辑:我想用
\gls{foo}
来表示“在这里使用时,'foo'在本文档中有其特定的含义。”不过,在一些情况下,我最终得到了一个“foo”,它的定义太明显,或者很难在词汇表中表达出来

因此,我希望像往常一样扩展
\gls{foo}
,但我不希望“foo”条目出现在词汇表中


我希望这能为我的目标提供更多的信息。这可能是对词汇的滥用,但我发现确保在编写技术文档时始终使用相同的单词和正确的单词是有帮助的。

我不知道您为什么要这样做,但以下几点应该可以:

\let\oldgls\gls% store the original meaning of \gls in a new command named \oldgls
\let\gls\relax$ make \gls do nothing
Some text with \gls{foo} no links to the glossary, 
and no ``foo'' entry in the glossary.
\let\gls\oldgls% restore the original meaning of \gls
Some more text with \gls{bar} that links to the glossary,
and with a ``bar'' entry in the glossary.

如果您使用的是
glossaries
软件包,则可以创建一个“忽略”的词汇表,如

\documentclass{article}

\usepackage{glossaries}
\newglossary[glignoredl]{ignored}{glignored}{glignoredin}{Ignored Glossary}
\makeglossaries

\newglossaryentry{foofoo}{name={FOOFOO},description={foofoo stuff}}
\newglossaryentry{foo}{name={FOO},type={ignored},description={no good description}}
\newglossaryentry{bar}{name={BAR},description={bar of stuff}}

\begin{document}

Here is a \gls{foo} that is also a \gls{bar}, but of course it's also a \gls{foofoo}.
Why not consider buying a \gls{foo}?

\printglossary
% \printglossary[type={ignored}]

\end{document}

这可以通过将术语添加到一个特殊的
通用
词典中来实现。它实际上是
glossaries
包的一个内置功能,而且它甚至是。根据上述例子:

\documentclass{article}

\usepackage{glossaries}
\newignoredglossary{common}
\makeglossaries

\newglossaryentry{sample}{name={sample},description={an example}}
\newglossaryentry{commonex}{type=common,name={common term}}

\begin{document}
\gls{sample}. \gls{commonex}.
\printglossaries
\end{document}

请注意
\newignoredglossary
命令的使用。

您能举一个例子说明这在哪里有用吗?为什么不直接用
foo
替换
\gls{foo}
?您希望看到的实际最终效果是什么?
\gls{foo}
在我的文档中出现了几十次。此外,有时“foo”是一个不同的词,但后来变成了“foo”,现在我不想在词汇表中使用“foo”,但我仍然希望它与
\gls{foo}
一起使用(它可能在将来的某个时候会自行更改)。因此,我更喜欢一种解决方案,它不需要我掺杂
\gls{foo}
的每一个用法。我认为应该有某种方法来设置条目,使其在生成词汇表时看起来“未使用”。我不介意在末尾添加类似
\glsignore{foo}
的内容。