diff options
author | Robert Alessi <alessi@robertalessi.net> | 2018-08-24 09:41:39 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2018-08-24 09:41:39 +0200 |
commit | 0e618d97132539f0263d3c7183eabeb4f5824658 (patch) | |
tree | 9c1d0398ebd407c8b71c1e3f6043320e46a558f3 | |
parent | e6046846f9d7564b490a4a1013d5e66253f512b8 (diff) | |
download | arabluatex-0e618d97132539f0263d3c7183eabeb4f5824658.tar.gz |
al_closestream() gobbled spaces after opening braces. also removed nested \txarb
-rw-r--r-- | arabluatex.dtx | 11 | ||||
-rw-r--r-- | arabluatex.lua | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx index a45b3bd..aa46115 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx | |||
@@ -4392,11 +4392,12 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
4392 | % \end{macrocode} | 4392 | % \end{macrocode} |
4393 | % \end{macro} | 4393 | % \end{macro} |
4394 | % \begin{macro}{\arbmark} | 4394 | % \begin{macro}{\arbmark} |
4395 | % \changes{v1.11}{2018/03/31}{New command for inserting additional | 4395 | % \changes{v1.11}{2018/03/31}{New command for inserting additional |
4396 | % marks in Arabic environments} \cs{arbmark} takes one argument from a | 4396 | % marks in Arabic environments} \cs{arbmark} takes one argument from |
4397 | % list of defined elements. This command is coded in | 4397 | % a list of defined elements. \changes{v1.13}{2018/08/23}{New |
4398 | % Lua. \changes{v1.13}{2018/08/23}{New optional argument: either | 4398 | % optional argument: either \texttt{rl} or \texttt{lr}} The mark to |
4399 | % \texttt{rl} or \texttt{lr}} | 4399 | % be inserted is determined by contextual analysis or by an |
4400 | % optional argument, either |rl| or |lr|. This command is coded in Lua. | ||
4400 | % \begin{macrocode} | 4401 | % \begin{macrocode} |
4401 | \NewDocumentCommand{\arbmark}{O{} m}{% | 4402 | \NewDocumentCommand{\arbmark}{O{} m}{% |
4402 | \bgroup% | 4403 | \bgroup% |
diff --git a/arabluatex.lua b/arabluatex.lua index 8bb9572..f717cb4 100644 --- a/arabluatex.lua +++ b/arabluatex.lua | |||
@@ -805,7 +805,7 @@ function al_closestream() | |||
805 | local t = f:read("*a") | 805 | local t = f:read("*a") |
806 | t = string.gsub(t, "\\arabicfont{}", "") | 806 | t = string.gsub(t, "\\arabicfont{}", "") |
807 | t = string.gsub(t, "\\par ", "\n\n") | 807 | t = string.gsub(t, "\\par ", "\n\n") |
808 | t = string.gsub(t, "(\\@al@ob%s?)", "{") | 808 | t = string.gsub(t, "(\\@al@ob)", "{") |
809 | t = string.gsub(t, "(\\@al@cb@sp)", "} ") | 809 | t = string.gsub(t, "(\\@al@cb@sp)", "} ") |
810 | t = string.gsub(t, "(\\@al@cb)(%s?)", "}") | 810 | t = string.gsub(t, "(\\@al@cb)(%s?)", "}") |
811 | t = gsub(t, lpeg.Cs("\\begin") * spcenc^-1 * bcbraces * cmdargs, "\n%1%2%3\n") | 811 | t = gsub(t, lpeg.Cs("\\begin") * spcenc^-1 * bcbraces * cmdargs, "\n%1%2%3\n") |
@@ -817,6 +817,7 @@ function al_closestream() | |||
817 | t = string.gsub(t, "(\\end%s?)(%b{})", "%1%2\n") | 817 | t = string.gsub(t, "(\\end%s?)(%b{})", "%1%2\n") |
818 | t = string.gsub(t, "([^\n]%s-)(\\end)%s?(%b{})", "%1\n%2%3") | 818 | t = string.gsub(t, "([^\n]%s-)(\\end)%s?(%b{})", "%1\n%2%3") |
819 | t = string.gsub(t, "\n\n\n", "\n\n") | 819 | t = string.gsub(t, "\n\n\n", "\n\n") |
820 | t = string.gsub(t, "(\\txarb%s?%{)(\\txarb%s?%b{})(%})", "%2") | ||
820 | if string.find(t, "\\begin%s?{document}.-\\arb%s?[%[%{]") or | 821 | if string.find(t, "\\begin%s?{document}.-\\arb%s?[%[%{]") or |
821 | string.find(t, "\\begin%s?{document}.-\\[Uu]c%s?%b{}") | 822 | string.find(t, "\\begin%s?{document}.-\\[Uu]c%s?%b{}") |
822 | then | 823 | then |