diff options
author | Robert Alessi <alessi@robertalessi.net> | 2018-03-28 00:07:59 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2018-03-29 11:23:18 +0200 |
commit | 4948d317c59e957856bf91049b8dfcc8f9141dae (patch) | |
tree | cca4a5735cf2e99b0529cb1f451d194e5e5964c1 | |
parent | 60f993283f724252b3d9df2d696ba2629a0bd73c (diff) | |
download | arabluatex-4948d317c59e957856bf91049b8dfcc8f9141dae.tar.gz |
new command \arbmark{} for inserting any additional Arabic mark
-rw-r--r-- | arabluatex.dtx | 11 | ||||
-rw-r--r-- | arabluatex.lua | 10 | ||||
-rw-r--r-- | arabluatex_voc.lua | 2 |
3 files changed, 12 insertions, 11 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx index e6b680e..53a7ed4 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx | |||
@@ -3746,16 +3746,11 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
3746 | % \begin{macro}{\arbmark} | 3746 | % \begin{macro}{\arbmark} |
3747 | % New command to be documented | 3747 | % New command to be documented |
3748 | % \begin{macrocode} | 3748 | % \begin{macrocode} |
3749 | \NewDocumentCommand{\garbmark}{m}{% | 3749 | \NewDocumentCommand{\arbmark}{m}{% |
3750 | \bgroup% | 3750 | \bgroup% |
3751 | \SetInputScheme{arabtex}% | 3751 | \SetInputScheme{arabtex}% |
3752 | \ifx\al@mode\al@mode@trans% | 3752 | \luadirect{tex.sprint(processarbmarks(\luastringN{#1}))}% |
3753 | \luadirect{tex.write(processarbmarks(\luastringN{#1}, | 3753 | \egroup} |
3754 | \luastringO{trans}))}% | ||
3755 | \else% | ||
3756 | \luadirect{tex.write(processarbmarks(\luastringN{#1}, | ||
3757 | \luastringO{notrans}))}% | ||
3758 | \fi\egroup} | ||
3759 | % \end{macrocode} | 3754 | % \end{macrocode} |
3760 | % | 3755 | % |
3761 | % \end{macro} | 3756 | % \end{macro} |
diff --git a/arabluatex.lua b/arabluatex.lua index 2c0e2c2..3d25a05 100644 --- a/arabluatex.lua +++ b/arabluatex.lua | |||
@@ -124,6 +124,12 @@ local function breakcmd(str) | |||
124 | body = string.sub(body, 2, -2) | 124 | body = string.sub(body, 2, -2) |
125 | return string.format("}\\aemph{\\%s{%s}}\\arb{", tag, body) | 125 | return string.format("}\\aemph{\\%s{%s}}\\arb{", tag, body) |
126 | end) | 126 | end) |
127 | -- Arbmark | ||
128 | str = string.gsub(str, "\\(arbmark.-)(%b{})", | ||
129 | function(tag, body) | ||
130 | body = string.sub(body, 2, -2) | ||
131 | return string.format("}\\%s{%s}\\arb{", tag, body) | ||
132 | end) | ||
127 | return str | 133 | return str |
128 | end | 134 | end |
129 | 135 | ||
@@ -665,8 +671,8 @@ function processtrans(str, mode, rules, scheme) | |||
665 | return str | 671 | return str |
666 | end | 672 | end |
667 | 673 | ||
668 | function processarbmarks(str, mode) | 674 | function processarbmarks(str) |
669 | if mode == "trans" then | 675 | if tex.textdir == "TLT" then |
670 | for i = 1,#arbmarks do | 676 | for i = 1,#arbmarks do |
671 | str = string.gsub(str, arbmarks[i].a, arbmarks[i].c) | 677 | str = string.gsub(str, arbmarks[i].a, arbmarks[i].c) |
672 | end | 678 | end |
diff --git a/arabluatex_voc.lua b/arabluatex_voc.lua index b27efdc..abd8ee8 100644 --- a/arabluatex_voc.lua +++ b/arabluatex_voc.lua | |||
@@ -23,7 +23,7 @@ along with this program. If not, see | |||
23 | --]] | 23 | --]] |
24 | 24 | ||
25 | arbmarks = { | 25 | arbmarks = { |
26 | {a="bismillah", b="﷽", c="\\arb{bi-ismi \\uc{'l-l_ahi} 'l-ra.hm_ani 'l-ra.hImi}"} | 26 | {a="bismillah", b="﷽", c="\\arb[trans]{bi-ismi \\uc{'l-l_ahi} 'l-ra.hm_ani 'l-ra.hImi}"} |
27 | } | 27 | } |
28 | 28 | ||
29 | abjad = { | 29 | abjad = { |