From c77ce8fdac0f89097eaca09851b347803839ad99 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Tue, 13 Sep 2016 20:13:31 +0200 Subject: added new macro \abraces which puts its argument between braces --- arabluatex.dtx | 12 +++++++++++- arabluatex.lua | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/arabluatex.dtx b/arabluatex.dtx index 9c30812..fccee3c 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx @@ -198,7 +198,7 @@ % % \fi % -% \CheckSum{372} +% \CheckSum{0} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -2635,6 +2635,16 @@ wa-ya.sIru ta.hta 'l-jild-i \fi} % \end{macrocode} % \end{macro} +% \begin{macro}{\abraces} +% \cs{abraces}\marg{Arabic text} puts its argument between curly +% braces. +% \changes{v1.4.3}{2016/09/13}{New command \cs{abraces} expresses +% its argument between curly braces.} +% \begin{macrocode} +\NewDocumentCommand{\abraces}{+m}{% + \luadirect{tex.sprint(abraces(\luastringN{#1}))}} +% \end{macrocode} +% \end{macro} % \begin{macro}{\LRmarginpar} \cs{LRmarginpar} is supposed to be % inserted in an Arabic environment. It typsets his argument in a % marginal note from left to right. diff --git a/arabluatex.lua b/arabluatex.lua index c0e0232..35dccff 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -589,3 +589,12 @@ function abjadify(n) end return "\\arb[novoc]{"..abjadnum.."}" end + +function abraces(str) + if tex.textdir == "TRT" then + str = "\\}"..str.."\\{" + elseif tex.textdir == "TLT" then + str = "\\{"..str.."\\}" + end + return str +end -- cgit v1.2.3