Sometimes, an article is written in a language other than English, and some essential terms are followed by their English counterparts, and at the end of the article is their a "glossary." Take "Reversed-English", a fictional language, for example:

The output of the example.

Which is yielded by the following LaTeX source:



Siht elcitra si nettirw ni \textbf{desrever Hsilgne} (reversed English).
\(0\) si a \textbf{larutan rebmun} (natural number).


\noindent \textbf{desrever Hsilgne} Reversed English.

\noindent \textbf{larutan rebmun} Natural number.


In the glossary, I manually listed the terms, which is time-consuming, error-prone and can easily get out of date. How can I automate this process? Can I just write something like \term{desrever Hsilgne}{reversed English} in the text for \textbf{desrever Hsilgne} (English) and the word automatically appear in the glossary?

The following is ideal for me, but I need your help for the \term and \MakeGlossaryContent macros:



Siht elcitra si nettirw ni \term{desrever Hsilgne}{reversed English}.
\(0\) si a \term{larutan rebmun}{natural number}.



Any help is appreciated.


You (in this case, I) can use the glossaries package or the glossaries-extra package:




% Automate the process
        name = {#2},%
        first = {\textbf{#2} (#3)},%
        description = {#4}%

    {Desrever Hsilgne}  % name
    {reversed English}  % first use description in parentheses
    {Reversed English.} % description in glossary

    {larutan rebmun}
    {natural number}
    {Natural number.}



Siht elcitra si nettirw ni \gls{reversed-english}.
\(0\) si a \gls{natural-number}.

\printglossary[title = {Yrassolg}]


resulting in:

enter image description here

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.