Beamer raggedleft 目录在 subsection 和 subsubsection 中显示不正确

Beamer raggedleft 目录在 subsection 和 subsubsection 中显示不正确

我想在 Beamer 中创建右对齐的目录,但是小节和小小节不适合从右到左对齐!

电流输出: 问题 期望输出: 期望输出

% !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

简化版本https://tex.stackexchange.com/a/461277/36296

arabic这只是我在另一个问题中碰巧使用的一个示例。请将其替换为您使用的任何语言。

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

在此处输入图片描述

相关内容