aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2016-02-26 18:52:27 +0100
committerRobert Alessi <alessi@robertalessi.net>2016-02-26 18:52:27 +0100
commit901e64d4e549f603cdc6e8cc642f1a4e5680251a (patch)
tree886ffe8fba6eecd871ad5600e563873ef3631543
parent029c8797e6e32adfcb79fc4c1f72377592c35f82 (diff)
downloadarabluatex-901e64d4e549f603cdc6e8cc642f1a4e5680251a.tar.gz
use \luastring(N/O){} so no need to robustify anymore
-rw-r--r--arabluatex.dtx36
1 files changed, 19 insertions, 17 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index c0e1163..9c2ac08 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -201,55 +201,57 @@
201 will try to load Amiri}% 201 will try to load Amiri}%
202\newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}% 202\newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}%
203\AtBeginDocument{\ifdef{\LR}% 203\AtBeginDocument{\ifdef{\LR}%
204 {\renewrobustcmd{\LR}[1]{\bgroup\textdir TLT\rmfamily#1\egroup}} 204 {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}
205 {\newrobustcmd{\LR}[1]{\bgroup\textdir TLT\rmfamily#1\egroup}}} 205 {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}}
206\AtBeginDocument{\ifdef{\RL}% 206\AtBeginDocument{\ifdef{\RL}%
207 {\renewrobustcmd{\RL}[1]{\bgroup\textdir TRT\rmfamily#1\egroup}} 207 {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}}
208 {\newrobustcmd{\RL}[1]{\bgroup\textdir TRT#1\rmfamily\egroup}}} 208 {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}}
209\AtBeginDocument{\ifdef{\aemph}%
210 {\RenewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}
211 {\NewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}}
209\DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir TRT\arabicfont#1\egroup} 212\DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir TRT\arabicfont#1\egroup}
210\DeclareDocumentCommand{\arb}{O{\al@mode} +m}% 213\DeclareDocumentCommand{\arb}{O{\al@mode} +m}%
211{\edef\@tempa{#1}% 214{\edef\@tempa{#1}%
212 \ifx\@tempa\al@mode@voc% 215 \ifx\@tempa\al@mode@voc%
213 \bgroup\textdir TRT\arabicfont% 216 \bgroup\textdir TRT\arabicfont%
214 \luadirect{tex.sprint(processvoc("\luaescapestring{#2}"))}\egroup% 217 \luadirect{tex.sprint(processvoc(\luastringN{#2}))}\egroup%
215 \else% 218 \else%
216 \ifx\@tempa\al@mode@fullvoc% 219 \ifx\@tempa\al@mode@fullvoc%
217 \bgroup\textdir TRT\arabicfont% 220 \bgroup\textdir TRT\arabicfont%
218 \luadirect{tex.sprint(processfullvoc("\luaescapestring{#2}"))}\egroup% 221 \luadirect{tex.sprint(processfullvoc(\luastringN{#2}))}\egroup%
219 \else% 222 \else%
220 \ifx\@tempa\al@mode@novoc% 223 \ifx\@tempa\al@mode@novoc%
221 \bgroup\textdir TRT\arabicfont% 224 \bgroup\textdir TRT\arabicfont%
222 \luadirect{tex.sprint(processnovoc("\luaescapestring{#2}"))}\egroup% 225 \luadirect{tex.sprint(processnovoc(\luastringN{#2}))}\egroup%
223 \else% 226 \else%
224 \fi\fi\fi} 227 \fi\fi\fi}
225\DeclareDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}
226\NewEnviron{arab}[1][\al@mode]% 228\NewEnviron{arab}[1][\al@mode]%
227{\par\edef\@tempa{#1}% 229{\par\edef\@tempa{#1}%
228 \ifx\@tempa\al@mode@voc% 230 \ifx\@tempa\al@mode@voc%
229 \bgroup\pardir TRT\textdir TRT\arabicfont% 231 \bgroup\pardir TRT\textdir TRT\arabicfont%
230 \luadirect{tex.sprint(processvoc("\luaescapestring{\BODY}"))}\egroup% 232 \luadirect{tex.sprint(processvoc(\luastringO{\BODY}))}\egroup%
231 \else% 233 \else%
232 \ifx\@tempa\al@mode@fullvoc% 234 \ifx\@tempa\al@mode@fullvoc%
233 \bgroup\pardir TRT\textdir TRT\arabicfont% 235 \bgroup\pardir TRT\textdir TRT\arabicfont%
234 \luadirect{tex.sprint(processfullvoc("\luaescapestring{\BODY}"))}\egroup% 236 \luadirect{tex.sprint(processfullvoc(\luastringO{\BODY}))}\egroup%
235 \else% 237 \else%
236 \ifx\@tempa\al@mode@novoc% 238 \ifx\@tempa\al@mode@novoc%
237 \bgroup\pardir TRT\textdir TRT\arabicfont% 239 \bgroup\pardir TRT\textdir TRT\arabicfont%
238 \luadirect{tex.sprint(processnovoc("\luaescapestring{\BODY}"))}\egroup% 240 \luadirect{tex.sprint(processnovoc(\luastringO{\BODY}))}\egroup%
239 \else 241 \else
240 \BODY% 242 \BODY%
241 \fi\fi\fi}[\par] 243 \fi\fi\fi}[\par]
242\robustify{\textbf} 244% \robustify{\textbf}
243\robustify{\emph} 245% \robustify{\emph}
244\robustify{\footnote} 246% \robustify{\footnote}
245\robustify{\marginpar} 247% \robustify{\marginpar}
246\DeclareDocumentCommand{\Marginpar}{m}{\marginpar{\textdir TLT #1}} 248\DeclareDocumentCommand{\Marginpar}{m}{\marginpar{\textdir TLT #1}}
247\RenewDocumentCommand{\thefootnote}{}{\bgroup\textdir 249\RenewDocumentCommand{\thefootnote}{}{\bgroup\textdir
248 TLT\arabic{footnote}\egroup} 250 TLT\arabic{footnote}\egroup}
249\DeclareDocumentCommand{\LRfootnote}{m}{\bgroup\pardir 251\DeclareDocumentCommand{\LRfootnote}{m}{\bgroup\pardir
250 TLT\LR{\footnote{#1}}\egroup} 252 TLT\LR{\footnote{#1}}\egroup}
251\AtBeginDocument{\ifdef{\abjad}{\robustify{\abjad}}{}} 253% \AtBeginDocument{\ifdef{\abjad}{\robustify{\abjad}}{}}
252\AtBeginDocument{\ifdef{\Footnote}{\robustify{\Footnote}}{}} 254% \AtBeginDocument{\ifdef{\Footnote}{\robustify{\Footnote}}{}}
253\endinput 255\endinput
254% \end{macrocode} 256% \end{macrocode}
255 257