From a7c56014bf947d27d06248c9a15a5563254d8bb5 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Fri, 13 Sep 2019 14:31:14 +0200
Subject: \arb and \txarb needed \leavevmode at the very start of a paragraph

---
 arabluatex.dtx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index ed3e6c9..71dfd1d 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -4615,6 +4615,7 @@
 % not documented.
 %    \begin{macrocode}
 \NewDocumentCommand{\txarb}{+m}{%
+  \ifvmode\leavevmode\fi%
   \bgroup\textdir TRT\arabicfont#1\egroup}
 \NewDocumentCommand{\txtrans}{+m}{%
   \bgroup\textdir TLT\al@trans@font\al@trans@style#1\egroup}
@@ -4652,16 +4653,19 @@
 \NewDocumentCommand{\arb}{O{\al@mode} +m}%
 {\edef\@tempa{#1}%
   \ifx\@tempa\al@mode@voc%
+  \ifvmode\leavevmode\fi%
   \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont%
   \luadirect{tex.sprint(arabluatex.processvoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al@mode@fullvoc%
+  \ifvmode\leavevmode\fi%
   \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont%
   \luadirect{tex.sprint(arabluatex.processfullvoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al@mode@novoc%
+  \ifvmode\leavevmode\fi%
   \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont%
   \luadirect{tex.sprint(arabluatex.processnovoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
-- 
cgit v1.2.3

