3

Using the glossaries package under polyglossia, I adapt the sample file presenting the English and French dictionaries sample-lang.tex to my use for the 3 languages. The result is what I want, without some details. I want to print my glossaries in twocolumn mode and this is not possible for all the three. I can do this for the latin languages (english and french) with the option twocolumn... \documentclass[twocolumn]{article} and the command \LTRdblcolumn. Note that the main language is arabic. For the arabic glossary, I use the multicol package. I give the 3 glossaries obtained: enter image description here enter image description here enter image description here

I give the tex file which produces these glossaries:

\documentclass[twocolumn]{article}
%\documentclass{article}

\usepackage{amsmath,amssymb}
\usepackage{multicol}

\usepackage{geometry}
 \geometry{paperwidth=165mm, paperheight=235mm}
\geometry{hmargin=2.5cm,vmargin=2.5cm,headheight=14pt,includefoot} 

\usepackage[nomain,nonumberlist]{glossaries}

%Remove the dot at the end of glossary descriptions
\renewcommand*{\glspostdescription}{}


% Define the 3 glossaries glg: english order, flg: french order, alg: arabic order
\newglossary[glg]{english}{gls}{glo}{English Entries}
\newglossary[flg]{french}{flx}{flo}{{\selectlanguage{french}Termes Français}}
\newglossary[alg]{arabic}{alx}{alo}{\RL{المفردات العربية}\vspace*{3mm}}

%Activate glossary commands
\makeglossaries

%These commands sort the 3 lists in command prompt
%makeindex -s filename.ist -t filename.glg -o filename.gls filename.glo
%makeindex -s filename.ist -t filename.alg -o filename.alx filename.alo
%makeindex -s filename.ist -t filename.flg -o filename.flx filename.flo

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   Packages of the languages    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\setotherlanguage{french}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2,AutoFakeSlant=-0.02]{Traditional Arabic}
\newfontfamily\englishfont[Scale=1]{Times New Roman}
\newfontfamily\frenchfont[Scale=1]{Times New Roman}
\setmonofont{Courier New}
\let\arabicfonttt\ttfamily
\setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  ORGANIZATION OF ENTRIES FOR GLOSSARIES
%%  GLOSSARY WORDS IN 6 ENTRIES 
%%  THE FIRST ONE #1 IS ARABIC  USED FOR SORTING THE ARABIC ENTRIES
%%  THE SECOND ONE #2 IS ARABIC AND CONTAINS THE ARABIC ENTRY
%%  THE THIRD ONE #3 IS ENGLISH  USED FOR SORTING THE ENGLISH ENTRIES
%%  THE FOURTH ONE #4 IS ENGLISH AND CONTAINS THE ENGLISH ENTRY
%%  THE FIFTH ONE #5 IS FRENCH  USED FOR SORTING THE FRENCH ENTRIES
%%  THE SIXTH ONE #6 IS FRENCH AND CONTAINS THE FRENCH ENTRY

%%% THE OPTION name={} SUPPRESSES THE ENTRY IN THE GLOSSARY...INCLUDED BY HAND IN THE TABULAR

\newcommand*{\newword}[6]{%
   \newglossaryentry{en-#3}{type=english,name={},sort={#3},
   description={%
   \begin{tabular}{p{5 cm}}
           \hline
   \\   \vspace*{-5mm}
   \textbf{#4}
   \\  \vspace*{-5mm}
    {\selectlanguage{french}\textit{Fr:} #6}
    \\  \vspace*{-5mm}
     {\selectlanguage{arabic}
      \aemph{عربي}:     
      #2}
   \end{tabular}
   \vspace*{-5mm}
    }}%
   \newglossaryentry{fr-#3}{type=french,name={},text={#6},sort={#5},
   description={%
     \begin{tabular}{p{5 cm}}
                \hline 
    \\ \vspace*{-5mm}
    {\selectlanguage{french} \textbf{#6}}
     \\   \vspace*{-5mm}
    {\selectlanguage{english}\textit{Eng:} #4}
     \\  \vspace*{-5mm}
    {\selectlanguage{arabic}
    \RL{ 
      \aemph{عربي}:     
      #2}
      \vspace*{-5mm}
     }
   \end{tabular}
   \vspace*{-5mm}
   }
   }%
   \newglossaryentry{ar-#3}{type=arabic,name={},text={#2},sort={#1},
   description={
         \vspace*{-5mm}
         \begin{tabular}{p{5.2 cm}}
          \hline
    \\ \vspace*{-5mm}
       \textbf{#2}
    \\ \vspace*{-5mm}
    {\selectlanguage{english}\textit{Eng:} #4}
    \\ \vspace*{-5mm}
    {\selectlanguage{french}\textit{Fr:} #6}
    \end{tabular}
    }}%
                    }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  END GLOSSARIES

%%%%%%%%%%%%%           ENTRIES
\newword{دالةمتصلة}{دالة متصلة}{ContinuousFunction}{Continuous Function}{FonctionContinue}{Fonction Continue}
\newword{متباينةبوول}{متباينة بوول}{BoolesInequality}{Boole's Inequality}{InegalitedeBoole}{Inégalité de Boole}
\newword{فراغعينة}{فراغ العيّنة}{SampleSpace}{Sample Space}{Universdeprobabilite}{Univers de probabilit\'e}

\begin{document}

 \gls{en-ContinuousFunction} \gls{fr-ContinuousFunction} \gls{ar-ContinuousFunction}
 \gls{en-BoolesInequality} \gls{fr-BoolesInequality} \gls{ar-BoolesInequality}
 \gls{en-SampleSpace} \gls{fr-SampleSpace} \gls{ar-SampleSpace}

\selectlanguage{english}
 \LTRdblcol

\printglossary[type=english]

%%\newpage
\selectlanguage{french}
\LTRdblcol
\printglossary[type=french]

\newpage
\RTLdblcol
\selectlanguage{arabic}
\begin{multicols}{2}[]
\printglossary[type=arabic]
\end{multicols}

\end{document}

Now, my questions are:

1/ How can I solve this problem of the twocolumning in the same file for english and arabic glossary ?

2/ Are the commands I use good for my purpose ? Is there a more "elegant" and mostly robust method for this ?

  • I don't have the required fonts installed, so I can't test your document, but have you tried the multi-column glossary styles described in the "Multicols Styles" section of the manual? – Nicola Talbot Jun 24 '15 at 18:46
  • @NicolaTalbot I just saw your message. Thanks for your disponibility. I'll see your document about Multicols. For the arabic font you can choose any font you want, Simplified Arabic, for example – Faouzi Bellalouna Jun 25 '15 at 19:52
  • I've tried with some entries and I have some error messages. I think that I'll choose to produce the three glossaries arabic-english-french one-by-one and include the 3 files with includepdf or something like – Faouzi Bellalouna Jun 25 '15 at 20:16
  • Did you ever find a satisfactory solution? Would you like to share it by answering your question? – schtandard Jul 31 at 11:09
  • @schtandard I just saw your message and I'm trying to organize some useful solution – Faouzi Bellalouna yesterday
1

I give a .tex file I used to produce an acceptable solution:

\documentclass{book}

\usepackage{amsmath,amssymb}
\usepackage{titleps}
\usepackage{multicol}

\usepackage{geometry}
 \geometry{paperwidth=165mm, paperheight=235mm}
\geometry{hmargin=2.5cm,vmargin=2.5cm,headheight=14pt,includefoot} 

\usepackage[nomain,nonumberlist]{glossaries}
%%\usepackage[entrycounter,nomain,nonumberlist]{glossaries}

%Remove the dot at the end of glossary descriptions
\renewcommand*{\glspostdescription}{}


% Define the 3 glossaries glg: english order, flg: french order, alg: arabic order
\newglossary[glg]{english}{gls}{glo}{English Entries}
\newglossary[flg]{french}{flx}{flo}{{\selectlanguage{french}Termes Français}}
\newglossary[alg]{arabic}{alx}{alo}{\RL{المفردات العربية}\vspace*{10mm}}

%Activate glossary commands
\makeglossaries

%These commands sort the 3 lists, on command prompt
%makeindex -s filename.ist -t filename.glg -o filename.gls filename.glo
%makeindex -s filename.ist -t filename.alg -o filename.alx filename.alo
%makeindex -s filename.ist -t filename.flg -o filename.flx filename.flo

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   Commands used for the languages
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\setotherlanguage{french}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2,AutoFakeSlant=-0.02]{Traditional Arabic}
\newfontfamily\englishfont[Scale=1]{Times New Roman}
\newfontfamily\frenchfont[Scale=1]{Times New Roman}
\setmonofont{Courier New}
%%%\setmonofont{DejaVu Sans Mono}
\let\arabicfonttt\ttfamily
\setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  ORGANIZE ENTRIES AND GLOSSARIES
\newcommand*{\newword}[6]{%
   \newglossaryentry{en-#3}{type=english,name={},sort={#3},
   description={%
   \begin{tabular}{p{5 cm}}
           \hline
  \\   \vspace*{-5mm}
   \textbf{#4}
   \\  \vspace*{-5mm}
{\selectlanguage{french}\textit{Fr:} #6}
    \\  \vspace*{-5mm}
     {\selectlanguage{arabic}
      \aemph{عربي}:     
      #2}
   \end{tabular}
   \vspace*{-5mm}
               }
                            }%
    \newglossaryentry{fr-#3}{type=french,name={},text={#6},sort={#5},
   description={%
     \begin{tabular}{p{5 cm}}
                \hline 
\\ \vspace*{-5mm}
{\selectlanguage{french} \textbf{#6}}
     \\   \vspace*{-5mm}
 {\selectlanguage{english}\textit{Eng:} #4}
    \\  \vspace*{-5mm}
    {\selectlanguage{arabic}
    \RL{ 
      \aemph{عربي}:     
      #2
     }
      \vspace*{-5mm}
     }
   \end{tabular}
   \vspace*{-5mm}
   }
                           }%
 \newglossaryentry{ar-#3}{type=arabic,name={},text={#2},sort={#1},
   description={
         \vspace*{-5mm}
         \begin{tabular}{p{5.2 cm}}
          \hline
\\ \vspace*{-5mm}
       \textbf{#2}
   \\ \vspace*{-5mm}
 {\selectlanguage{english}\textit{Eng:} #4}
   \\ \vspace*{-5mm}
{\selectlanguage{french}\textit{Fr:} #6   
}
    \end{tabular}
   }
                            }%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  END GLOSSARIES

%% Here is the file of data entries
\input{Entries_Dic_AEF.tex}


\newpagestyle{Dictionary}{
  \setheadrule{0pt}% Header rule
%  \setfootrule{0.4pt}% Header rule
    \renewcommand{\makefootrule}{\rule[\baselineskip]{\linewidth}{0.4pt}}
  \setfoot[]% even left
    [\thepage]% even centre
    []% even right
    {}% odd left
    {\thepage}% odd centre
    {}% odd right
} 

\begin{document}
\pagestyle{Dictionary}



%% Here is the file of glossary data entries
\input{Entries_GLS_Dic_AEF}




%% The english dictionnary
%\selectlanguage{english}
%\title{Dictionary of mathematical terms}
%\author{English-French-Arabic}
%\date{}
%%%\maketitle
% \LTRdblcol
%\printglossary[type=english]

%% The french dictionnary
%\selectlanguage{french}
%\title{Lexique des termes mathématiques}
%\author{Français-Anglais-Arabe}
%\date{}
%%%\maketitle
%\LTRdblcol
%\printglossary[type=french]


%% The arabic dictionnary
\newpage
\title{معجم مصطلحات الرياضيات}
\author{عربي-انجليزي-فرنسي}
\date{}
%%%\maketitle
\RTLdblcol
\selectlanguage{arabic}
\begin{multicols}{2}[]
\printglossary[type=arabic]
\end{multicols}

\end{document}

which uses the following file of data entries Entries_Dic_AEF.tex :

\newword{دالةمتصلة}{دالة متصلة}{continuousFunction}{continuous function}{fonctionContinue}{fonction continue}
\newword{متباينةبوول}{متباينة بوول}{boolesInequality}{Boole's inequality}{inegalitedeBoole}{inégalité de Boole}
\newword{متباينة}{متباينة}{inequality}{inequality}{inegalite}{inégalité}
\newword{قانونإحتواءالإبعاد}{قانون الإحتواء-الإبعاد}{inclusionExclusionIdentity}{inclusion-exclusion Identity}{inclusionExclusionEgalite}{inclusion-Exclusion, Egalité}

and the following file of glossary data entries, Entries_GLS_Dic_AEF.tex:

\gls{en-continuousFunction}\gls{en-boolesInequality}\gls{en-inequality}\gls{en-inclusionExclusionIdentity}

\gls{fr-continuousFunction}\gls{fr-boolesInequality}\gls{fr-inequality}\gls{fr-inclusionExclusionIdentity}

\gls{ar-continuousFunction}\gls{ar-boolesInequality}\gls{ar-inequality}\gls{ar-inclusionExclusionIdentity}

Note that my files contain much more entries, and that I can post it if any !

Now I use this file to produce the dictionnary in the three languages separately, by commenting the two other commands languages, in each language. (Here in the .tex file, I produce the arabic dictionnary)...

  • Note that we can produce all the three pdf files together, with some file like the following: \documentclass{article} \usepackage[nogin]{Sweave} \usepackage{pdfpages} \begin{document} \newpage \includepdf[fitpaper=true, pages=-]{Dict_Arab} \includepdf[fitpaper=true, pages=last-1]{Dict_Fr} \includepdf[fitpaper=true, pages=last-1]{Dict_Eng} \end{document} – Faouzi Bellalouna yesterday
  • Hoping that it makes some help for the interested with these glossaries, and expecting some refinements and remarks from all. Many thanks – Faouzi Bellalouna yesterday

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.