如何在 beamer 中为 enumerate (myenum) 和 itemize (myenum) 定义不同的项目符号样式,正如你在我的 MWE 中看到的那样,只有大球体我想创建具有不同颜色的其他形状(例如正方形或圆形),这是我的 MWE:
\documentclass[10pt]{beamer}
\usetheme[secheader]{Madrid}
\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}%
}}
%*************************************************************************
%\addtobeamertemplate{block begin}{}{\justifying} %new code
\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}
\tableofcontents
\end{Arabic}
\end{minipage}
}
\section{\textarabic{مقدمه}}
\subsection{\textarabic{مایع }}
\subsubsection{\textarabic{مایع }}
{
\frametitle{\textarabic{سیستمهای فرمیونی همبسته:مایع}}
\begin{minipage}{.95\textwidth}
\begin{Arabic}% ----------------------here must be changed
%
\begin{itemize}[label=\protect\myitemII, rightmargin=0mm]
\item
\ar{متن فارسی .....}
\ar{متن فارسی .....}
\item
\ar{متن فارسی .....}
{متن فارسی .....}
\item
\ar{متن فارسی .....}
\end{itemize}
\ar{متن فارسی .....}
\begin{enumerate}[label=\protect\myenum{\arabic*}]
\item
\ar{نص عربي }
\item
\ar{نص عربي }
\item
\ar{نص عربي }
\end{enumerate}
\ar{متن فارسی .....}
\end{Arabic}
\end{minipage}
}
\end{document}
答案1
我宁愿使用 beamers 自己的机制在不同的项目模板和颜色之间切换:
% !TeX TS-program = xelatex
\documentclass[10pt]{beamer}
\usetheme[secheader]{Madrid}
\usepackage{tikzducks} % just for the last example
\usepackage{fontspec}
\usepackage{polyglossia}
\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}%
\newcommand{\ar}{\textarabic} % to change the laguage in the section and frame title to persian
\begin{document}
\begin{frame}
\begin{minipage}{.95\textwidth}
\begin{Arabic}
{
\setbeamertemplate{itemize item}[default]
\begin{itemize}
\raggedleft
\item \ar{متن فارسی .....}
\end{itemize}
}
{
\setbeamertemplate{itemize item}[bullet]
\begin{itemize}
\raggedleft
\item \ar{متن فارسی .....}
\end{itemize}
}
{
\setbeamertemplate{itemize item}[circle]
\setbeamercolor{itemize item}{fg=red}
\begin{itemize}
\raggedleft
\item \ar{متن فارسی .....}
\end{itemize}
}
{
\setbeamertemplate{itemize item}[square]
\begin{itemize}
\raggedleft
\item \ar{متن فارسی .....}
\end{itemize}
}
{
\setbeamertemplate{itemize item}{%
\begin{tikzpicture}[scale=0.15]
\duck
\end{tikzpicture}
}
\begin{itemize}
\raggedleft
\item \ar{متن فارسی .....}
\end{itemize}
}
\end{Arabic}
\end{minipage}
\end{frame}
\end{document}