2

I have to make a glossary for a work assignment, and I have ran into some trouble with the description key. I have looked all over google and cannot seem to find an answer for how to put a symbol inside the description key of the glossary term. Basically I have to make definitions that have alphas and mus etc inside the definition itself.

My example is:

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

The actual glossary is here:

%% entries.tex %%

%%% Glossary Entries

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

I would like the 'mu' to be replaced with the greek letter mu. Being somewhat new to LaTex, any help would be very much appreciated. Thanks!

1
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Symbol 1
    Commented Aug 6, 2015 at 3:02

1 Answer 1

1

I suggest to use logical markup with a command \meansymbol, which is set to \mu here, which prints the usual italic version of the greek letter mu. This way, it's easy to make a consistent notation throughout the document.

Additionally, I provided the upshape version, \upmu in the \meanupsymbol -- this requires \usepackage{upgreek} then. (Of course, \upmu can be used in \meansymbol too ;-)

Both versions require the switch to math mode, i.e. $\mu$ or $\upmu$

The alpha letter would be \alpha then, beta is achieved with \beta etc.

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

The entries.tex contains

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

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .