![词汇表 - 带有 utf-8 编码词汇表条目的额外错误](https://linux22.com/image/472669/%E8%AF%8D%E6%B1%87%E8%A1%A8%20-%20%E5%B8%A6%E6%9C%89%20utf-8%20%E7%BC%96%E7%A0%81%E8%AF%8D%E6%B1%87%E8%A1%A8%E6%9D%A1%E7%9B%AE%E7%9A%84%E9%A2%9D%E5%A4%96%E9%94%99%E8%AF%AF.png)
我使用 glossaries-extra 包来编写我的词汇表页面,它在英语上运行良好,然而当我插入一个带有 utf-8 编码的条目时,它会引发错误。
这是我的 MWE:
\documentclass{article}
\usepackage[utf8]{vietnam}
\usepackage[automake]{glossaries-extra}
\makeglossaries
\newglossaryentry{ABC}
{name = ABC,
description = {A programming language}
}
\newglossaryentry{Haskell}
{name = Haskell,
description = {A programming language}
}
\longnewglossaryentry{Hello World}
{name = Hello World,
description = {It's Hello World, you fool}
}
\newglossaryentry{biến}
{name = biến,
description = {label for an information}
}
\begin{document}
\Gls{ABC}, \Gls{Haskell}, \Gls{Hello World}.
Trong Python, \gls{biến} là một nhãn để gán giá trị.
\printglossary[nonumberlist]
\end{document}
我该如何解决这个问题才能正确打印出我的词汇表页面?
请帮我。
谢谢。
答案1
您的主要问题不是biến
,您主要的问题在于,您\longnewglossaryentry
只使用了两个参数而不是三个参数。该命令description
不仅需要将第二个参数作为 key=value,还需要将第三个参数作为第三个参数。要使用以下任一方法:
\documentclass{article}
\usepackage[utf8]{vietnam}
\usepackage[automake]{glossaries-extra}
\makeglossaries
\newglossaryentry{ABC}
{name = ABC,
description = {A programming language}
}
\newglossaryentry{Haskell}
{name = Haskell,
description = {A programming language}
}
\newglossaryentry{Hello World}
{name = Hello World,
description = {It's Hello World, you fool}
}
\newglossaryentry{biến}
{name = biến,
description = {label for an information}
}
\begin{document}
\Gls{ABC}, \Gls{Haskell}, \Gls{Hello World}.
Trong Python, \gls{biến} là một nhãn để gán giá trị.
\printglossary[nonumberlist]
\end{document}
或者
\documentclass{article}
\usepackage[utf8]{vietnam}
\usepackage[automake]{glossaries-extra}
\makeglossaries
\newglossaryentry{ABC}
{name = ABC,
description = {A programming language}
}
\newglossaryentry{Haskell}
{name = Haskell,
description = {A programming language}
}
\newglossaryentry{Hello World}
{name = Hello World,
description = {It's Hello World, you fool}
}
\longnewglossaryentry{biến}
{name = biến}{label for an information}
\begin{document}
\Gls{ABC}, \Gls{Haskell}, \Gls{Hello World}.
Trong Python, \gls{biến} là một nhãn để gán giá trị.
\printglossary[nonumberlist]
\end{document}
我自己总是喜欢用拉丁文来转录<条目标签>的论据\newglossaryentry
:
\documentclass{article}
\usepackage[utf8]{vietnam}
\usepackage[automake]{glossaries-extra}
\makeglossaries
\newglossaryentry{ABC}
{name = ABC,
description = {A programming language}
}
\newglossaryentry{Haskell}
{name = Haskell,
description = {A programming language}
}
\newglossaryentry{Hello World}
{name = Hello World,
description = {It's Hello World, you fool}
}
\newglossaryentry{bien}
{name = biến,
description = {label for an information}
}
\begin{document}
\Gls{ABC}, \Gls{Haskell}, \Gls{Hello World}.
Trong Python, \gls{bien} là một nhãn để gán giá trị.
\printglossary[nonumberlist]
\end{document}