diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-22 20:50:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-22 20:50:44 +0000 |
commit | 289b0e55a8c83fea60e41a525039ffb52c7447a4 (patch) | |
tree | b8ed9422a88482dd6b9eb82f016909eb02df8732 /Master/texmf-dist/tex/lualatex | |
parent | e78816c4002b589db4bda4039c0c99f4f76af5d9 (diff) |
arabluatex (22mar19)
git-svn-id: svn://tug.org/texlive/trunk@50537 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex')
7 files changed, 63 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty index 2491d3409f4..46e14946260 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty @@ -11,7 +11,7 @@ %% This file is part of the `arabluatex' package %% %% ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX -%% Copyright (C) 2016--2018 Robert Alessi +%% Copyright (C) 2016--2019 Robert Alessi %% %% Please send error reports and suggestions for improvements to Robert %% Alessi <alessi@robertalessi.net> diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua index 09c1acb9ba7..9d8343810f6 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua @@ -2,7 +2,7 @@ This file is part of the `arabluatex' package ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX -Copyright (C) 2016--2018 Robert Alessi +Copyright (C) 2016--2019 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi <alessi@robertalessi.net> @@ -49,6 +49,8 @@ local cmdstar = lpeg.Cs(spce * lpeg.P("*")) local bsqbracketsii = lpeg.Cs(bsqbrackets^-2) local bcbracesii = lpeg.Cs(bcbraces^-2) local cmd = lpeg.Cs(dblbkslash * ascii^1 * cmdstar^-1) +local rawcmd = lpeg.Cs(dblbkslash * ascii^1) +local aftercmd = lpeg.Cs(lpeg.S("*[{,.?;:'`\"") + dblbkslash) local cmdargs = lpeg.Cs(spce^-1 * bsqbracketsii * bcbracesii * bsqbrackets^-1) local arbargs = lpeg.Cs(spce^-1 * bsqbrackets^-1 * bcbraces) local baytargs = lpeg.Cs(spce * bcbraces * bsqbrackets^-1 * bcbraces) @@ -228,10 +230,11 @@ local function takeoutcapetc(str) body = string.sub(body, 2, -2) return string.format("%s", body) end) - str = string.gsub(str, "(\\uc.?)(%b{})", function(tag, body) + str = string.gsub(str, "(\\uc%s?)(%b{})", function(tag, body) body = string.sub(body, 2, -2) return string.format("%s", body) end) + str = string.gsub(str, "\\uc%s", "") str = string.gsub(str, "\\linebreak", "") str = string.gsub(str, "\\%-", "") return str @@ -487,7 +490,7 @@ local function novoc(str) inside = indnum(inside) return string.format("\\arabicfont{}%s", inside) end) -return str + return str end local function novoceasy(str) @@ -523,7 +526,7 @@ local function novoceasy(str) inside = indnum(inside) return string.format("\\arabicfont{}%s", inside) end) -return str + return str end local function transdmg(str, rules) @@ -561,9 +564,9 @@ local function transdmg(str, rules) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("\\txtrans{%s}", inside) + return string.format("%s", inside) end) -return str + return str end local function transloc(str) @@ -599,9 +602,9 @@ local function transloc(str) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("\\txtrans{%s}", inside) + return string.format("%s", inside) end) -return str + return str end local function transarabica(str) @@ -634,9 +637,9 @@ local function transarabica(str) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("\\txtrans{%s}", inside) + return string.format("%s", inside) end) -return str + return str end local function processbuckw(str) @@ -647,7 +650,7 @@ local function processbuckw(str) end return string.format("\\arb{%s}", inside) end) -return str + return str end -- The following functions produce a copy of the original .tex source @@ -704,7 +707,7 @@ local function processarbtoutf(str) bbody = string.sub(bbody, 2, -2) if tonumber(bbody) ~= nil then bbody = abjadify(bbody) - return string.format("\\aemph{\\arb[novoc]{%s}}", bbody) + return string.format("\\oline*{\\arb[novoc]{%s}}", bbody) else return string.format("%s{%s}", btag, bbody) end @@ -869,6 +872,7 @@ function al_closestream() [[ and compile it one more time}}]]) -- else end + t = gsub(t, rawcmd * spce^1 * aftercmd, "%1%3") t = t.."\n\\end{document}" io.write(t) o:write(t) @@ -985,10 +989,10 @@ function processtrans(str, mode, rules, scheme) end str = unprotectarb(str) if export_utf == "yes" then - tofile = str + tofile = "\\txtrans{"..str.."}" tooutfile(tofile) elseif export_utf == "arabverse" then - tofile = str + tofile = "\\txtrans{"..str.."}" tooutfile(tofile) else return str @@ -1053,6 +1057,9 @@ function uc(str) body = string.sub(body, 2, -2) return string.format("%s", body) end) + str = string.gsub(str, "{", "\\@al@ob") + str = string.gsub(str, "} ", "\\@al@cb@sp ") + str = string.gsub(str, "}", "\\@al@cb") -- Allah and ibn str = string.gsub(str, "(al%-lāh)([uai]?)", "{Allāh%2}") str = string.gsub(str, "([%'%-]?)(l%-lāh)([uai]?)", "%1{Llāh%3}") @@ -1099,14 +1106,19 @@ function uc(str) for i = 1,#lcuc do str = string.gsub(str, "(%s[%(%<%[]?)"..lcuc[i].a, "%1"..lcuc[i].b) end + str = string.gsub(str, "{", "") + str = string.gsub(str, "}", "") + str = string.gsub(str, "\\@al@ob", "{") + str = string.gsub(str, "\\@al@cb@sp ", "} ") + str = string.gsub(str, "\\@al@cb", "}") if export_utf == "yes" then - tofile = "\\txtrans{"..str.."}" + tofile = str tooutfile(tofile) elseif export_utf == "arabverse" then - tofile = "\\txtrans{"..str.."}" + tofile = str tooutfile(tofile) else - return "\\txtrans{"..str.."}" + return str end return "" end @@ -1148,12 +1160,12 @@ end function aemph(str, opt) if tex.textdir == "TRT" then - str = "$\\overline{\\text{\\textdir TRT{}"..str.."}}$" + str = "\\oline{\\textdir TRT{}"..str.."}" elseif tex.textdir == "TLT" then if opt == "over" then - str = "$\\overline{\\text{"..str.."}}$" + str = "\\oline{"..str.."}" else - str = "$\\underline{\\text{"..str.."}}$" + str = "\\uline{"..str.."}" end end return str diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty index 533057b63a3..ebe1ff2a831 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty @@ -11,7 +11,7 @@ %% This file is part of the `arabluatex' package %% %% ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX -%% Copyright (C) 2016--2018 Robert Alessi +%% Copyright (C) 2016--2019 Robert Alessi %% %% Please send error reports and suggestions for improvements to Robert %% Alessi <alessi@robertalessi.net> @@ -39,9 +39,9 @@ %% - arabluatex_novoc.lua %% - arabluatex_trans.lua %% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{arabluatex}% -[2018/10/11 v1.15.1 An ArabTeX-like interface for LuaLaTeX] +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{arabluatex} + [2019/03/22 v1.16 An ArabTeX-like interface for LuaLaTeX] \RequirePackage{ifluatex} \ifluatex\else \PackageError{arabluatex}{lualatex needed}{% @@ -72,13 +72,14 @@ \RequirePackage{etoolbox} \RequirePackage{arabluatex-patch} \RequirePackage{fontspec} -\RequirePackage{amsmath} \RequirePackage{luacode} \RequirePackage{xparse} \RequirePackage{environ} \RequirePackage{adjustbox} \RequirePackage{xstring} -\newbool{al@rlmode} +\PassOptionsToPackage{normalem}{ulem} +\RequirePackage{ulem} +\providebool{al@rlmode} \luadirect{dofile(kpse.find_file("arabluatex.lua"))} \AtBeginDocument{\ifdefined\arabicfont\relax\else \PackageWarning{arabluatex}{\string\arabicfont\ is not defined.^^J @@ -97,6 +98,9 @@ {\luadirect{mkarbbreak(\luastringN{#2}, "out")}} {\luadirect{mkarbbreak(\luastringN{#2}, "dflt")}} } +\def\oline{\@ifstar\@oline\@@oline} +\def\@oline#1{\ensuremath{\overline{\mbox{#1}}}} +\def\@@oline{\bgroup \ULdepth=-3ex \ULset} \AtBeginDocument{\ifdef{\aemph}% {\RenewDocumentCommand{\aemph}{s m}{% \IfBooleanTF{#1}{% @@ -163,7 +167,7 @@ \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% \else% \ifx\@tempa\al@mode@trans% - \bgroup\textdir TLT\al@trans@style% + \bgroup\textdir TLT\al@trans@font\al@trans@style% \luadirect{tex.sprint(processtrans(\luastringN{#2}, \luastringO{\al@trans@convention}, \luastringO{\al@arb@rules}, @@ -199,7 +203,7 @@ \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% \else% \ifx\@tempa\al@mode@trans% - \bgroup\pardir TLT\textdir TLT\al@trans@style% + \bgroup\pardir TLT\textdir TLT\al@trans@font\al@trans@style% \luadirect{tex.sprint(processtrans(\luastringO{\BODY}, \luastringO{\al@trans@convention}, \luastringO{\al@arb@rules}, @@ -225,18 +229,23 @@ metre]{#1}% \if@pkg@export\ifal@verse@export% \ArbOutFile{\begin{arabverse}}% - \ifx\al@mode\al@mode@trans% - \luadirect{tooutfile(\luastringN{[#1]})}% - \else% + % \ifx\al@mode\al@mode@trans% + % \luadirect{tooutfile(\luastringN{[#1]})}% + % \else% \IfSubStr[1]{#1}{utf}% {\luadirect{tooutfile(\luastringN{[#1]})}}% {\luadirect{tooutfile(\luastringN{[#1, utf]})}}% - \fi + % \fi \else\fi\else\fi\egroup% \par\centering\noindent\bgroup\setkeys[al]{verse}[metre]{#1}% - \ifx\al@mode\al@mode@trans% - \ifal@verse@utf\setRL\else\setLR\fi% - \else\setRL\fi% + % \ifx\al@mode\al@mode@trans% + % \ifal@verse@utf\setRL\else\setLR\fi% + % \else\setRL\fi% + \ifal@verse@utf% + \ifx\al@mode\al@mode@trans\setLR\else\setRL\fi% + \else% + \ifx\al@mode\al@mode@trans\setLR\else\setRL\fi% + \fi% \arab@v@export{#1} }% {\endarab@v@export @@ -255,8 +264,6 @@ \def\al@verse@stroke{\leavevmode\xleaders\hbox{\arb{--}}\hfill\kern0pt} \NewDocumentCommand{\bayt}{s m o m}{% \IfBooleanTF{#1}{\relax}{\relax}% - {^^^^200b}% quick fix to a bug (or a missing feature) in either - % luacolor or adjustbox \ifdefined\savenotes\savenotes\else\fi% \edef\al@tatweel{--}% \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#2}}% @@ -286,12 +293,12 @@ \ifdefined\abjad% \RenewDocumentCommand{\abjad}{m}% {\ifbool{al@rlmode}% - {\aemph{\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} + {\oline*{\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} \else% \NewDocumentCommand{\abjad}{m}% {\ifbool{al@rlmode}% - {\aemph{\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} + {\oline*{\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} \fi} \NewDocumentCommand{\ayah}{m}{% diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua index 8d2615e308a..f524c3b6d96 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua @@ -2,7 +2,7 @@ This file is part of the `arabluatex' package ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX -Copyright (C) 2016--2018 Robert Alessi +Copyright (C) 2016--2019 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi <alessi@robertalessi.net> diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua index 774b8b3d7c6..51418617b7d 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua @@ -2,7 +2,7 @@ This file is part of the `arabluatex' package ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX -Copyright (C) 2016--2018 Robert Alessi +Copyright (C) 2016--2019 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi <alessi@robertalessi.net> diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua index 775e8207ecf..63a19563450 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua @@ -2,7 +2,7 @@ This file is part of the `arabluatex' package ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX -Copyright (C) 2016--2018 Robert Alessi +Copyright (C) 2016--2019 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi <alessi@robertalessi.net> diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua index c70e0557a0d..54c324c428b 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua @@ -2,7 +2,7 @@ This file is part of the `arabluatex' package ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX -Copyright (C) 2016--2018 Robert Alessi +Copyright (C) 2016--2019 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi <alessi@robertalessi.net> |