投影機上的 RTL multicols 目錄

投影機上的 RTL multicols 目錄

我想在 Beamer 上的阿拉伯文檔目錄中使用 Multicols,它從左列而不是右列開始的問題是我的 MWE:

    % !TeX TS-program = xelatex
\documentclass[10pt]{beamer}
\usetheme{Warsaw}
\usepackage{multicol}%
\usepackage{enumitem}
\usepackage{fontspec}
\usepackage{polyglossia}
\setbeamertemplate{section in toc}[circle]
\setbeamertemplate{frametitle continuation}{\gdef\beamer@frametitle{}} % framebreaks without numbering
\setbeamertemplate{frametitle}[default][right]% align the frametitle to the right
%\setdefaultlanguage{english}
\setmainlanguage{english}
\setotherlanguage{arabic}
\setmainfont{Times New Roman}
\setotherlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{Times New Roman}%
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1]{Times New Roman}%
\graphicspath{{pics/}}
%
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand{\ar}{\textarabic} % to change the laguage in the section and frame title to persian
% This work as: \a{متن فارسی}
%~~~~~~~~~~~~~~~~define bullet for enumerate~~~~~~~~~~~~~
\newcommand{\myenum}[1]
{
\par\vspace{3pt}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.8}\pgftext{\normalsize \pgfuseshading{bigsphere}}}
{\pgftransformshift{\pgfpoint{0pt}{0.5pt}}
\pgftext{\usebeamerfont*{item projected}\textcolor{white}{#1}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
%~~~~~~~~~~~~~~~~~~define bullet for itemize~~~~~~~~~~~~~~~
\newcommand{\myitem}{\par\vspace{3pt}\hspace{5mm}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.1}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
%~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand{\myitemII}{\par\vspace{3pt}\hspace{5mm}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.8}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
\setbeamertemplate{section in toc}{%
\setRTL \myenum{\inserttocsectionnumber}
\inserttocsection\par
}
\setbeamertemplate{subsection in toc}{%
\setRTL \myitem
\inserttocsubsection\par%
}
\setbeamertemplate{subsubsection in toc}{%
\setRTL \rightskip=3ex\myitem
\inserttocsubsection\par%
}
\begin{document}
%\selectlanguage{arabic}
\title{\textarabic{بعنوان عنوان نعنوان }}
\author{AUTHOR}
\date{\today}
\frame{\titlepage}
\frame{
\frametitle{\textarabic{فهرست مطالب}}
\begin{minipage}{1.\textwidth}
\begin{Arabic}
\begin{multicols}{2} 
\tableofcontents
\end{multicols}
\end{Arabic}
\end{minipage}
}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\frame{
\frametitle{\textarabic{سیستمهای فرمیونی همبسته:مایع}}
\begin{minipage}{.95\textwidth}
\begin{Arabic}
\begin{itemize}[label=\protect\myitemII, rightmargin=0mm]
\item
\ar{متن فارسی .....}
\ar{متن فارسی .....}
\item
\ar{متن فارسی .....}
\item
\ar{متن فارسی .....}
\item
\ar{متن فارسی .....}
\end{itemize}           
\ar{متن فارسی .....}            
\end{Arabic}
\end{minipage}
}
\end{document}

倒立柱

答案1

如果您不介意手動指定斷點,您可以這樣做:

    % !TeX TS-program = xelatex
\documentclass[10pt]{beamer}
\usetheme{Warsaw}
\usepackage{multicol}%
\usepackage{enumitem}
\usepackage{fontspec}
\usepackage{polyglossia}
\setbeamertemplate{section in toc}[circle]
\setbeamertemplate{frametitle continuation}{\gdef\beamer@frametitle{}} % framebreaks without numbering
\setbeamertemplate{frametitle}[default][right]% align the frametitle to the right
%\setdefaultlanguage{english}
\setmainlanguage{english}
\setotherlanguage{arabic}
\setmainfont{Times New Roman}
\setotherlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{Times New Roman}%
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1]{Times New Roman}%
\graphicspath{{pics/}}
%
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand{\ar}{\textarabic} % to change the laguage in the section and frame title to persian
% This work as: \a{متن فارسی}
%~~~~~~~~~~~~~~~~define bullet for enumerate~~~~~~~~~~~~~
\newcommand{\myenum}[1]
{
\par\vspace{3pt}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.8}\pgftext{\normalsize \pgfuseshading{bigsphere}}}
{\pgftransformshift{\pgfpoint{0pt}{0.5pt}}
\pgftext{\usebeamerfont*{item projected}\textcolor{white}{#1}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
%~~~~~~~~~~~~~~~~~~define bullet for itemize~~~~~~~~~~~~~~~
\newcommand{\myitem}{\par\vspace{3pt}\hspace{5mm}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.1}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
%~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand{\myitemII}{\par\vspace{3pt}\hspace{5mm}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.8}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
\setbeamertemplate{section in toc}{%
\setRTL \myenum{\inserttocsectionnumber}
\inserttocsection\par
}
\setbeamertemplate{subsection in toc}{%
\setRTL \myitem
\inserttocsubsection\par%
}
\setbeamertemplate{subsubsection in toc}{%
\setRTL \rightskip=3ex\myitem
\inserttocsubsection\par%
}
\begin{document}

\begin{frame}
\frametitle{\textarabic{فهرست مطالب}}
\begin{columns}[onlytextwidth]
    \begin{column}{.45\textwidth}
        \begin{Arabic}
            \flushright
            \tableofcontents[sections=5-]
        \end{Arabic}
    \end{column}
    \begin{column}{.45\textwidth}
        \begin{Arabic}
            \flushright
            \tableofcontents[sections=-4]
        \end{Arabic}
    \end{column}    
\end{columns}
\end{frame}

\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}

\begin{frame}
content...
\end{frame}
\end{document}

在此輸入影像描述

答案2

儘管評論中聲稱\RLmulticolcolumns不起作用,但它確實有效(至少我看不出它在哪裡失敗,或者為什麼會失敗)。您所要做的就是將其添加到帶有目錄的框架中,例如,

\frame{
\frametitle{\textarabic{فهرست مطالب}}
\begin{minipage}{1.\textwidth}
\begin{Arabic}
\RLmulticolcolumns    % <--- here to act only in this frame
\begin{multicols}{2} 
\tableofcontents
\end{multicols}
\end{Arabic}
\end{minipage}
}

然後我們得到以下輸出:

在此輸入影像描述

這是我根據要求使用的完整程式碼(TL 2017)以獲得上述輸出,但實際上它只是添加了單行的原始範例:

    % !TeX TS-program = xelatex
\documentclass[10pt]{beamer}
\usetheme{Warsaw}
\usepackage{multicol}%
\usepackage{enumitem}
\usepackage{fontspec}
\usepackage{polyglossia}
\setbeamertemplate{section in toc}[circle]
\setbeamertemplate{frametitle continuation}{\gdef\beamer@frametitle{}} % framebreaks without numbering
\setbeamertemplate{frametitle}[default][right]% align the frametitle to the right
%\setdefaultlanguage{english}
\setmainlanguage{english}
\setotherlanguage{arabic}
\setmainfont{Times New Roman}
\setotherlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{Times New Roman}%
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1]{Times New Roman}%
\graphicspath{{pics/}}
%
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand{\ar}{\textarabic} % to change the laguage in the section and frame title to persian
% This work as: \a{متن فارسی}
%~~~~~~~~~~~~~~~~define bullet for enumerate~~~~~~~~~~~~~
\newcommand{\myenum}[1]
{
\par\vspace{3pt}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.8}\pgftext{\normalsize \pgfuseshading{bigsphere}}}
{\pgftransformshift{\pgfpoint{0pt}{0.5pt}}
\pgftext{\usebeamerfont*{item projected}\textcolor{white}{#1}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
%~~~~~~~~~~~~~~~~~~define bullet for itemize~~~~~~~~~~~~~~~
\newcommand{\myitem}{\par\vspace{3pt}\hspace{5mm}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.1}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
%~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand{\myitemII}{\par\vspace{3pt}\hspace{5mm}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{1.8}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
\setbeamertemplate{section in toc}{%
\setRTL \myenum{\inserttocsectionnumber}
\inserttocsection\par
}
\setbeamertemplate{subsection in toc}{%
\setRTL \myitem
\inserttocsubsection\par%
}
\setbeamertemplate{subsubsection in toc}{%
\setRTL \rightskip=3ex\myitem
\inserttocsubsection\par%
}
\begin{document}
%\selectlanguage{arabic}
\title{\textarabic{بعنوان عنوان نعنوان }}
\author{AUTHOR}
\date{\today}
\frame{\titlepage}
\frame{
\frametitle{\textarabic{فهرست مطالب}}
\begin{minipage}{1.\textwidth}
\begin{Arabic}
\RLmulticolcolumns
\begin{multicols}{2} 
\tableofcontents
\end{multicols}
\end{Arabic}
\end{minipage}
}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\section{Title}
\subsection{Title}
\subsubsection{Title}
\frame{
\frametitle{\textarabic{سیستمهای فرمیونی همبسته:مایع}}
\begin{minipage}{.95\textwidth}
\begin{Arabic}
\begin{itemize}[label=\protect\myitemII, rightmargin=0mm]
\item
\ar{متن فارسی .....}
\ar{متن فارسی .....}
\item
\ar{متن فارسی .....}
\item
\ar{متن فارسی .....}
\item
\ar{متن فارسی .....}
\end{itemize}           
\ar{متن فارسی .....}            
\end{Arabic}
\end{minipage}
}
\end{document}

相關內容