From 31391d3642f9e22185982099017e1e2e61a1df24 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Thu, 9 Apr 2020 10:22:07 +0200
Subject: use Harfbuzz in the doc. improved \arind: now works with hyperref and
 xindex

---
 arabluatex.dtx | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index ba19855..6a91d9f 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -162,6 +162,7 @@
 \usepackage{dox}
 \doxitem{Option}{option}{options}
 \usepackage{microtype}
+\defaultfontfeatures{Renderer=Harfbuzz}
 \babelfont{rm}{Old Standard}
 \babelfont{sf}{NewComputerModern Sans}
 \babelfont{tt}{NewComputerModern Mono}
@@ -5059,7 +5060,7 @@
 }
 %    \end{macrocode}
 %    \begin{macrocode}
-\define@cmdkeys[al]{index}[alind@]{index,root,form}
+\define@cmdkeys[al]{index}[alind@]{index,root,form,pipe}
 \NewDocumentCommand{\arind}{o m}{%
   \IfNoValueTF{#1}{%
     \ifdefined\al@default@index%
@@ -5071,16 +5072,38 @@
     \bgroup
     \setkeys[al]{index}{#1}%
     \def\al@one{%
-      \ifdefined\alind@root!\LR{\alind@root}\else!\LR{1}\fi}%
+      \ifdefined\alind@root
+        \ifnum\alind@root < 10%
+          !\LR{0\alind@root}%
+        \else
+          !\LR{\alind@root}%
+        \fi
+      \else
+      !\LR{01}%
+      \fi}%
     \def\al@two{%
       \ifdefined\alind@form @\arb[\al@index@mode]{\alind@form}\else\fi}%
     \ifdefined\alind@index%
-      \csname index\endcsname[\alind@index]{#2\al@one\al@two}%
+      \ifdefined\alind@pipe
+        \csname index\endcsname[\alind@index]{#2\al@one\al@two|\alind@pipe}%
+      \else
+        \csname index\endcsname[\alind@index]{#2\al@one\al@two}%
+      \fi
     \else%
       \ifdefined\al@default@index%
-        \csname index\endcsname[\al@default@index]{#2\al@one\al@two}%
+        \ifdefined\alind@pipe
+          \csname index\endcsname[\al@default@index]{%
+            #2\al@one\al@two|\alind@pipe}%
+        \else
+          \csname index\endcsname[\al@default@index]{%
+            #2\al@one\al@two}%
+        \fi
       \else%
-        \csname index\endcsname{#2\al@one\al@two}%
+        \ifdefined\alind@pipe
+          \csname index\endcsname{#2\al@one\al@two|\alind@pipe}%
+        \else
+          \csname index\endcsname{#2\al@one\al@two}%
+        \fi
       \fi%
     \fi%
     \egroup}}
-- 
cgit v1.2.3

