1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
|
\documentclass[arabic,babel={layout=lists}]{beamer-rl}
\usepackage{hologo} % pdflatex, xelatex, lualatex logos
\usepackage{verbatim}
\babelprovide[import=ar-DZ, main]{arabic}
\babelprovide[import,language=Default]{english}
% 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}
% reduce space above and below verbatim env
\makeatletter
\preto{\@verbatim}{\topsep=0pt \partopsep=0pt }
\makeatother
\newenvironment{codeblock}{%
\selectlanguage{nil}
\smallskip\hfill%
\beamercolorbox[wd=\linewidth,sep=.3ex,dp=1ex]{block body}
\endgraf
\verbatim
}{%
\endverbatim
\endbeamercolorbox
\hfill
\smallskip
%\end{verbatim}
}
\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 languages (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 to create
right to left beamer presentation, the class call babel with \verb|bidi=basic| option and require \hologo{LuaLaTeX} engine
\end{frame}
\section{How to use beamer-rl}
\begin{frame}[fragile]
\frametitle{How to use beamer-rl}
\begin{codeblock}
\documentclass{beamer-rl}
% import language
\babelprovide[import=ar-DZ, main]{arabic}
\usetheme{Madrid}
\begin{document}
...
\end{document}
\end{codeblock}
\end{frame}
\section{Some notes}
\begin{frame}[fragile,allowframebreaks]
\frametitle{Some notes}
\begin{itemize}
\item
The class define \verb:Amiri: as default sans serif font, we can
modify this in the preambule with
\begin{codeblock}
\babelfont{sf}{<font name>}
\end{codeblock}
\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
\begin{codeblock}
\documentclass[babel={<babel options>}]{beamer-rl}
\end{codeblock}
\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: ....
\begin{codeblock}
\documentclass[arabic]{beamer-rl}
\end{codeblock}
\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
\begin{codeblock}
\bebelsublr{LTR context ... }
\end{codeblock}
\end{itemize}
\end{frame}
\section{pgfpages-rl package}
\begin{frame}[fragile]
\frametitle{pgfpages-rl package}
\verb:pgfpages-rl: adds to \verb:pgfpages: the ability to support TRT pagedir, the package requires \hologo{LuaLaTeX} engine.
It can also be used with other document classes besides \verb:beamer-rl:
\begin{codeblock}
\documentclass{beamer-rl}
\babelprovide[import=ar-DZ, main]{arabic}
\usetheme{Warsaw}
\usepackage{pgfpages-rl} % adapt pgfpages to TRT pagedir
\setbeamertemplate{note page}[]
\setbeameroption{show notes on second screen=right}
\begin{document}
...
\end{document}
\end{codeblock}
\end{frame}
\section{Examples}
\begin{frame}[plain]{}
\fontsize{70}{60}\selectfont\centerline{Examples}
\end{frame}
\subsection{Blocks}
\begin{frame}[fragile]
\frametitle{Blocks}
\begin{codeblock}
\setbeamertemplate{blocks}[default]
\end{codeblock}
\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}
\begin{codeblock}
\setbeamertemplate{blocks}[rounded][shadow=true]
\end{codeblock}
\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,allowframebreaks]
\frametitle{enumerate, itemize}
\begin{columns}[t,onlytextwidth]
\begin{column}{2cm}
\begin{enumerate}
\item First
\item Second
\end{enumerate}
\end{column}
\begin{column}{8.8cm}
\begin{codeblock}
\setbeamertemplate{enumerate item}[ball]
\begin{enumerate}
\item First
\item Second
\end{enumerate}
\end{codeblock}
\end{column}
\end{columns}
\vfill
\setbeamertemplate{itemize item}[triangle]
\begin{columns}[t,onlytextwidth]
\begin{column}{2cm}
\begin{itemize}
\item First
\item Second
\end{itemize}
\end{column}
\begin{column}{8.8cm}
\begin{codeblock}
% in RTL context
\setbeamertemplate{itemize item}[triangle]
\begin{itemize}
\item First
\item Second
\end{itemize}
\end{codeblock}
\end{column}
\end{columns}
\framebreak
\selectlanguage{nil}
\begin{columns}[t]
\begin{column}{2cm}
\begin{itemize}
\item First
\item Second
\end{itemize}
\end{column}
\begin{column}{8.5cm}
\begin{codeblock}
% in LTR context
\setbeamertemplate{itemize item}[triangle]
\begin{itemize}
\item First
\item Second
\end{itemize}
\end{codeblock}
\end{column}
\end{columns}
\end{frame}
\subsection{Hyperlinks}
\begin{frame}[fragile]
\frametitle{Hyperlinks}
\begin{itemize}
\item<1-> First.
\item<2-> Second.
\end{itemize}
\hyperlink{jumptofirst}{\beamergotobutton{return to first slide}}
\hypertarget<1>{jumptofirst}{}
\pause
\begin{codeblock}
\hyperlink{jumptofirst}
{\beamergotobutton{return to first slide}}
\hypertarget<1>{jumptofirst}{}
\end{codeblock}
\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](1cm,1cm)(2cm,2cm)
\pgfimage[height=4cm]{example-image}
\begin{codeblock}
\framezoom<1><2>[border=2](1cm,1cm)(2cm,2cm)
% (1cm,1cm)=(<upper right x>,<upper right y>)
% (2cm,2cm)=(<zoom area width>,<zoom area depth>)
\pgfimage[height=5cm]{example-image}
\end{codeblock}
\end{frame}
\end{document}
|