When typesetting syriac RTL text in LuaTeX, it seems the right-alignment of section and subsection headlines has a bug. It seems that the small horizontal space between number and headline text is still typesetted to the right of the number, resulting in a small indentation of the whole headline from the right and in a missing horizontal space between number and headline.

enter image description here



\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 RTL text
       {\bgroup\luatextextdir TLT #1\egroup}
\newenvironment{syriac}     % Syriac paragraph
       {\luatextextdir TRT\luatexpardir TRT\syriacfont}{}



\section{English section}

The number of the english section is aligned to the left edge of the column.
There is a horizontal space between number and headline. 

In the RTL (syriac) paragraph below, the section number is not right aligned
to the right edge of the column. It seems the horizontal space which is
supposed to be between number and headline is still on the right side of the
number, though it should switch to the left. 

\subsection{English subsection} 

The same issue holds for subsections. 

    ܘܟܕ ܡܿܟܪܟܝܢ ܐܪܟܢܐ ܗ̄ ܡܘܪܐ ܗܿܝ ܩ7ܕܡܝܬܐ

    ܘܟܕ ܡܿܟܪܟܝܢ ܐܪܟܢܐ ܗ̄ ܡܘܪܐ ܗܿܝ ܩ7ܕܡܝܬܐ


The problem also occurs when using article.cls instead of scrartcl.cls, and when using arabic script instead of syriac. Maybe it is a general problem with the \section command in RTL typesetting? Or did I do anything wrong in the setup of the RTL environment?

Note: The problem does not appear when using a XeLaTeX + polyglossia + bidi setup. It seems specific to LuaTeX.

1 Answer 1


The problem is resolved by adding \bodydir TRT to the definition of the syriac environment. So, the correct definition is

  {\par% Syriac paragraph
   \pardir TRT\textdir TRT\bodydir TRT\syriacfont}

There is hardly any documentation available of the LuaTeX text direction infrastructure.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .