# eledmac/eledpar/LuaTeX: right alignment of RTL text paragraphs in pages enviroment

I have a LuaTex + eledmac + eledpar setup for critical editions in syriac and english (on facing pages). Strangely, the syriac text, which is running RTL, is not aligned on the right, but on the left side of the column as soon as I am in the \begin{pages}...\end{pages} structure of eledpar.

The following MWE demonstrates what I mean. Can anyone help me make the syriac text of the \eledsection and of the following syriac paragraph align to the right side of the whole page?

\documentclass{scrartcl}
\usepackage{fontspec}
\usepackage{eledmac,eledpar}
\setlength{\parindent}{0pt}

\newfontfamily\syriacfont[Script=Syriac,Scale=1.2]{estre.otf}

\newcommand{\textsyriac}[1] % Syriac inside LTR
{\bgroup\luatextextdir TRT\syriacfont #1\egroup}
\newcommand{\n}         [1] % for digits inside Arabic text
{\bgroup\luatextextdir TLT #1\egroup}
\newcommand{\syriacfootnote} [1] % Syriac Footnotes
{\footnote{\textsyriac{#1}}}
\newenvironment{syriac}     % Syriac paragraph
{\luatextextdir TRT\luatexpardir TRT\syriacfont}{}

\begin{document}
The following syriac paragraph appears right-aligned as a whole:

\begin{syriac}
1ܘܟܕ 2ܡܿܟܪܟܝ3ܢܢ ܐܪܟ4ܐܢܐ ܗ̄ 5ܡܘܪܐ6 ܗܿܝ ܩ7ܕܡܝܬܐ
\end{syriac}

\bigskip

But on the next page, neither the syriac section heading nor the syriac
paragraph are right-aligned, although they are correctly typsetted RTL:

\begin{pages}
\begin{Leftside}
\begin{syriac}
\beginnumbering
\pstart
%% This text is aligned on the left, but should be on the right:
\eledsection*{\textsyriac{ܡܿܟܪܟܝ}}
\pend

\pstart
\begin{syriac}
%% This text is aligned on the left, but should be on the right:
1ܘܟܕ 2ܡܿܟܪܟܝ3ܢܢ ܐܪܟ4ܐܢܐ ܗ̄ 5ܡܘܪܐ6 ܗܿܝ ܩ7ܕܡܝܬܐ
\end{syriac}
\pend
\endnumbering
\end{syriac}
\end{Leftside}

\begin{Rightside}
\beginnumbering
\pstart
\pend

\pstart
Some english text.
\pend
\endnumbering
\end{Rightside}

\Pages
\end{pages}

\end{document}

• do you absolutly need LuaLaTeX? because eledmac/eledpar has not implemented yet direction mechanism of LuaLaTeX, but only these of XeLaTeX. see the file parallel-column-two-languages.tex in the "examples" folder of the handbook. Feb 12 '15 at 21:43
• as the only one maintener of eledmac, I can say something : i have no time for lualatex implementation. Feb 12 '15 at 21:43
• Ah ok, I see it is because of LuaTeX. But do you think I can fix this by providing some replacement for the many \if@RTL that occur in the eledmac.sty/eledpar.sty, or will it be more complicated than this? Feb 13 '15 at 10:25
• I think it will be more complex. Those \if@RTL are principaly for footnotes. When eledmac split the text in lines, it retains, with XeLaTeX + bidi the orientation. It seems it's not the case with LuaLaTeX. Open an issue on github, I could look for it ... but I can't say when. Feb 13 '15 at 10:31
• yes, I confirm. It's more complex. Feb 13 '15 at 10:48

The version 1.18.0 / 1.12.0 of eledmac/eledpar, just uploaded now on CTAN, should solve this issue.

Thanks for reporting it and for test.

As I said, with XeLaTeX I can obtain what you need with the following MWE

\documentclass{book}
\usepackage{fontspec,polyglossia}
\usepackage{eledmac,eledpar}
\setmainlanguage{english}
\setotherlanguage{syriac}

\usepackage{bidi}
\setlength{\parindent}{0pt}

\newfontfamily\syriacfont[Script=Syriac,Scale=1.2]{Estrangelo Edessa}

\newcommand{\n}         [1] % for digits inside Arabic text
{\bgroup\LTR  #1\egroup}
\newcommand{\syriacfootnote} [1] % Syriac Footnotes
{\footnote{\textsyriac{#1}}}

\let\bfseries\relax
\begin{document}
\begin{syriac}
\section*{ܘܟܕ}
\end{syriac}
The following syriac paragraph appears right-aligned as a whole:

\begin{syriac}
1ܘܟܕ 2ܡܿܟܪܟܝ3ܢܢ ܐܪܟ4ܐܢܐ ܗ̄ 5ܡܘܪܐ6 ܗܿܝ ܩ7ܕܡܝܬܐ
\end{syriac}

\bigskip

But on the next page, neither the syriac section heading nor the syriac
paragraph are right-aligned, although they are correctly typsetted RTL:

%\newpage

\begin{pages}
\begin{Leftside}
\begin{RTL}
\begin{syriac}
\beginnumbering
\pstart
%% This text is aligned on the left, but should be on the right:
\eledsection*{\syriacfont{ܘܟܕ}}
\pend

\pstart

%% This text is aligned on the left, but should be on the right:
1ܘܟܕ 2ܡܿܟܪܟܝ3ܢܢ ܐܪܟ4ܐܢܐ ܗ̄ 5ܡܘܪܐ6 ܗܿܝ ܩ7ܕܡܝܬܐ

\pend
\endnumbering
\end{syriac}
\end{RTL}
\end{Leftside}

\begin{Rightside}
\beginnumbering
\pstart