diff options
author | Robert Alessi <alessi@robertalessi.net> | 2016-11-12 14:55:30 +0100 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2016-11-12 14:55:30 +0100 |
commit | 55c7d8a9ced9c5c6edf4e69ef145ae5c65c8e2e1 (patch) | |
tree | 43563b2ea186afa610567eb480eeb17c43f6fb22 | |
parent | c90674529bf3cd4f9cc645f3a1dbc5f7b90bc87b (diff) | |
download | arabluatex-55c7d8a9ced9c5c6edf4e69ef145ae5c65c8e2e1.tar.gz |
arabluatex.ins now generates arabluatex-patch.sty which will receive code from other sources that has to be modified temporarily
-rw-r--r-- | arabluatex.dtx | 16 | ||||
-rw-r--r-- | arabluatex.ins | 5 | ||||
-rw-r--r-- | arabluatex.lua | 13 |
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 | ||
30 | local function protectarb(str) | 30 | local 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{}") |
34 | return str | 37 | return str |
@@ -36,11 +39,21 @@ end | |||
36 | 39 | ||
37 | local function unprotectarb(str) | 40 | local 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") |
40 | return str | 46 | return str |
41 | end | 47 | end |
42 | 48 | ||
43 | local function breakcmd(str) | 49 | local 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) |