diff options
author | Robert Alessi <alessi@robertalessi.net> | 2016-09-13 20:13:31 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2016-09-13 20:19:57 +0200 |
commit | c77ce8fdac0f89097eaca09851b347803839ad99 (patch) | |
tree | 56d52444f20cb07a9cd4b140cea637fca24aedd7 | |
parent | f7119f8f29b65e4902afa8b154f5ab3227500c9a (diff) | |
download | arabluatex-c77ce8fdac0f89097eaca09851b347803839ad99.tar.gz |
added new macro \abraces which puts its argument between braces
-rw-r--r-- | arabluatex.dtx | 12 | ||||
-rw-r--r-- | arabluatex.lua | 9 |
2 files changed, 20 insertions, 1 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx index 9c30812..fccee3c 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx | |||
@@ -198,7 +198,7 @@ | |||
198 | %</driver> | 198 | %</driver> |
199 | % \fi | 199 | % \fi |
200 | % | 200 | % |
201 | % \CheckSum{372} | 201 | % \CheckSum{0} |
202 | % | 202 | % |
203 | % \CharacterTable | 203 | % \CharacterTable |
204 | % {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 | 204 | % {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 | |||
2635 | \fi} | 2635 | \fi} |
2636 | % \end{macrocode} | 2636 | % \end{macrocode} |
2637 | % \end{macro} | 2637 | % \end{macro} |
2638 | % \begin{macro}{\abraces} | ||
2639 | % \cs{abraces}\marg{Arabic text} puts its argument between curly | ||
2640 | % braces. | ||
2641 | % \changes{v1.4.3}{2016/09/13}{New command \cs{abraces} expresses | ||
2642 | % its argument between curly braces.} | ||
2643 | % \begin{macrocode} | ||
2644 | \NewDocumentCommand{\abraces}{+m}{% | ||
2645 | \luadirect{tex.sprint(abraces(\luastringN{#1}))}} | ||
2646 | % \end{macrocode} | ||
2647 | % \end{macro} | ||
2638 | % \begin{macro}{\LRmarginpar} \cs{LRmarginpar} is supposed to be | 2648 | % \begin{macro}{\LRmarginpar} \cs{LRmarginpar} is supposed to be |
2639 | % inserted in an Arabic environment. It typsets his argument in a | 2649 | % inserted in an Arabic environment. It typsets his argument in a |
2640 | % marginal note from left to right. | 2650 | % 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) | |||
589 | end | 589 | end |
590 | return "\\arb[novoc]{"..abjadnum.."}" | 590 | return "\\arb[novoc]{"..abjadnum.."}" |
591 | end | 591 | end |
592 | |||
593 | function abraces(str) | ||
594 | if tex.textdir == "TRT" then | ||
595 | str = "\\}"..str.."\\{" | ||
596 | elseif tex.textdir == "TLT" then | ||
597 | str = "\\{"..str.."\\}" | ||
598 | end | ||
599 | return str | ||
600 | end | ||