词汇表 - 带有 utf-8 编码词汇表条目的额外错误

词汇表 - 带有 utf-8 编码词汇表条目的额外错误

我使用 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}

相关内容