From 945113620ca5de402bb6d63b9fd8573281da37cd Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Tue, 5 Sep 2017 16:09:14 +0200 Subject: \aemph now outputs \underline instead of \overline in any of the transliteration modes --- arabluatex.dtx | 9 ++++++--- arabluatex.lua | 9 +++++++++ 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 \luadirect{mkarbbreak(\luastringN{#1})}} % \end{macrocode} % \end{macro} -% \begin{macro}{\aemph} Arabic emphasis. Needs to be redefined as well. +% \begin{macro}{\aemph} Arabic emphasis. Needs to be redefined as +% well. The function is actually coded in Lua. % \begin{macrocode} \AtBeginDocument{\ifdef{\aemph}% - {\RenewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}} - {\NewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}} + {\RenewDocumentCommand{\aemph}{m}{% + \luadirect{tex.sprint(aemph(\luastringN{#1}))}}} + {\NewDocumentCommand{\aemph}{m}{% + \luadirect{tex.sprint(aemph(\luastringN{#1}))}}}} % \end{macrocode} % \begin{macro}{\SetInputScheme} % \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) end return str end + +function aemph(str) + if tex.textdir == "TRT" then + str = "$\\overline{\\text{"..str.."}}$" + elseif tex.textdir == "TLT" then + str = "$\\underline{\\text{"..str.."}}$" + end + return str +end -- cgit v1.2.3