从术语表中排除条目?

发布于 2024-09-01 14:11:02 字数 388 浏览 5 评论 0原文

我正在 LaTeX 中使用词汇表包。我的文档中有 \gls{foo},但我不希望“foo”条目出现在术语表中。如何在文档正文中保留有效(即扩展)\gls{foo},但从术语表中排除“foo”条目?

编辑:我想使用 \gls{foo} 来指示“此处使用的‘foo’在本文档中具有其特定含义。”但在某些情况下,我最终得到了一个“foo”,其定义太明显——或者很难——在术语表中清晰表达。

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

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

I'm using the glossaries package in LaTeX. I've got \gls{foo} in my document, but I don't want the entry for "foo" to appear in the glossary. How can I keep a working (i.e. expanding) \gls{foo} in the body of my document, but exclude the entry for "foo" from the glossary?

EDIT: I want to use \gls{foo} to indicate "as used here, 'foo' has its specific meaning within this document." In a few cases, though, I've ended up with a "foo" whose definition is too obvious--or difficult--to articulate in the glossary.

So I want \gls{foo} to be expanded as usual, but I don't want the "foo" entry to appear in the glossary.

I hope this adds a little more information about what I'm trying to accomplish. It may be an abuse of glossaries, but I find it helpful to make sure I'm always using the same words and the right words while writing technical documents.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

云裳 2024-09-08 14:11:02

如果您使用 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}

If you are using the glossaries package you can create an "ignored" glossary like

\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}
情徒 2024-09-08 14:11:02

我不知道你为什么要这样做,但以下应该有效:

\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.

I have no idea why you'd want to do this, but the following should work:

\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.
寒江雪… 2024-09-08 14:11:02

这可以通过将术语添加到特殊的common字典中来完成。它实际上是 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 命令的使用。

This can be accomplished by adding the terms to a special common dictionary. It's actually a built-in feature of the glossaries package and it's even exemplified by the package author. From said example:

\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}

Note the use of the \newignoredglossary command.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文