aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx9
-rw-r--r--arabluatex.lua9
2 files changed, 15 insertions, 3 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 685b9d0..18293eb 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -3357,11 +3357,14 @@ wa-ya.sIru ta.hta 'l-jild-i
3357 \luadirect{mkarbbreak(\luastringN{#1})}} 3357 \luadirect{mkarbbreak(\luastringN{#1})}}
3358% \end{macrocode} 3358% \end{macrocode}
3359% \end{macro} 3359% \end{macro}
3360% \begin{macro}{\aemph} Arabic emphasis. Needs to be redefined as well. 3360% \begin{macro}{\aemph} Arabic emphasis. Needs to be redefined as
3361% well. The function is actually coded in Lua.
3361% \begin{macrocode} 3362% \begin{macrocode}
3362\AtBeginDocument{\ifdef{\aemph}% 3363\AtBeginDocument{\ifdef{\aemph}%
3363 {\RenewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}} 3364 {\RenewDocumentCommand{\aemph}{m}{%
3364 {\NewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}} 3365 \luadirect{tex.sprint(aemph(\luastringN{#1}))}}}
3366 {\NewDocumentCommand{\aemph}{m}{%
3367 \luadirect{tex.sprint(aemph(\luastringN{#1}))}}}}
3365% \end{macrocode} 3368% \end{macrocode}
3366% \begin{macro}{\SetInputScheme} 3369% \begin{macro}{\SetInputScheme}
3367% \changes{v1.4}{2016/07/05}{\cs{SetInputScheme} may be used to 3370% \changes{v1.4}{2016/07/05}{\cs{SetInputScheme} may be used to
diff --git a/arabluatex.lua b/arabluatex.lua
index 48e5987..f6890ed 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -719,3 +719,12 @@ function abraces(str)
719 end 719 end
720 return str 720 return str
721end 721end
722
723function aemph(str)
724 if tex.textdir == "TRT" then
725 str = "$\\overline{\\text{"..str.."}}$"
726 elseif tex.textdir == "TLT" then
727 str = "$\\underline{\\text{"..str.."}}$"
728 end
729 return str
730end