aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2017-04-02 11:13:12 +0200
committerRobert Alessi <alessi@robertalessi.net>2017-04-02 11:13:12 +0200
commit5fbee7b562274cee955d2b8ba47fc84d04449059 (patch)
treec789d9db79473ce91074fcea2a0ba9b9ee1e7a8c
parentf46c9c50cca7fc2f46c799a4fff3a271992c894d (diff)
downloadarabluatex-5fbee7b562274cee955d2b8ba47fc84d04449059.tar.gz
new \Cap command that does the same as \cap but is never discarded; it is used internally to protect \cap when it is necessary
-rw-r--r--arabluatex.dtx9
-rw-r--r--arabluatex.lua5
-rw-r--r--makefile2
3 files changed, 14 insertions, 2 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index cd4e0c6..83ce9f1 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -217,7 +217,7 @@
217%</driver> 217%</driver>
218% \fi 218% \fi
219% 219%
220% \CheckSum{697} 220% \CheckSum{0}
221% 221%
222% \CharacterTable 222% \CharacterTable
223% {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 223% {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
@@ -3297,6 +3297,13 @@ wa-ya.sIru ta.hta 'l-jild-i
3297\DeclareDocumentCommand{\cap}{m}% 3297\DeclareDocumentCommand{\cap}{m}%
3298 {\luadirect{tex.sprint(cap(\luastringN{#1}))}} 3298 {\luadirect{tex.sprint(cap(\luastringN{#1}))}}
3299% \end{macrocode} 3299% \end{macrocode}
3300% \begin{macro}{\Cap} \changes{v1.8.2}{2017/04/02}{New \cs{Cap} macro:
3301% does the same as \cs{cap}, but not to be used outside \texttt{trans}
3302% mode.}
3303% \begin{macrocode}
3304\let\Cap\cap
3305% \end{macrocode}
3306% \end{macro}
3300% \end{macro} 3307% \end{macro}
3301% \begin{macro}{\txarb} \cs{txarb} sets the direction to right-to-left 3308% \begin{macro}{\txarb} \cs{txarb} sets the direction to right-to-left
3302% and selects the Arabic font. It is used internally by several Lua 3309% and selects the Arabic font. It is used internally by several Lua
diff --git a/arabluatex.lua b/arabluatex.lua
index c71fe10..8644588 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -157,6 +157,11 @@ local function takeoutabjad(str)
157end 157end
158 158
159local function takeoutcapetc(str) 159local function takeoutcapetc(str)
160 str = string.gsub(str, "(\\arb.?%[trans%])(%b{})", function(tag, body)
161 body = string.sub(body, 2, -2)
162 body = string.gsub(body, "(\\cap%s?)(%b{})", "\\Cap%2")
163 return string.format("%s{%s}", tag, body)
164 end)
160 str = string.gsub(str, "(\\cap.?)(%b{})", function(tag, body) 165 str = string.gsub(str, "(\\cap.?)(%b{})", function(tag, body)
161 body = string.sub(body, 2, -2) 166 body = string.sub(body, 2, -2)
162 return string.format("%s", body) 167 return string.format("%s", body)
diff --git a/makefile b/makefile
index 72f9c8f..4f1dac1 100644
--- a/makefile
+++ b/makefile
@@ -45,7 +45,7 @@ package: clean all
45clean: 45clean:
46 rm -rf ~/texmf/tex/lualatex/arabluatex/ 46 rm -rf ~/texmf/tex/lualatex/arabluatex/
47 rm -rf ~/.emacs.d/auctex/auto/arabluatex*.el 47 rm -rf ~/.emacs.d/auctex/auto/arabluatex*.el
48 rm -rf tex/ doc/ source/ 48 rm -rf tex/ doc/ source/ auto/
49 rm -rf arabluatex/ 49 rm -rf arabluatex/
50 rm -rf saved/ 50 rm -rf saved/
51 mkdir saved 51 mkdir saved