aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2020-04-09 10:22:07 +0200
committerRobert Alessi <alessi@robertalessi.net>2020-04-09 10:22:07 +0200
commit31391d3642f9e22185982099017e1e2e61a1df24 (patch)
tree8ea65b9f03679b95221b5c2f11770bfcfa41adbc
parent2a109362f90b3687290c5e3cc6185c5dbb236b98 (diff)
downloadarabluatex-31391d3642f9e22185982099017e1e2e61a1df24.tar.gz
use Harfbuzz in the doc. improved \arind: now works with hyperref and xindex
-rw-r--r--arabluatex.dtx33
-rw-r--r--arabluatex.lua4
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 @@
162\usepackage{dox} 162\usepackage{dox}
163\doxitem{Option}{option}{options} 163\doxitem{Option}{option}{options}
164\usepackage{microtype} 164\usepackage{microtype}
165\defaultfontfeatures{Renderer=Harfbuzz}
165\babelfont{rm}{Old Standard} 166\babelfont{rm}{Old Standard}
166\babelfont{sf}{NewComputerModern Sans} 167\babelfont{sf}{NewComputerModern Sans}
167\babelfont{tt}{NewComputerModern Mono} 168\babelfont{tt}{NewComputerModern Mono}
@@ -5059,7 +5060,7 @@
5059} 5060}
5060% \end{macrocode} 5061% \end{macrocode}
5061% \begin{macrocode} 5062% \begin{macrocode}
5062\define@cmdkeys[al]{index}[alind@]{index,root,form} 5063\define@cmdkeys[al]{index}[alind@]{index,root,form,pipe}
5063\NewDocumentCommand{\arind}{o m}{% 5064\NewDocumentCommand{\arind}{o m}{%
5064 \IfNoValueTF{#1}{% 5065 \IfNoValueTF{#1}{%
5065 \ifdefined\al@default@index% 5066 \ifdefined\al@default@index%
@@ -5071,16 +5072,38 @@
5071 \bgroup 5072 \bgroup
5072 \setkeys[al]{index}{#1}% 5073 \setkeys[al]{index}{#1}%
5073 \def\al@one{% 5074 \def\al@one{%
5074 \ifdefined\alind@root!\LR{\alind@root}\else!\LR{1}\fi}% 5075 \ifdefined\alind@root
5076 \ifnum\alind@root < 10%
5077 !\LR{0\alind@root}%
5078 \else
5079 !\LR{\alind@root}%
5080 \fi
5081 \else
5082 !\LR{01}%
5083 \fi}%
5075 \def\al@two{% 5084 \def\al@two{%
5076 \ifdefined\alind@form @\arb[\al@index@mode]{\alind@form}\else\fi}% 5085 \ifdefined\alind@form @\arb[\al@index@mode]{\alind@form}\else\fi}%
5077 \ifdefined\alind@index% 5086 \ifdefined\alind@index%
5078 \csname index\endcsname[\alind@index]{#2\al@one\al@two}% 5087 \ifdefined\alind@pipe
5088 \csname index\endcsname[\alind@index]{#2\al@one\al@two|\alind@pipe}%
5089 \else
5090 \csname index\endcsname[\alind@index]{#2\al@one\al@two}%
5091 \fi
5079 \else% 5092 \else%
5080 \ifdefined\al@default@index% 5093 \ifdefined\al@default@index%
5081 \csname index\endcsname[\al@default@index]{#2\al@one\al@two}% 5094 \ifdefined\alind@pipe
5095 \csname index\endcsname[\al@default@index]{%
5096 #2\al@one\al@two|\alind@pipe}%
5097 \else
5098 \csname index\endcsname[\al@default@index]{%
5099 #2\al@one\al@two}%
5100 \fi
5082 \else% 5101 \else%
5083 \csname index\endcsname{#2\al@one\al@two}% 5102 \ifdefined\alind@pipe
5103 \csname index\endcsname{#2\al@one\al@two|\alind@pipe}%
5104 \else
5105 \csname index\endcsname{#2\al@one\al@two}%
5106 \fi
5084 \fi% 5107 \fi%
5085 \fi% 5108 \fi%
5086 \egroup}} 5109 \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)
660 str = gsub(str, arind * bcbraces, function(tag, arg) 660 str = gsub(str, arind * bcbraces, function(tag, arg)
661 arg = string.sub(arg, 2, -2) 661 arg = string.sub(arg, 2, -2)
662 if mode == "trans" then 662 if mode == "trans" then
663 return string.format("%s{\\txtrans{%s}}", tag, arg) 663 return string.format("%s{%s@\\txtrans{%s}}", tag, arg, arg)
664 else 664 else
665 arg = novoc(arg) 665 arg = novoc(arg)
666 arg = string.gsub(arg, "\\arabicfont%s?{}", "") 666 arg = string.gsub(arg, "\\arabicfont%s?{}", "")
667 return string.format("%s{\\txarb{%s}}", tag, arg) 667 return string.format("%s{%s@\\txarb{%s}}", tag, arg, arg)
668 end 668 end
669 end) 669 end)
670 return str 670 return str