aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx16
-rw-r--r--arabluatex.ins5
-rw-r--r--arabluatex.lua13
3 files changed, 32 insertions, 2 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 1391460..74474b8 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -198,7 +198,7 @@
198%</driver> 198%</driver>
199% \fi 199% \fi
200% 200%
201% \CheckSum{379} 201% \CheckSum{0}
202% 202%
203% \CharacterTable 203% \CharacterTable
204% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z 204% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -2747,5 +2747,19 @@ wa-ya.sIru ta.hta 'l-jild-i
2747%</package> 2747%</package>
2748% \fi 2748% \fi
2749% 2749%
2750% \iffalse
2751%<*patch>
2752% \fi
2753%
2754% \begin{macrocode}
2755\NeedsTeXFormat{LaTeX2e}
2756\ProvidesPackage{arabluatex-patch}%
2757[2016/11/13 v1.0 arabluatex patches]
2758% \end{macrocode}
2759%
2760% \iffalse
2761%</patch>
2762% \fi
2763%
2750% \Finale 2764% \Finale
2751\endinput 2765\endinput
diff --git a/arabluatex.ins b/arabluatex.ins
index 69d9f53..df4c625 100644
--- a/arabluatex.ins
+++ b/arabluatex.ins
@@ -73,7 +73,10 @@ This release of 'arabluatex' consists of the following source files:
73 73
74\endpreamble 74\endpreamble
75 75
76\generate{\file{arabluatex.sty}{\from{arabluatex.dtx}{package}}} 76\generate{%
77 \file{arabluatex.sty}{\from{arabluatex.dtx}{package}}
78 \file{arabluatex-patch.sty}{\from{arabluatex.dtx}{patch}}
79 }
77 80
78\Msg{***********************************************************} 81\Msg{***********************************************************}
79\Msg{*} 82\Msg{*}
diff --git a/arabluatex.lua b/arabluatex.lua
index 956f796..6e5b042 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -29,6 +29,9 @@ require("arabluatex_trans")
29 29
30local function protectarb(str) 30local function protectarb(str)
31 str = string.gsub(str, "(\\arb.?)(%[.-%])(%b{})", "\\@arb%2%3") 31 str = string.gsub(str, "(\\arb.?)(%[.-%])(%b{})", "\\@arb%2%3")
32 str = string.gsub(str, "(\\begin.?)(%b{})(%b[])", "\\@begin%3%2")
33 str = string.gsub(str, "(\\begin.?)(%b{})", "\\@begin%2")
34 str = string.gsub(str, "(\\end.?)(%b{})", "\\@end%2")
32 str = string.gsub(str, "\\par", "\\p@r{}") 35 str = string.gsub(str, "\\par", "\\p@r{}")
33 str = string.gsub(str, "\\@@par", "\\p@r{}") 36 str = string.gsub(str, "\\@@par", "\\p@r{}")
34return str 37return str
@@ -36,11 +39,21 @@ end
36 39
37local function unprotectarb(str) 40local function unprotectarb(str)
38 str = string.gsub(str, "(\\@arb)(%[.-%])(%b{})", "\\arb%2%3") 41 str = string.gsub(str, "(\\@arb)(%[.-%])(%b{})", "\\arb%2%3")
42 str = string.gsub(str, "(\\@begin)(%b[])(%b{})", "\\begin%3%2")
43 str = string.gsub(str, "(\\@begin)(%b{})", "\\begin%2")
44 str = string.gsub(str, "(\\@end)(%b{})", "\\end%2")
39 str = string.gsub(str, "\\p@r{}", "\\par") 45 str = string.gsub(str, "\\p@r{}", "\\par")
40return str 46return str
41end 47end
42 48
43local function breakcmd(str) 49local function breakcmd(str)
50 -- handle \item[], then \item[]
51 str = string.gsub(str, "\\(item.?)(%b[])",
52 function(tag, body)
53 body = string.sub(body, 2, -2)
54 return string.format("}\\item[\\arb{%s}] \\arb{", body)
55 end)
56 str = string.gsub(str, "(\\item)(%s+)", "%1{}%2")
44 -- \edtext 57 -- \edtext
45 str = string.gsub(str, "\\(edtext.-)(%b{})(%b{})", 58 str = string.gsub(str, "\\(edtext.-)(%b{})(%b{})",
46 function(tag, bodylem, bodyvar) 59 function(tag, bodylem, bodyvar)