2

I am using the following code to write a leaflet with two languages:

\documentclass[10pt,foldmark,notumble]{leaflet}
\renewcommand*\foldmarkrule{.3mm}
\renewcommand*\foldmarklength{5mm}

% Set language here
\usepackage{polyglossia}
\setmainlanguage{english}
%\setotherlanguage[locale=mashriq, numerals=maghrib]{arabic} % <------ ERROR
\setmainfont{Times New Roman}
\newfontfamily\arabicfont[Scale=1, Script=Arabic]{Traditional Arabic}


\usepackage{lipsum}
\usepackage{comment}
\usepackage{float}

\newcommand*\defaultmarker{\textsuperscript\textasteriskcentered}

\CutLine*{1}%
\CutLine*{6}%

\begin{document}
    
    \section{Abstract}
    
    This is the abstract which is good \arabicfont{ (مثال عن العربية)} The rest of the abstract is here..
    \section{Background}
    
    \lipsum[1]
    
    \section{Objectives}
    
    \lipsum[1]
    
\end{document}

I am accustomed to use the language section above in other documents and it works fine. But here in the leaflet class, whenever I use the \setotherlanguage{arabic} it gives an error.

In its current state, the arabic words are left-to-right, and they should be RTL. polyglossia package usually allows me to use:

\begin{Arabic}
...نص عربي هنا...
\end{Arabic}

But it does not work here either.. What can I do to write in two languages in the leaflet class?

enter image description here

2
  • Thank you, compiling with LuaLatex worked! Please add this as an answer so that I accept it.
    – ellat
    Jun 2 at 14:16
  • Welcome to the TeX-LaTeX Stack Exchange community!
    – Thérèse
    Jun 2 at 19:00

1 Answer 1

4

I do not get an error message using LuaLaTeX (but I have to replace the Arabic font by "Noto Naskh Arabic", because I do not have "Traditional Arabic"). With XeLaTeX there is a memory problem within bidi package, because of the number of needed count registers. So I would recommend to use LuaLaTeX.

BTW: \arabicfont is a switch not a command with argument. So using \textarabic{…} would be better. Using LuaLaTeX

\documentclass[10pt,foldmark,notumble]{leaflet}
\renewcommand*\foldmarkrule{.3mm}
\renewcommand*\foldmarklength{5mm}

% Set language here
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[locale=mashriq, numerals=maghrib]{arabic} % <------ ERROR
\setmainfont{Times New Roman}
%\newfontfamily\arabicfont[Scale=1, Script=Arabic]{Traditional Arabic}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.1]{Noto naskh Arabic}

\usepackage{lipsum}
\usepackage{comment}
\usepackage{float}

\newcommand*\defaultmarker{\textsuperscript\textasteriskcentered}

\CutLine*{1}%
\CutLine*{6}%

\begin{document}
    
    \section{Abstract}
    
    This is the abstract which is good \textarabic{مثال عن العربية} The rest
    of the abstract is here.

    \begin{Arabic}
نص عربي هنا
\end{Arabic}

    \section{Background}
    
    \lipsum[1]
    
    \section{Objectives}
    
    \lipsum[1]
    
\end{document}

result in:

enter image description here

You must log in to answer this question.

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