I want to produce two bilingual dictionaries Arabic-English and English-Arabic. I've found this discussion which seems of some interest for my needs... So I build this file, based on it
\documentclass[twocolumn]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\newcommand*{\glossaryname}{Dictionary}
\usepackage[nonumberlist,nopostdot,xindy]{glossaries}
\newcommand{\dictentry}[3][\dictlabel]{%
\def\dictlabel{#2}%
\newglossaryentry{#1}{name=#3,description={#2}}%
\glsadd{#1}%
}
\makeglossaries
\setmainlanguage{english}
\setotherlanguage[locale=mashriq]{arabic}
\setmainfont[Ligatures=TeX]{Linux Libertine O}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.3,Mapping=arabicdigits]{Traditional Arabic}
\newglossarystyle{RLsuper}{%
\glossarystyle{super}% base this style on 'super'
\renewenvironment{theglossary}%
{\tablehead{}\tabletail{}%
\begin{supertabular}{lr}}% adjust column specifiers
{\end{supertabular}}%
% switch name and description columns:
\renewcommand*{\glossaryentryfield}[5]{%
\glsentryitem{##1}\glstarget{##1}{##3} & ##2\\}%
}
\begin{document}
%%% ENTRIES %%%%%%%%%%%
\dictentry{on}{\textarabic{هو}}%
\dictentry{ja}{\textarabic{انا}}%
\dictentry{pies}{\textarabic{كلب}}%
\dictentry{Dice}{\textarabic{زهرة نرد}}%
\dictentry{Commutative laws}{\textarabic{قوانين إبدالية}}%
\dictentry{Maximum likelihood estimate}{\textarabic{مقدر الاحتمال الأعظم}}%
\RTLdblcol
\printglossary[style=RLsuper]%
\end{document}
which gave on the first compilation a good pdf file (what I can't add to discussion because I don't know how!)...
But when I copy this file and create another file which is strictly the same, for a second try, the compilation gave me a blank pdf file... An empty file... So my questions are:
- What happens between the two compilations?
- I want to create two dictionaries, one sorted in Arabic order, and the same dictionary but sorted in the English alphabet order, how can I do this?
- For long entries like "Maximum likelihood estimate", can I split the glossary output in two lines (produced by macros like this, based on something like
\begin{tabular} m{2.5cm}m{2.5cm}} \end{tabular}
for example... - A question which seems simple, but of interest for me... How can I insert things like rules for example between the entries... exactly
\hrule\hrule
...
I can't try it because it doesn't compile! More generally, where are stocked the entries after sorting? How can I do small changes on it directly?
makeglossaries
which should create the associated file that will be inserted into the document on the next LaTeX run.\dictentry
commands are in the document environment and since they use\newglossaryentry
, this means you're defining entries in the document environment not in the preamble. Use\GlsSetXdyLanguage
(described in Language and Encodings in the user manual) to set a different language for each glossary. You can check ifmakeglossaries
ran correctly by looking for the log file.glg
.