wrong group titles in glossaries, using xepersian and xindy

by user190860   Last Updated June 12, 2019 07:23 AM - source

I am using TeXworks to write my Phd thesis in Persian by use of xepersian package. Trying to print 3 glossaries at the end of thesis, I have p roblem with xindy. More specifically, in Persian to English glossary, when I try to group the glossary entries according to Persian alphabets, they are not grouped, and the group titles are not recognized right. I am quite new at Latex, and it is possible that I miss something simple, please help me. Following is the MWE:

\documentclass[twoside]{thesis}

\usepackage[xetex,colorlinks,bookmarksnumbered,citecolor=darkred,urlcolor=darkgreen]{hyperref} \usepackage{multicol} \usepackage[all]{hypcap} \usepackage[xindy,nonumberlist=true,nomain]{glossaries} \usepackage{url}

\usepackage[localise,extrafootnotefeatures]{xepersian}

\usepackage{xifthen}% Provides \isempty test which is used for glossary

\settextfont[Scale=1]{XB Zar} \setlatintextfont[Scale=1]{Linux Libertine} \setdigitfont{Yas}

% Glossary \glsdisablehyper % disable hyperlinks

% ======================================================== % defining styles

\newglossarystyle{persian-to-english}{% \renewenvironment{theglossary}% {\begin{multicols}{2}\begingroup \flushright \linespread{1.8}\selectfont} {\endgroup \end{multicols}}% \renewcommand*{\glossaryheader}{}% \renewcommand*{\glsgroupheading}[1]{\begin{RTL} \subsection*{\rl{\glsgetgrouptitle{##1}}} \end{RTL}} % \renewcommand*{\glsgroupskip}{}% % \glossaryentryfield{label}{formatted name}{description}{symbol}{number list} \renewcommand*{\glossaryentryfield}[5]{% \glstarget{##1}{##2}% persian term \dotfill% \space \lr{##3} \%translation term }% \renewcommand*{\glossarysubentryfield}[6]{% \glossaryentryfield{##2}{##3}{##4}{##5}{##6}% }% } \newglossarystyle{english-to-persian}{% \renewenvironment{theglossary}% {\begin{multicols}{2}\begingroup \flushright \linespread{1.8}\selectfont}% {\endgroup \end{multicols}}% \renewcommand*{\glossaryheader}{}% \renewcommand*{\glsgroupheading}[1]{\begin{LTR} \subsection*{\glsgetgrouptitle{##1}} \end{LTR}} \renewcommand*{\glsgroupskip}{}% % \glossaryentryfield{label}{formatted name}{description}{symbol}{number list} \renewcommand*{\glossaryentryfield}[5]{% \glstarget{##1}{##2}%translation term \dotfill% \space \rl{##3} \%persian term }% \renewcommand*{\glossarysubentryfield}[6]{% \glossaryentryfield{##2}{##3}{##4}{##5}{##6}% }% } \newglossarystyle{abbreviation-list}{% \renewenvironment{theglossary}{}{}% \renewcommand*{\glossaryheader}{}% \renewcommand*{\glsgroupheading}[1]{\begin{LTR} \subsection*{\glsgetgrouptitle{##1}} \end{LTR}}% \renewcommand*{\glsgroupskip}{\vskip 10mm}% % \glossaryentryfield{label}{formatted name}{description}{symbol}{number list} \renewcommand*{\glossaryentryfield}[5]{% \glstarget{##1}{##3}%translation term \dotfill% \space \lr{##2} \%persian term }% \renewcommand*{\glossarysubentryfield}[6]{% \glossaryentryfield{##2}{##3}{##4}{##5}{##6}% }% }

% ======================================================== % defining glossary terms

\newglossary{p2e-terms}{fa.gls}{fa.glo}{واژه‌نامه‌ی فارسی به انگلیسی} % persian to english \newglossary{e2p-terms}{en.gls}{en.glo}{واژه‌نامه‌ی انگلیسی به فارسی} % english to persian \newglossary{ac-terms}{ac.gls}{ac.glo}{فهرست اختصارات} % abbreviation Glossary

\newcommand{\newterm}[5][]{% params: [key]{persian}{english}{persian-plural}{english-abbreviation} \ifthenelse{\isempty{#1}}{\def\key{#2}}{\def\key{#1}}% \newglossaryentry{ac:\key}{type={ac-terms}, name={#3}, description={#5}, sort={#5}}% abbreviation glossary \newglossaryentry{en:\key}{type={e2p-terms}, name={#3}, description={#2}, sort={#3}}% english glossary \newglossaryentry{fa:\key}{type={p2e-terms}, name={\rl{#2}}, plural={\rl{#4}}, description={#3}, user1={#5}, sort={#2}}% persian glossary }

\defglsentryfmt[p2e-terms]{% \ifdefempty\glsinsert{% use word itself \ifglsused\glslabel{% subsequent usages \glsifplural{% \glscapscase{\glsentryplural{\glslabel}}% {\Glsentryplural{\glslabel}}% {\mfirstucMakeUppercase{\glsentryplural{\glslabel}}}% }% {% \glscapscase{\glsentrytext{\glslabel}}% {\Glsentrytext{\glslabel}}% {\mfirstucMakeUppercase{\glsentrytext{\glslabel}}}% }% }% {% first usage \glsifplural{% \glscapscase{\glsentryfirstplural{\glslabel}}% {\Glsentryfirstplural{\glslabel}}% {\mfirstucMakeUppercase{\glsentryfirstplural{\glslabel}}}% }% {% \glscapscase{\glsentryfirst{\glslabel}}% {\Glsentryfirst{\glslabel}}% {\mfirstucMakeUppercase{\glsentryfirst{\glslabel}}}% }% \space(\lr{\glsentryuseri{\glslabel}\LTRfootnote{\glsentrydesc{\glslabel}}}) }% }% {% override word with glsinsert \ifglsused\glslabel{% subsequent usages \glsinsert% }% {% first usage \glsinsert\space(\lr{\glsentryuseri{\glslabel}\LTRfootnote{\glsentrydesc{\glslabel}}}) }% }% }%

%\term[نمونه‌های]{key} \newcommand{\term}[2][]{% \glsadd{en:#2}% \glsadd{ac:#2}% \ifthenelse{\isempty{#1}}{\gls{fa:#2}}{\gls{fa:#2}[#1]}% } \newcommand{\termpl}[2][]{% \glsadd{en:#2}% \glsadd{ac:#2}% \ifthenelse{\isempty{#1}}{\glspl{fa:#2}}{\glspl{fa:#2}[#1]}% }

% ======================================================== % defining \printpersianglossary \printenglishglossary \printabbreviationglossary

\newcommand{\printpersianglossary}[1][واژه‌نامه‌ی فارسی به انگلیسی]{% \phantomsection% \addcontentsline{toc}{chapter}{#1}% \renewcommand{\glossarymark}[1]{\markboth{##1}}% \RTLmulticolcolumns% \printglossary[type={p2e-terms},style={persian-to-english},title={\rl{#1}}]% } \newcommand{\printenglishglossary}[1][واژه‌نامه‌ی انگلیسی به فارسی]{% \phantomsection% \addcontentsline{toc}{chapter}{#1}% \renewcommand{\glossarymark}[1]{\markboth{##1}}% \begin{latin}% \LTRmulticolcolumns \printglossary[type={e2p-terms},style={english-to-persian},title={\rl{#1}}]% \end{latin}% } \newcommand{\printabbreviationglossary}[1][فهرست اختصارات]{% \phantomsection% \addcontentsline{toc}{chapter}{#1}% \renewcommand{\glossarymark}[1]{\markboth{##1}}% \begin{latin}% \LTRmulticolcolumns \printglossary[type={ac-terms},style={abbreviation-list},title={\rl{#1}}]% \end{latin}% }

% ======================================================== %

\makeglossaries

\newterm[mac]{لایه کنترل دسترسی}{Medium access control}{}{MAC} \newterm[wichan]{کانال بی‌سیم}{Wireless channel}{کانال‌های بی‌سیم}{WiChan} \newterm[rn]{گره رله}{Relay node}{}{RN}

\begin{document}

به عنوان نمونه ترتیب کلمات زیر در واژه‌نامه فارسی به انگلیسی درست نیست. اصلاً گروه‌بندی نمی‌شوند. \term{mac} \term{wichan} \term{rn}

{% \cleardoublepage\setlength{\baselineskip}{1cm}\printpersianglossary% \cleardoublepage\printenglishglossary% \cleardoublepage\printabbreviationglossary% }

\end{document}



Related Questions


Getting error for xindy glassory

Updated September 21, 2018 07:23 AM

No Persian language in xindy/lang directory

Updated July 31, 2016 08:09 AM


Glossaries not printing,Its not working Chapter wise

Updated August 11, 2018 12:23 PM