1

I use the class memoir and compile in XeLaTeX.

I would like to print glossaries in a separated file and to ignore all gls. I do not write any gls in anywhere. Similar to \nocite{*}. Also similar to To­bias Oetiker's acronym.sty.

Imagine like:

\documentclass{memoir}
\usepackage{glossaries}

\begin{document}

  \nogls(*)
  \include{gloassries.tex}
\end{document}

The separated file glossaries.tex:

\newglossaryentry{Cloud}
{
    name=Cloud,
    description={shared pools of configurable computer system resources and higher-level services that can be rapidly provisioned with minimal management effort, often over the Internet.}
}

\newglossaryentry{Docker}
{
    name=Docker,
    description={a computer program that performs operating-system-level virtualization, also known as "containerization".}
}

Derived from Tobias' acronym.sty, imagine like:

\documentclass{memoir}
\usepackage{glossaries}

\begin{document}
  \include{gloassries.tex}
\end{document}

The separated file glossaries.tex

\chapter*{Glossaries}
\addcontentsline{toc}{chapter}{Glossaries}
\markboth{GLOSSARIES}{GLOSSARIES}

\begin{glossary}
{\small
\glo{Cloud}{shared pools of configurable computer system resources and higher-level services that can be rapidly provisioned with minimal management effort, often over the Internet.}
\glo{Docker}{a computer program that performs operating-system-level virtualization, also known as "containerization".}
}
\end{glossary}

Is it possible?

Update

Because I searched for the questions, tried all the codes and they did not work. Here is the MWE:

\documentclass[12pt, a4paper, oneside, oldfontcommands, dvipsnames]{memoir}
\usepackage{acronym}
\usepackage{glossaries}
\makeglossaries

\begin{document}
    \tableofcontents

    \include{acronimos}

    \clearpage

    \glsaddall
    \input{capitulos/glossario.tex}
    \printglossaries

    \backmatter
    \nocite{*}
    \begin{raggedright}
    \printbibliography
    \end{raggedright}

\end{document}

Update 2

I also have moved to the preamble but it did not work:

\documentclass[12pt, a4paper, oneside, oldfontcommands, dvipsnames]{memoir}
\usepackage{acronym}
\usepackage{glossaries}
\makeglossaries
\input{capitulos/glossario.tex}

\begin{document}
    \tableofcontents

    \include{acronimos}

    \clearpage

    \glsaddall
    \printglossaries

    \backmatter
    \nocite{*}
    \begin{raggedright}
    \printbibliography
    \end{raggedright}

\end{document}
  • 1
    \glsaddall, see the documentation. And better don't use \include but \input. – Ulrike Fischer Nov 29 '18 at 13:16
  • Then it does not work either. – Gustavo Reis Nov 29 '18 at 13:25
  • Do you load the glossaries definitions before the command? – Ulrike Fischer Nov 29 '18 at 13:31
  • Yes, it does. I will upload the post – Gustavo Reis Nov 29 '18 at 13:33
  • 1
    And now you will have to run xelatex > biber > makeglossaries > xelatex (if you want some sorting, for simpler output variants see Nicola's answer and the documentation). – Ulrike Fischer Nov 29 '18 at 13:59
3

This is the simplest method if you want to list all defined terms in the order of definition:

\documentclass{memoir}
\usepackage[sort=none]{glossaries-extra}

\newglossaryentry{Cloud}
{
    name=Cloud,
    description={shared pools of configurable computer system resources and higher-level services that can be rapidly provisioned with minimal management effort, often over the Internet.}
}

\newglossaryentry{Docker}
{
    name=Docker,
    description={a computer program that performs
    operating-system-level virtualization, also known as 
   ``containerization''.}
}

\begin{document}

\printunsrtglossaries
\end{document}

image of glossary

If you want an abbreviation list as well:

\documentclass{memoir}
\usepackage[sort=none,abbreviations]{glossaries-extra}

\newglossaryentry{Cloud}
{
    name=Cloud,
    description={shared pools of configurable computer system resources and higher-level services that can be rapidly provisioned with minimal management effort, often over the Internet.}
}

\newglossaryentry{Docker}
{
    name=Docker,
    description={a computer program that performs
    operating-system-level virtualization, also known as
   ``containerization''.}
}

\newabbreviation{html}{HTML}{hypertext markup language}
\newabbreviation{xml}{XML}{extensible markup language}

\begin{document}

\printunsrtglossaries
\end{document}

If you want to change the style or the order that the lists are displayed, you need to use \printunsrtglossary for each list:

\documentclass{memoir}
\usepackage[sort=none,abbreviations]{glossaries-extra}

\newglossaryentry{Cloud}
{
    name=Cloud,
    description={shared pools of configurable computer system resources and higher-level services that can be rapidly provisioned with minimal management effort, often over the Internet.}
}

\newglossaryentry{Docker}
{
    name=Docker,
    description={a computer program that performs
    operating-system-level virtualization, also known as
   ``containerization''.}
}

\newabbreviation{html}{HTML}{hypertext markup language}
\newabbreviation{xml}{XML}{extensible markup language}

\begin{document}

\printunsrtglossary % default: style=list, type=main
\printunsrtglossary[type=abbreviations,style=long]
\end{document}

There are lots of predefined styles.

If your definitions are in an external file, use \input not \include in the preamble.

The above examples don't perform any sorting. If you want the lists sorted automatically then you need to use one of the indexing methods described in the manual and incorporate the appropriate external tool into your document build, as mentioned in the comments.

  • Lists sorted automatically... do you mean sort alphabetically? – Gustavo Reis Nov 29 '18 at 14:11
  • @GustavoReis I meant automatically sorting the lists in alphabetical order :-) (Rather than just listing the terms in the order in which you defined them.) – Nicola Talbot Nov 29 '18 at 14:18
  • Sorry, @nicola-talbot, I received an error when I wrote name=Google Cloud Container Registry. I see that the glossaries-extra accepts only one word and not more than two words. – Gustavo Reis Nov 29 '18 at 15:50
  • @GustavoReis That should work as long as the value doesn't contain a comma or braces, but try grouping the value: name={Google Cloud Container Registry}. What's the error message? – Nicola Talbot Nov 29 '18 at 17:49

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.