5

I'm used to create Arabic Beamer presentations with the arabtex package, but with arabtex there are many environments (like enumerate) can not be used, for this I would like to write arabic using new packages such as arabi or polyglossia .

I tried writing my presentations with these new packages but I always set problems of alignment especially with the polyglossia package .

My aim is to learn the best and easier way to create beamer presentation with arabic script with examples of that

my MWE with arabtex

\documentclass{beamer}  
\usetheme{Warsaw}
\usepackage{graphicx}
\usepackage{arabtex}

\author{Me}
\title{Arabic in Beamer}

\begin{document}
\novocalize
\begin{frame}{}
\titlepage
\end{frame}

\begin{frame}{\begin{arabtext}
al-^sry.hT al-'awlY
\end{arabtext}}

\begin{arabtext}
$-1$ n.s `rby\\
$-2$ n.s `rby
\end{arabtext}

\begin{enumerate}
\item \RL{n.s `rby}
\item \RL{n.s `rby}
\end{enumerate}
\end{frame}

\end{document}
  • 1
    Your MWE works for me; exactly what problems are you experiencing? At any rate, I’d recommend arabxetex compiled with xelatex. – Thérèse Aug 23 '14 at 14:48
  • 1
    Is your objection perhaps that the numerals in the enumeration are not those used in Arabic texts today? If so, tex.stackexchange.com/q/53121/7883 and tex.stackexchange.com/q/98565/7883 and tex.stackexchange.com/q/172601/7883 may give you some ideas. – Thérèse Aug 23 '14 at 15:44
  • @Thérèse I have no broblems with my MWE , or with numerals i would like just use arabic script with beamer, and to show numerals in bullet like standard enumerate (or itemize ) in latin script presentation. – Salim Bou Aug 23 '14 at 16:06
  • Do you mean that you want to type your source in Arabic and not in ASCII transliteration? If so, arabxetex makes that easy. – Thérèse Aug 23 '14 at 16:19
  • @Thérèse can you write an MWE with arabxetex in which you show list with numbers in bullet style (aligned to the right) – Salim Bou Aug 23 '14 at 16:26
10

enter image description here

To align text to the right you can just put them in minipage environment, regarding frame title you can use \setbeamertemplate{frametitle}[default][right]

I have created 2 macro \myenum and \myitem for enumerate and itemize bullets.

Here the code

% compile with xelatex
\documentclass[20pt]{beamer}
\usetheme{Warsaw}
\usepackage{enumitem}
\usepackage{fontspec}
\usepackage{polyglossia}
\setbeamertemplate{frametitle}[default][right]% align the frametitle to the right
\setdefaultlanguage{english}
\setotherlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{Amiri}
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1]{Amiri}

%~~~~~~~~~~~~~~~~define bullet for enumerate~~~~~~~~~~~~~

\newcommand{\myenum}[1]
{
 \par\vspace{3pt}\LR{\hspace*{3pt}%
  \begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
    \usebeamercolor[fg]{item projected}
    {\pgftransformscale{1.8}\pgftext{\normalsize \pgfuseshading{bigsphere}}}
    {\pgftransformshift{\pgfpoint{0pt}{0.5pt}}
      \pgftext{\usebeamerfont*{item projected}\textcolor{white}{#1}}}
  \end{pgfpicture}%
  \hspace{1pt}%
}}

%~~~~~~~~~~~~~~~~~~define bullet for itemize~~~~~~~~~~~~~~~

\newcommand{\myitem}{\par\vspace{3pt}\hspace{5mm}\LR{\hspace*{3pt}%
  \begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
    \usebeamercolor[fg]{item projected}
    {\pgftransformscale{1.1}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
      \end{pgfpicture}%
  \hspace{1pt}%
}}

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

\begin{document}

\begin{frame}
\frametitle{\textarabic{الشريحة الأولى}}
\begin{minipage}{0.95\textwidth}
\begin{Arabic}

\begin{enumerate}[label=\protect\myenum{\arabic*}]
\item نص عربي 

\pause

\item نص عربي
\end{enumerate}    
\pause    
\begin{itemize}[label=\protect\myitem , rightmargin=5mm ]
\item نص عربي 

\pause

\item نص عربي
\end{itemize}

\end{Arabic}
\end{minipage}

\end{frame}
\end{document} 

Edit 10/03/2017

Here another simple method without using enumitem package to customize list items for right to left text, (we need a recent version of bidi package)

% compile with xelatex

\documentclass[mathserif]{beamer}
\usetheme{Warsaw}
\usepackage{polyglossia}
\setdefaultlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}
\newfontfamily\arabicfontsf[Script=Arabic]{Amiri}

% for RTL liste
\makeatletter
\newcommand{\RTList}{\raggedleft\rightskip\@totalleftmargin}
\makeatother

 % RTL frame title
 \setbeamertemplate{frametitle}
 {\vspace*{-1mm}
 \nointerlineskip
 \begin{beamercolorbox}[sep=0.3cm,ht=2.2em,wd=\paperwidth]{frametitle}
    \vbox{}\vskip-2ex%
    \strut\hskip1ex\insertframetitle\strut
    \vskip-0.8ex%
 \end{beamercolorbox}
  }

 % RTL triangle for itemize
 \setbeamertemplate{itemize item}  
 {\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleleft$}} 

\begin{document}

\rightskip\rightmargin

\begin{frame}
\frametitle{الشريحة الأولى}

\begin{enumerate}\RTList
\item
نص عربي

\pause

\item
 نص عربي
\end{enumerate}    

\pause    

\begin{itemize}\RTList
\item
 نص عربي 

\pause

\item
نص عربي

\end{itemize}

\end{frame}
\end{document} 
4

This is not an answer but a clarification of the question, a clarification which won’t fit into a comment but which may put our wizards on the right track.

Here’s a small example (I use the 20pt option only to make the image big and clear):

% compile with xelatex
\documentclass[20pt]{beamer}
\usepackage[utf]{arabxetex}
\newfontfamily\arabicfont[Script=Arabic]{Scheherazade}
\begin{document}
\begin{frame}
  \frametitle{\textarab{الشريحة الأولى}}

  \begin{arab}
    \begin{enumerate}
    \item نص عربي
    \item نص عربي
    \end{enumerate}
  \end{arab}
\end{frame}
\end{document}

output of above code

The problem is that, although the words go from right to left, as they should, they’re in the left part of the frame instead of the right.

\usetheme{Singapore} will put the title in the center, where it looks fine, but the enumeration is still on the left. And \usetheme{Warsaw} makes the enumeration disappear altogether. So I suspect that each theme will need its own patches…

Until a solution for beamer appears, you can make something suitable for presentations, though not as pretty as beamer, with texpower and the screen option of the geometry package:

% compile with xelatex
\documentclass[20pt]{extarticle}
\usepackage[screen]{geometry}
\usepackage[display]{texpower}
\usepackage[utf]{arabxetex}
\newfontfamily\arabicfont[Script=Arabic,Scale=2]{Scheherazade}
\pagestyle{empty}
\begin{document}
\begin{arab}
\section*{\textarab{الشريحة الأولى}}
\begin{enumerate}
\item نص عربي\pause
\item نص عربي
\end{enumerate}
\end{arab}
\end{document}

output of second code sample

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.