1

Based on this answer here "RTL table of content on beamer" I would like to add indentation to \subsection

% !TeX TS-program = xelatex
\documentclass{beamer}
\useinnertheme[shadow=true]{rounded}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[numerals=maghrib, calendar=gregorian]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Arial}
\newfontfamily\arabicfontsf[Script=Arabic]{Arial}
\newfontfamily\arabicfonttt[Script=Arabic]{Arial}
\newfontfamily\amiri[Script=Arabic]{Arial}

\makeatletter
\defbeamertemplate{section in toc}{myball}{
\leavevmode\leftskip=2.75ex%
  \llap{%
    \normalsize%
    \begin{pgfpicture}{-1ex}{-0.7ex}{1ex}{1ex}
      \pgftext{\beamer@usesphere{section number projected}{tocsphere}}
      \pgftext{%
        \usebeamerfont*{section number projected}%
        \usebeamercolor{section number projected}%
        \color{fg!90!bg}%
        \inserttocsectionnumber}
    \end{pgfpicture}%
    \kern1.25ex}%
    \raggedleft \inserttocsection\par
}
[action]
{\setbeamerfont{section number projected}{size=\scriptsize}}

\defbeamertemplate{subsection in toc}{myball}
{\leavevmode\leftskip=5ex%
  \llap{\raise0.1ex\beamer@usesphere{subsection number projected}{bigsphere}\kern1ex}%
  \raggedleft \inserttocsubsection\par%
}

\setbeamertemplate{sections/subsections in toc}[myball]
\makeatother

\begin{document}
%%============multicolumns TOC ==============
%\setbeamertemplate{section in toc}[circle]
\begin{frame}{Outline}%to allow TOC break
\begin{minipage}{.9\textwidth}
\begin{columns}[onlytextwidth]
    \begin{column}{.45\textwidth}
       \begin{Arabic}             
            \tableofcontents%[sections=5-, subsubsectionstyle=hide/hide,hideothersubsections]%hideothersubsections                 
       \end{Arabic}
    \end{column}
    \begin{column}{.45\textwidth}
       \begin{Arabic}
            \tableofcontents%[sections=-4, subsubsectionstyle=hide/hide, hideothersubsections]%hideothersubsections
        \end{Arabic}
    \end{column}    
\end{columns}
\end{minipage}
\end{frame}
%============End multicolumns TOC ==============

\frame{Content}
\section{Test one and Test Two}
\subsection{Test o Two}
\subsection{Test o Two}
\begin{frame}
content
\end{frame}
\section{Test Two}
\subsection{Test o Two}
\subsection{Test o Two}
\begin{frame}{Content}
content
\end{frame}
\section{Test Three}
\subsection{Test o Two}
\subsection{Test o Two}
\begin{frame}{Content}
content
\end{frame}
\end{document}

Indentation

2

Unless you have very long subsection names that span multiple times, you could use this quick hack:

% !TeX TS-program = xelatex
\documentclass{beamer}
\useinnertheme[shadow=true]{rounded}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[numerals=maghrib, calendar=gregorian]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Arial}
\newfontfamily\arabicfontsf[Script=Arabic]{Arial}
\newfontfamily\arabicfonttt[Script=Arabic]{Arial}
\newfontfamily\amiri[Script=Arabic]{Arial}

\makeatletter
\defbeamertemplate{section in toc}{myball}{
\leavevmode\leftskip=2.75ex%
  \llap{%
    \normalsize%
    \begin{pgfpicture}{-1ex}{-0.7ex}{1ex}{1ex}
      \pgftext{\beamer@usesphere{section number projected}{tocsphere}}
      \pgftext{%
        \usebeamerfont*{section number projected}%
        \usebeamercolor{section number projected}%
        \color{fg!90!bg}%
        \inserttocsectionnumber}
    \end{pgfpicture}%
    \kern1.25ex}%
    \raggedleft \inserttocsection\par
}
[action]
{\setbeamerfont{section number projected}{size=\scriptsize}}

\defbeamertemplate{subsection in toc}{myball}
{\leavevmode\leftskip=5ex%
  \hspace{0.6cm}\llap{\raise0.1ex\beamer@usesphere{subsection number projected}{bigsphere}\kern1ex}%
  \raggedleft \inserttocsubsection\par%
}

\setbeamertemplate{sections/subsections in toc}[myball]
\makeatother

\begin{document}
%%============multicolumns TOC ==============
%\setbeamertemplate{section in toc}[circle]
\begin{frame}{Outline}%to allow TOC break
\begin{minipage}{.9\textwidth}
\begin{columns}[onlytextwidth]
    \begin{column}{.45\textwidth}
       \begin{Arabic}             
            \tableofcontents%[sections=5-, subsubsectionstyle=hide/hide,hideothersubsections]%hideothersubsections                 
       \end{Arabic}
    \end{column}
    \begin{column}{.45\textwidth}
       \begin{Arabic}
            \tableofcontents%[sections=-4, subsubsectionstyle=hide/hide, hideothersubsections]%hideothersubsections
        \end{Arabic}
    \end{column}    
\end{columns}
\end{minipage}
\end{frame}
%============End multicolumns TOC ==============

\frame{Content}
\section{Test one and Test Two}
\subsection{Test o Two}
\subsection{Test o Two}
\begin{frame}
content
\end{frame}
\section{Test Two}
\subsection{Test o Two}
\subsection{Test o Two}
\begin{frame}{Content}
content
\end{frame}
\section{Test Three}
\subsection{Test o Two}
\subsection{Test o Two}
\begin{frame}{Content}
content
\end{frame}
\end{document}

enter image description here

| improve this answer | |

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.