From f25eea6af4f41ef7529e1488d2c2e6777f1dca7a Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Mon, 13 Jul 2020 19:59:40 +0200 Subject: =?UTF-8?q?\rmfamily=20=E2=86=92=20\normalfont.=20append=20informa?= =?UTF-8?q?tion=20collected=20by=20[98bc539]=20in=20footnotes,=20apparatus?= =?UTF-8?q?=20criticus=20and=20the=20like.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arabluatex.dtx | 25 +++++++++++++------------ arabluatex.lua | 9 ++++----- 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 @@ % it to suit our purpose: % \begin{macrocode} \AtBeginDocument{\ifdef{\LR}% - {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}} - {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}} + {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\normalfont#1\egroup}} + {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\normalfont#1\egroup}}} % \end{macrocode} % \end{macro} % \begin{macro}{\RL} This one typesets its argument from right to % left. Same remark as above regarding the need of redefinition. % \begin{macrocode} \AtBeginDocument{\ifdef{\RL}% - {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}} - {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}} + {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\normalfont#1\egroup}} + {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\normalfont\egroup}}} % \end{macrocode} % \end{macro} % \begin{macro}{\MkArbBreak} @@ -4656,7 +4656,7 @@ % font may also be selected with the font-selecting commands of the % \package{fontspec} package. % \begin{macrocode} -\def\al@trans@font{\rmfamily}% +\def\al@trans@font{\normalfont}% \NewDocumentCommand{\SetTranslitFont}{m}{\def\al@trans@font{#1}} % \end{macrocode} % \end{macro} @@ -4671,10 +4671,11 @@ % \begin{macro}{\altrfont} % \changes{v1.21}{2020/07/13}{new command \cs{altrfont} to store % font and shape information (trans mode)} Finally \cs{altrfont} -% is used internally by \package{arabluatex} to store the family and -% the shape of the font to be used for transliterated Arabic. +% is used internally by \package{arabluatex} to store family and +% shape information about the font to be used for transliterated +% Arabic. % \begin{macrocode} -\def\altrfont{\al@trans@font\al@trans@style } +\def\altrfont{\al@trans@font\al@trans@style} % \end{macrocode} % \end{macro} % \begin{macro}{\SetTranslitConvention} @@ -4767,7 +4768,7 @@ \ifvmode\leavevmode\fi% \bgroup\textdir TRT\arabicfont#1\egroup} \NewDocumentCommand{\txtrans}{+m}{% - \bgroup\textdir TLT\al@trans@font\al@trans@style#1\egroup} + \bgroup\textdir TLT\altrfont#1\egroup} % \end{macrocode} % \end{macro} % \end{macro} @@ -4791,7 +4792,7 @@ \NewDocumentEnvironment{txarabtr}{}{% \par% \pardir TLT\textdir TLT% - \al@trans@font\al@trans@style}{\par} + \altrfont}{\par} % \end{macrocode} % \end{environment} % \begin{macro}{\arb} @@ -4820,7 +4821,7 @@ \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% \else% \ifx\@tempa\al@mode@trans% - \bgroup\textdir TLT\al@trans@font\al@trans@style% + \bgroup\textdir TLT% \luadirect{tex.sprint(arabluatex.processtrans(\luastringN{#2}, \luastringO{\al@trans@convention}, \luastringO{\al@arb@rules}, @@ -4885,7 +4886,7 @@ \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% \else% \ifx\@tempa\al@mode@trans% - \bgroup\pardir TLT\textdir TLT\al@trans@font\al@trans@style% + \bgroup\pardir TLT\textdir TLT% \luadirect{tex.sprint(arabluatex.processtrans(\luastringN{#2}, \luastringO{\al@trans@convention}, \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) return str end -local trfontinfo = "\\altrfont " - local function transdmg(str, rules) str = string.gsub(str, "\\arb(%b{})", function(inside) inside = string.sub(inside, 2, -2) @@ -569,7 +567,7 @@ local function transdmg(str, rules) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("{%s%s}", trfontinfo, inside) + return string.format("\\altrfont %s", inside) end) return str end @@ -607,7 +605,7 @@ local function transloc(str) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("{%s%s}", trfontinfo, inside) + return string.format("\\altrfont %s", inside) end) return str end @@ -642,7 +640,7 @@ local function transarabica(str) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("{%s%s}", trfontinfo, inside) + return string.format("\\altrfont %s", inside) end) return str end @@ -843,6 +841,7 @@ function arabluatex.closestream() local o = io.open(tex.jobname..utffilesuffix..".tex", "w") local t = f:read("*a") t = string.gsub(t, "\\arabicfont{}", "") + t = string.gsub(t, "\\altrfont%s+", "") t = string.gsub(t, "\\par ", "\n\n") t = string.gsub(t, "(\\@al@ob)", "{") t = string.gsub(t, "(\\@al@cb@sp)", "} ") -- cgit v1.2.3