1

I have used the answer from this question The best way to write Arabic in beamer by (Salim Bou) see here, but still there is a problem with the table of content, it should be aligned to right instead of being centered, see the picture below, any help please?

the code sample is:

% compile with xelatex

\documentclass[xcolor=table]{beamer}
\usetheme{Madrid}
\usepackage{polyglossia}
\setdefaultlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Simplified Arabic}
\newfontfamily\arabicfontsf[Script=Arabic]{Simplified Arabic}

% 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$}} 

\newcommand\Fontvi{\fontsize{14}{10}\selectfont}

\begin{document}

\begin{frame}{المحتويات}
\tableofcontents
\end{frame}

\rightskip\rightmargin

\begin{frame}[allowframebreaks]
\frametitle{الشريحة الاولى}
\begin{block}{ادارة الحالات}
حالة جيدة
\end{block}

\end{frame}

\section{الدراسة المرجعية}
\subsection{مراحل الدراسة المرجعية}

\begin{frame}[allowframebreaks]
\frametitle{الشريحة الاولى}
\begin{block}{ادارة الحالات}
حالة جيدة
\end{block}

\end{frame}

\end{document} 
4
  • Welcome to TeX.Stackexchange! What do you want to change? Jan 23, 2018 at 11:49
  • And which of the answers did you use? Please make a minimal working example (MWE) that reproduces your picture. Jan 23, 2018 at 11:51
  • What is your exact problem?
    – bmv
    Jan 23, 2018 at 12:17
  • I add a minimal example to produce this slide. the exact problem is that the toc should be aligned to right not to be centered or cluttered like the picture.
    – Ross
    Jan 23, 2018 at 13:12

1 Answer 1

2

You could wrap the table of contents in a minipage of suitable width:

% !TeX program = xelatex
\documentclass[xcolor=table]{beamer}
\usetheme{Madrid}
\usepackage{polyglossia}
\setdefaultlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Times New Roman}
\newfontfamily\arabicfontsf[Script=Arabic]{Times New Roman}

\setbeamertemplate{subsection in toc}[ball unnumbered]

\begin{document}

\begin{frame}{المحتويات}
\begin{minipage}{.85\textwidth} 
    \tableofcontents
\end{minipage}
\end{frame}

\section{الدراسة المرجعية}
\subsection{مراحل الدراسة المرجعية}
\begin{frame}
\end{frame}

\end{document} 

enter image description here

3
  • This is great thank you for your time, you solve the problem, but the subsection in toc should be aligned a little bit to the left right?
    – Ross
    Jan 23, 2018 at 13:40
  • @AliMhrez Please see my edited answer Jan 23, 2018 at 13:47
  • Thank you a lot, your answer solves the problem , I appreciate your help
    – Ross
    Jan 23, 2018 at 13:51

You must log in to answer this question.

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