1

I would like to create right aligned tableofcontents in Beamer but subsection and subsubsection aren't fit for right to left aligned!

current output: Problem desired output: desired output

% !TEX TS-program = xelatex
\documentclass{beamer}

\begin{document}
    \section{yes it's fine}
    \subsection{I have some problem}
    \subsubsection{why?}
    \begin{frame}
        \raggedleft\tableofcontents
    \end{frame}
\end{document}
  • 1
    Can you make a sketch of the desired output? Should the sub(sub)sections be indented on the right site? Should this be used in a RTL language? Do you use any theme in your real document? – samcarter_is_at_topanswers.xyz Jan 03 '19 at 15:37
  • @samcarter: I did add my desired output.

    yes, sub(sub)sections must be intended on the right.

    yes, it must use in an RTL language.

    No, currently I'm not using any theme all of the code is in above.

    – David Tex Jan 03 '19 at 15:50
  • 1
    Thanks for the clarifications! Could you have a look if https://tex.stackexchange.com/a/461277/36296 goes into the right direction (removing the bullets and numbers is possible) – samcarter_is_at_topanswers.xyz Jan 03 '19 at 15:52

1 Answers1

2

A simplified version of https://tex.stackexchange.com/a/461277/36296

arabic is just an example which I happen to use in the other question. Replace this with whatever language you are using.

% !TeX TS-program = xelatex
\documentclass{beamer}

\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Arial}
\newfontfamily\arabicfontsf[Script=Arabic]{Arial}
\newfontfamily\arabicfonttt[Script=Arabic]{Arial}
\newfontfamily\amiri[Script=Arabic]{Arial}


\setbeamertemplate{section in toc}{\inserttocsection\par}

\setbeamertemplate{subsection in toc}{\leavevmode\rightskip=1.5em\inserttocsubsection\par}

\setbeamertemplate{subsubsection in toc}{\leavevmode\normalsize\usebeamerfont{subsection in toc}\rightskip=3em%
  \usebeamerfont{subsubsection in toc}\inserttocsubsubsection\par}

\begin{document}
    \section{yes it's fine}
    \subsection{I have some problem}
    \subsubsection{why?}
    \begin{frame}
    \begin{minipage}{\textwidth}
      \begin{Arabic}    
        \tableofcontents
      \end{Arabic}
         \end{minipage}
    \end{frame}
\end{document}

enter image description here