From 31391d3642f9e22185982099017e1e2e61a1df24 Mon Sep 17 00:00:00 2001 From: Robert Alessi 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 ++++++++++++++++++++++++++++----- arabluatex.lua | 4 ++-- 2 files changed, 30 insertions(+), 7 deletions(-) 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}} diff --git a/arabluatex.lua b/arabluatex.lua index cc3f713..32bb500 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -660,11 +660,11 @@ local function processarind(str, mode) str = gsub(str, arind * bcbraces, function(tag, arg) arg = string.sub(arg, 2, -2) if mode == "trans" then - return string.format("%s{\\txtrans{%s}}", tag, arg) + return string.format("%s{%s@\\txtrans{%s}}", tag, arg, arg) else arg = novoc(arg) arg = string.gsub(arg, "\\arabicfont%s?{}", "") - return string.format("%s{\\txarb{%s}}", tag, arg) + return string.format("%s{%s@\\txarb{%s}}", tag, arg, arg) end end) return str -- cgit v1.2.3