aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx25
-rw-r--r--arabluatex.lua9
2 files changed, 17 insertions, 17 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 78bd3d4..01ceabc 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -4509,16 +4509,16 @@
4509% it to suit our purpose: 4509% it to suit our purpose:
4510% \begin{macrocode} 4510% \begin{macrocode}
4511\AtBeginDocument{\ifdef{\LR}% 4511\AtBeginDocument{\ifdef{\LR}%
4512 {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}} 4512 {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\normalfont#1\egroup}}
4513 {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}} 4513 {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\normalfont#1\egroup}}}
4514% \end{macrocode} 4514% \end{macrocode}
4515% \end{macro} 4515% \end{macro}
4516% \begin{macro}{\RL} This one typesets its argument from right to 4516% \begin{macro}{\RL} This one typesets its argument from right to
4517% left. Same remark as above regarding the need of redefinition. 4517% left. Same remark as above regarding the need of redefinition.
4518% \begin{macrocode} 4518% \begin{macrocode}
4519\AtBeginDocument{\ifdef{\RL}% 4519\AtBeginDocument{\ifdef{\RL}%
4520 {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}} 4520 {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\normalfont#1\egroup}}
4521 {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}} 4521 {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\normalfont\egroup}}}
4522% \end{macrocode} 4522% \end{macrocode}
4523% \end{macro} 4523% \end{macro}
4524% \begin{macro}{\MkArbBreak} 4524% \begin{macro}{\MkArbBreak}
@@ -4656,7 +4656,7 @@
4656% font may also be selected with the font-selecting commands of the 4656% font may also be selected with the font-selecting commands of the
4657% \package{fontspec} package. 4657% \package{fontspec} package.
4658% \begin{macrocode} 4658% \begin{macrocode}
4659\def\al@trans@font{\rmfamily}% 4659\def\al@trans@font{\normalfont}%
4660\NewDocumentCommand{\SetTranslitFont}{m}{\def\al@trans@font{#1}} 4660\NewDocumentCommand{\SetTranslitFont}{m}{\def\al@trans@font{#1}}
4661% \end{macrocode} 4661% \end{macrocode}
4662% \end{macro} 4662% \end{macro}
@@ -4671,10 +4671,11 @@
4671% \begin{macro}{\altrfont} 4671% \begin{macro}{\altrfont}
4672% \changes{v1.21}{2020/07/13}{new command \cs{altrfont} to store 4672% \changes{v1.21}{2020/07/13}{new command \cs{altrfont} to store
4673% font and shape information (trans mode)} Finally \cs{altrfont} 4673% font and shape information (trans mode)} Finally \cs{altrfont}
4674% is used internally by \package{arabluatex} to store the family and 4674% is used internally by \package{arabluatex} to store family and
4675% the shape of the font to be used for transliterated Arabic. 4675% shape information about the font to be used for transliterated
4676% Arabic.
4676% \begin{macrocode} 4677% \begin{macrocode}
4677\def\altrfont{\al@trans@font\al@trans@style } 4678\def\altrfont{\al@trans@font\al@trans@style}
4678% \end{macrocode} 4679% \end{macrocode}
4679% \end{macro} 4680% \end{macro}
4680% \begin{macro}{\SetTranslitConvention} 4681% \begin{macro}{\SetTranslitConvention}
@@ -4767,7 +4768,7 @@
4767 \ifvmode\leavevmode\fi% 4768 \ifvmode\leavevmode\fi%
4768 \bgroup\textdir TRT\arabicfont#1\egroup} 4769 \bgroup\textdir TRT\arabicfont#1\egroup}
4769\NewDocumentCommand{\txtrans}{+m}{% 4770\NewDocumentCommand{\txtrans}{+m}{%
4770 \bgroup\textdir TLT\al@trans@font\al@trans@style#1\egroup} 4771 \bgroup\textdir TLT\altrfont#1\egroup}
4771% \end{macrocode} 4772% \end{macrocode}
4772% \end{macro} 4773% \end{macro}
4773% \end{macro} 4774% \end{macro}
@@ -4791,7 +4792,7 @@
4791\NewDocumentEnvironment{txarabtr}{}{% 4792\NewDocumentEnvironment{txarabtr}{}{%
4792 \par% 4793 \par%
4793 \pardir TLT\textdir TLT% 4794 \pardir TLT\textdir TLT%
4794 \al@trans@font\al@trans@style}{\par} 4795 \altrfont}{\par}
4795% \end{macrocode} 4796% \end{macrocode}
4796% \end{environment} 4797% \end{environment}
4797% \begin{macro}{\arb} 4798% \begin{macro}{\arb}
@@ -4820,7 +4821,7 @@
4820 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% 4821 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
4821 \else% 4822 \else%
4822 \ifx\@tempa\al@mode@trans% 4823 \ifx\@tempa\al@mode@trans%
4823 \bgroup\textdir TLT\al@trans@font\al@trans@style% 4824 \bgroup\textdir TLT%
4824 \luadirect{tex.sprint(arabluatex.processtrans(\luastringN{#2}, 4825 \luadirect{tex.sprint(arabluatex.processtrans(\luastringN{#2},
4825 \luastringO{\al@trans@convention}, 4826 \luastringO{\al@trans@convention},
4826 \luastringO{\al@arb@rules}, 4827 \luastringO{\al@arb@rules},
@@ -4885,7 +4886,7 @@
4885 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% 4886 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
4886 \else% 4887 \else%
4887 \ifx\@tempa\al@mode@trans% 4888 \ifx\@tempa\al@mode@trans%
4888 \bgroup\pardir TLT\textdir TLT\al@trans@font\al@trans@style% 4889 \bgroup\pardir TLT\textdir TLT%
4889 \luadirect{tex.sprint(arabluatex.processtrans(\luastringN{#2}, 4890 \luadirect{tex.sprint(arabluatex.processtrans(\luastringN{#2},
4890 \luastringO{\al@trans@convention}, 4891 \luastringO{\al@trans@convention},
4891 \luastringO{\al@arb@rules}, 4892 \luastringO{\al@arb@rules},
diff --git a/arabluatex.lua b/arabluatex.lua
index 8897194..7372e86 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -532,8 +532,6 @@ local function novoceasy(str)
532 return str 532 return str
533end 533end
534 534
535local trfontinfo = "\\altrfont "
536
537local function transdmg(str, rules) 535local function transdmg(str, rules)
538 str = string.gsub(str, "\\arb(%b{})", function(inside) 536 str = string.gsub(str, "\\arb(%b{})", function(inside)
539 inside = string.sub(inside, 2, -2) 537 inside = string.sub(inside, 2, -2)
@@ -569,7 +567,7 @@ local function transdmg(str, rules)
569 for i = 1,#nulltr do 567 for i = 1,#nulltr do
570 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) 568 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b)
571 end 569 end
572 return string.format("{%s%s}", trfontinfo, inside) 570 return string.format("\\altrfont %s", inside)
573 end) 571 end)
574 return str 572 return str
575end 573end
@@ -607,7 +605,7 @@ local function transloc(str)
607 for i = 1,#nulltr do 605 for i = 1,#nulltr do
608 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) 606 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b)
609 end 607 end
610 return string.format("{%s%s}", trfontinfo, inside) 608 return string.format("\\altrfont %s", inside)
611 end) 609 end)
612 return str 610 return str
613end 611end
@@ -642,7 +640,7 @@ local function transarabica(str)
642 for i = 1,#nulltr do 640 for i = 1,#nulltr do
643 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) 641 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b)
644 end 642 end
645 return string.format("{%s%s}", trfontinfo, inside) 643 return string.format("\\altrfont %s", inside)
646 end) 644 end)
647 return str 645 return str
648end 646end
@@ -843,6 +841,7 @@ function arabluatex.closestream()
843 local o = io.open(tex.jobname..utffilesuffix..".tex", "w") 841 local o = io.open(tex.jobname..utffilesuffix..".tex", "w")
844 local t = f:read("*a") 842 local t = f:read("*a")
845 t = string.gsub(t, "\\arabicfont{}", "") 843 t = string.gsub(t, "\\arabicfont{}", "")
844 t = string.gsub(t, "\\altrfont%s+", "")
846 t = string.gsub(t, "\\par ", "\n\n") 845 t = string.gsub(t, "\\par ", "\n\n")
847 t = string.gsub(t, "(\\@al@ob)", "{") 846 t = string.gsub(t, "(\\@al@ob)", "{")
848 t = string.gsub(t, "(\\@al@cb@sp)", "} ") 847 t = string.gsub(t, "(\\@al@cb@sp)", "} ")