# Glossaries in multilingual document

For the shown MWE, the file won't run

\documentclass[a4paper,12pt,twoside]{book}
\usepackage[nil,bidi=basic-r,layout=counters.lists.tabular]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelprovide[import=en,]{english}
\babelfont[arabic]{rm}{Amiri}
\babelfont{rm}{Times New Roman}

\usepackage{glossaries}

\makeglossaries

\newglossaryentry{latex}
{
name=latex,
description={Is a mark up language specially suited
for scientific documents}
}

\newglossaryentry{maths}
{
name=mathematics,
description={Mathematics is what mathematicians do}
}

\title{How to create a glossary}
\author{ }
\date{ }

\begin{document}
\maketitle

The \Gls{latex} typesetting markup language is specially suitable
for documents that include \gls{maths}.

\clearpage

\printglossaries

\end{document}


babel redefines the command @arabic, it no longer gives a number and makeindex doesn't like this.

You can try this:

\usepackage{glossaries}
\makeatletter
\renewcommand*{\gls@arabicpage}{\number\c@page}
\makeatother


Then the entries will at least appear. The formating of the page numbers are perhaps wrong, but this could be changed in another place.

This is only a work-around. There is the general question here if such a redefinition of @arabic is sound or not.

(On my system I also get an error from tracklang which doesn't like the "nil" language, but this is a different problem.)

• I get this error: Undefined control sequence : \ForEachTrackedDialect Aug 31, 2019 at 15:58
• remove the "nil" and try again. Aug 31, 2019 at 16:00