如何在词汇表描述中放置符号

如何在词汇表描述中放置符号

我必须为工作任务制作一个词汇表,但在描述键方面遇到了一些麻烦。我找遍了谷歌,但似乎找不到如何在词汇表术语的描述键中放置符号的答案。基本上,我必须制作在定义本身中包含alphas 和s 等的定义。mu

我的例子是:

%% glossary.tex %%

\documentclass{exam}

%%% Set Up Glossary Options in Global Preamble %%%
\usepackage[hidelinks]{hyperref}
\usepackage[nonumberlist]{glossaries}
\setacronymstyle{long-short}
\makenoidxglossaries
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Load Glossary from external file
\loadglsentries{entries.tex}

\begin{document}

  % Option to print all terms in glossary even when they are unused
  \glsaddall

  % Actually print the glossary
  \printnoidxglossaries

\end{document}

实际的词汇表在这里:

%% entries.tex %%

%%% Glossary Entries

\newglossaryentry{hello}{
  name = hello,
  description = {The mean is mu},
  sort = hello
}

我想用希腊字母 mu 代替“mu”。我对 LaTex 还不熟悉,任何帮助我都会非常感激。谢谢!

答案1

我建议使用命令 进行逻辑标记\meansymbol,该命令在此处设置为\mu,打印希腊字母 mu 的常用斜体版本。这样,很容易在整个文档中保持一致的符号。

此外,我提供了 upshape 版本,\upmu\meanupsymbol-- 这需要\usepackage{upgreek}。(当然,也\upmu可以使用\meansymbol;-)

两个版本都需要切换到数学模式,即$\mu$$\upmu$

alpha封信将是\alpha然后,通过等beta实现的。\beta

\documentclass{exam}

%%% Set Up Glossary Options in Global Preamble %%%
\usepackage{upgreek}
\usepackage[hidelinks]{hyperref}
\usepackage[nonumberlist]{glossaries}
\setacronymstyle{long-short}
\makenoidxglossaries

\newcommand{\meansymbol}{\mu}
\newcommand{\meanupsymbol}{\upmu}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Load Glossary from external file
\loadglsentries{entries.tex}

\begin{document}

  % Option to print all terms in glossary even when they are unused
  \glsaddall

  % Actually print the glossary
  \printnoidxglossaries

\end{document}

包含entries.tex

\newglossaryentry{hello}{
  name = hello,
  description = {The mean is $\meansymbol$},
  sort = hello
}

\newglossaryentry{uphello}{
  name = uphello,
  description = {The upshape version of mean is $\meanupsymbol$},
  sort = uphello
}

在此处输入图片描述

相关内容