1

I am creating a document where I'd like to have a glossary of terms, a list of acronyms and a list of symbols. Some glossary entries combine several, e.g. BSDF stands for "bidirectional distribution function", can have some definition in the glossary and is represented as $f$ in equations.

So far, I put together this MWE:

\documentclass{article}

\usepackage[acronym,symbols]{glossaries}

\makeglossaries

% define entry in 'main' glossary:
\newglossaryentry{bsdf}{name={bidirectional scattering distribution function},
description={Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua}
}

% define entry in 'acronym' glossary:
\newacronym{acr:bsdf}{BSDF}{bidirectional scattering distribution function}

% define entry in 'symbols' glossary:
\newglossaryentry{sym:bsdf}{
  name={\ensuremath{f}},
  description={\acrfull{acr:bsdf}},
  type=symbols
}

\begin{document}
A sample document with a \gls{bsdf} (\acrshort{acr:bsdf}) and its symbol \gls{sym:bsdf}.

\printglossary[type=main]
\printglossary[type=acronym]
\printglossary[type=symbols]
\end{document}

I still have a different label for the term, acronym and symbol, which is inconvenient. Actually, in addition to having a single key to print the name, acronym and symbol, the best would be to have a single glossary entry, which I could then filter to print my glossaries.

Something like:

\documentclass{article}

\usepackage[<some options>]{glossaries}

\makeglossaries

\newglossaryentry{bsdf}{name={bidirectional scattering distribution function},
description={Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua},
acronym={BSDF},
symbol={\ensuremath{f}}
}

\begin{document}
A sample document with a \gls{bsdf} (\glsacronym{bsdf}) and its symbol \glssymbol{bsdf}.

\printglossary[type=terms]
\printglossary[type=acronyms]
\printglossary[type=symbols]
\end{document}

Is there a way to achieve that?

  • Do you want the entry to appear in all glossaries even if it has only been used in one form? That is, should bsdf appear in the symbols glossary, even if the symbol has never been used, only the abbreviation? – schtandard Jun 11 at 19:07
  • Also, do you need glossaries' capability to automatically switch between short and long forms of abbreviations? – schtandard Jun 11 at 19:23
  • I'd like all three (glossary entry, acronym and symbol) to appear in their respective glossary. In this specific case, a defined entry means that it is used somewhere in the document. – M4urice Jun 13 at 8:33
  • And I do not need the ability to switch between short and long abbreviation forms, manual control is fine. – M4urice Jun 13 at 8:34
  • 1
    I would say it's better to create your own front end that manages three distinct glossaries, similar to Denys' suggestion. This way you don't lose all the advantages that glossaries is offering. For example, you could have the entries sorted differently in the different glossaries, which might be useful. – schtandard Jun 18 at 13:30
2
+50

Probably you just can define commands, one for creating three glossary entries, and two for showing them without prefix?

\documentclass{article}

\usepackage[acronym,symbols]{glossaries}

\makeglossaries

% create 3 entries at once
\newcommand{\myglossaryentry}[5]{%
\newglossaryentry{#1}{name={#3},description={#4}}%
\newacronym{acr:#1}{#2}{#3}%
\newglossaryentry{sym:#1}{name={#5}, description={#3}, type=symbols}%
}

% short commands
\newcommand{\glsacronym}[1]{\acrshort{acr:#1}}
\newcommand{\glssym}[1]{\gls{sym:#1}}

\myglossaryentry{bsdf}{BSDF}{bidirectional scattering distribution function}{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua}{\ensuremath{f}}

\begin{document}
A sample document with a \gls{bsdf} (\acrshort{acr:bsdf}) and its symbol \gls{sym:bsdf}.
A sample document with a \gls{bsdf} (\glsacronym{bsdf}) and its symbol \glssym{bsdf}.

\printglossary[type=main]
\printglossary[type=acronym]
\printglossary[type=symbols]
\end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.