\documentclass[arabic,babel={layout=lists}]{beamer-rl}
\usepackage{hologo} % pdflatex, xelatex, lualatex logos 

\babelprovide[import=ar-DZ, main]{arabic}
\babelprovide[import,language=Default]{english}
\babelfont{sf}{Amiri}

% Themes without Navigation Bars
%\mode<presentation>{\usetheme{default}}
%\mode<presentation>{\usetheme{boxes}}
%\mode<presentation>{\usetheme{Bergen}}
%\mode<presentation>{\usetheme{Boadilla}}
\mode<presentation>{\usetheme{Madrid}}
%\mode<presentation>{\usetheme{AnnArbor}}
%\mode<presentation>{\usetheme{CambridgeUS}}
%\mode<presentation>{\usetheme{EastLansing}}
%\mode<presentation>{\usetheme{Pittsburgh}}
%\mode<presentation>{\usetheme{Rochester}}

% Themes with a Tree-Like Navigation Bar
%\mode<presentation>{\usetheme{Antibes}}
%\mode<presentation>{\usetheme{JuanLesPins}}
%\mode<presentation>{\usetheme{Montpellier}}

% Themes with a Table of Contents Sidebar
%\mode<presentation>{\usetheme{Berkeley}}
%\mode<presentation>{\usetheme{PaloAlto}}
%\mode<presentation>{\usetheme{Goettingen}}
%\mode<presentation>{\usetheme{Hannover}}

% Themes with a Mini Frame Navigation
%\mode<presentation>{\usetheme{Berlin}}
%\mode<presentation>{\usetheme{Ilmenau}}
%\mode<presentation>{\usetheme{Dresden}}
%\mode<presentation>{\usetheme{Darmstadt}}
%\mode<presentation>{\usetheme{Frankfurt}}
%\mode<presentation>{\usetheme{Singapore}}
%\mode<presentation>{\usetheme{Szeged}}

% Themes with Section and Subsection Tables
%\mode<presentation>{\usetheme{Copenhagen}}
%\mode<presentation>{\usetheme{Luebeck}}
%\mode<presentation>{\usetheme{Malmoe}}
%\mode<presentation>{\usetheme{Warsaw}}
%\usetheme{Cuerna}\usecolortheme{default}

\title{The beamer-rl class}

\author{Salim Bou}

\institute[]{%
{\color{blue} Repository: } https://github.com/seloumi/beamer-rl \par 
{\color{blue} Bug tracker: } https://github.com/seloumi/beamer-rl/issues
}


\date{{\selectlanguage{english} \today}}

\setbeamercovered{transparent=10}

\begin{document}

\parskip=6pt

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\frametitle{\selectlanguage{english}\contentsname}
\tableofcontents
\end{frame}


\section{Introduction}

\begin{frame}[fragile]
\frametitle{Introduction}
Creating beamer presentation for  right to left language  (like arabic) using \hologo{pdfLaTeX} or \hologo{XeLaTeX} still poses many problems due to bugs not currently resolved especially for colors and hyperlinks

The \hologo{LuaTeX} team set solutions for  these issues thanks to them and to \textit{Javier~Bezos} for  his works on the package \verb|babel| and \verb|bidi| writing    

This class provides patchs of some beamer templates and commands 
for right to left presentation, this package call babel with \verb|bidi=basic-r| option and require lualatex engine

\end{frame}

\section{How to use beamer-rl}

\begin{frame}[fragile]
\frametitle{How to use beamer-rl}

\selectlanguage{nil}

\begin{verbatim}
\documentclass{beamer-rl}
\babelprovide[import=ar-DZ, main]{arabic}
\babelfont{sf}{Amiri}

\mode<presentation>{\usetheme{Warsaw}}
\begin{document}
...
\end{document}

\end{verbatim}

\end{frame}

\section{Some notes}

\begin{frame}[fragile,allowframebreaks]
\frametitle{Some notes}

\begin{itemize}

\item

All options provided by \verb:beamer:  can be added  with  \verb:beamer-rl:

Additional options can also be passed to  package 
 \verb:babel: 
 with  \verb:beamer-rl: like this

\medskip 
 
{\selectlanguage{nil}
\verb:\documentclass[babel={<babel options>}]{beamer-rl}:
}

\medskip

\item
The \verb:beamer-rl: class swap the definition of \verb:\blacktriangleright: with  \verb:\blacktriangleleft: in RTL context

\bigskip

{\renewcommand{\arraystretch}{1.3}
\centering
\begin{tabular}{ccc}
\hline
 &  \verb:\blacktriangleright: & \verb:\blacktriangleleft:   \\
\hline 
LTR context & \blacktriangleright & \blacktriangleleft \\
\hline
RTL context & \selectlanguage{nil}\blacktriangleright & \selectlanguage{nil}\blacktriangleleft \\
\hline
\end{tabular}
\par
}

\bigskip


\item

Class option \verb:arabic: call an Arabic dictionary to translate strings like \verb:theorem:, \verb:example:, \verb:definition: ....  


\medskip 
 
{\selectlanguage{nil}
\verb:\documentclass[arabic]{beamer-rl}:
}

\medskip


\item
In some cases you  need to use \verb:\babelsublr: command from \verb:bebel: 
package to insert a left to right text within your right to left text, e.g if you need to insert a \verb:pspicture: drawing in RTL context 

\medskip 
 
{\selectlanguage{nil}
\verb:\bebelsublr{LTR context ... }:
}

\end{itemize}


\end{frame}


\section{Examples}
\subsection{Blocks}

\begin{frame}[fragile]
\frametitle{Blocks}

{\selectlanguage{nil}
\verb:\setbeamertemplate{blocks}[default]:
}

\setbeamertemplate{blocks}[default]


\begin{block}{Lorem}
  \selectlanguage{nil} 
  On 21 April 1820, during a lecture, Ørsted
  noticed a compass needle deflected from magnetic north when an
  electric current from a battery was switched on and off.
\end{block}

{\selectlanguage{nil}
\verb:\setbeamertemplate{blocks}[rounded][shadow=true]:
}

\setbeamertemplate{blocks}[rounded][shadow=true]

\begin{block}{Lorem}
  \selectlanguage{nil} 
  On 21 April 1820, during a lecture, Ørsted
  noticed a compass needle deflected from magnetic north when an
  electric current from a battery was switched on and off.
\end{block}

\end{frame}

\subsection{Lists}

\begin{frame}[fragile]
\frametitle{enumerate, itemize}

\begin{enumerate}
\item first item
\item second item
\item third item
\end{enumerate}

\setbeamertemplate{itemize item}[triangle]

{\selectlanguage{nil}
\verb|\setbeamertemplate{itemize item}[triangle]|
}


\begin{itemize}
\item first item
\item second item
\item third item
\end{itemize}

\selectlanguage{nil}
\shapemode=2

\begin{itemize}
\item first item
\item second item
\item third item
\end{itemize}


\end{frame}

\subsection{Hyperlinks}

\begin{frame}
\frametitle{Hyperlinks}
\begin{itemize}
\item<1-> First item.
\item<2-> Second item.
\item<3-> Third item.
\end{itemize}
\hyperlink{jumptosecond}{\beamergotobutton{return to second slide}}
\hypertarget<2>{jumptosecond}{}
\end{frame}


\subsection{Theorems}

\begin{frame}
\frametitle{Theorems}

\framesubtitle{The proof uses \textit{reductio ad absurdum}.}
\begin{theorem}
There is no largest prime number.
\end{theorem}
\begin{proof}
\begin{enumerate}[<+-| alert@+>]
\item Suppose $p$ were the largest prime number.
\item Let $q$ be the product of the first $p$ numbers.
\item Then $q+1$ is not divisible by any of them.
\item But $q + 1$ is greater than $1$, thus divisible by some prime
number not in the first $p$ numbers.\qedhere
\end{enumerate}
\end{proof}

\end{frame}

\subsection{Zooming}

\begin{frame}[fragile]
\frametitle{Zooming}

\framezoom<1><2>[border=2](3cm,2cm)(2cm,2cm)
\pgfimage[height=5cm]{example-image}

\selectlanguage{nil}

\begin{verbatim}
\framezoom<1><2>[border=2](3cm,2cm)(2cm,2cm)
% (3cm,2cm)=(<upper right x>,<upper right y>)
% (2cm,2cm)=(<zoom area width>,<zoom area depth>)
\pgfimage[height=5cm]{example-image}
\end{verbatim}

\end{frame}


\end{document}
