在 Beamer 上为 RTL 目录的小节添加缩进

在 Beamer 上为 RTL 目录的小节添加缩进

根据此处的答案 “Beamer 上的 RTL 目录”我想添加缩进\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}

缩进

答案1

除非您的小节名称很长且跨越多次,否则您可以使用这个快速技巧:

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

在此处输入图片描述

相关内容