Lyx、Beamer 和 itemize

Lyx、Beamer 和 itemize

因此,我尝试使用 LyX 和 Beamer 来创建演示文稿。当我尝试在 LyX 中使用 itemize 时,我希望它看起来像这样:

\begin{itemize}\raggedleft
\item ניסיון
\end{itemize}

我可以不手动输入 LaTeX 代码来做到这一点吗?谢谢。

编辑:这是一个例子:

%% LyX 2.3.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,hebrew]{beamer}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Frank Ruehl CLM}
\setsansfont[Mapping=tex-text]{Simple CLM}
\setmonofont{Miriam Mono CLM}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
% (ERT) argument for the TOC
\AtBeginDocument{%
  \let\origtableofcontents=\tableofcontents
  \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
  \def\gobbletableofcontents#1{\origtableofcontents}
}

\@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{polyglossia}
\usetheme{Berlin}

% RTL frame title
\setbeamertemplate{frametitle}
{\vspace*{-1mm}
\nointerlineskip
\begin{beamercolorbox}[sep=0.3cm,ht=2.2em,wd=\paperwidth]{frametitle}
   \vbox{}\vskip-2ex%
   \strut\hskip1ex\insertframetitle\strut
   \vskip-0.8ex%
\end{beamercolorbox}
 }
% RTL triangle for itemize
\setbeamertemplate{itemize item}  
{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleleft$}}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\begin{frame}{שקף ראשון}
\begin{itemize}
\item בלה
\item בלה
\end{itemize}
\end{frame}

\end{document}

这是使用 XeTeX 的结果: 这是结果(使用 XeTeX)

答案1

您可以用以下方式替换和\raggedright定义中的硬编码:itemizeenumeration\raggedleft

% !TeX TS-program = xelatex

\documentclass[english,hebrew]{beamer}
\usepackage{fontspec}
\setsansfont[Mapping=tex-text]{Arial}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
% (ERT) argument for the TOC
\AtBeginDocument{%
  \let\origtableofcontents=\tableofcontents
  \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
  \def\gobbletableofcontents#1{\origtableofcontents}
}

\@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{polyglossia}
\usetheme{Berlin}

% RTL frame title
\setbeamertemplate{frametitle}
{\vspace*{-1mm}
\nointerlineskip
\begin{beamercolorbox}[sep=0.3cm,ht=2.2em,wd=\paperwidth]{frametitle}
   \vbox{}\vskip-2ex%
   \strut\hskip1ex\insertframetitle\strut
   \vskip-0.8ex%
\end{beamercolorbox}
 }
% RTL triangle for itemize
\setbeamertemplate{itemize item}  
{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleleft$}}


\renewcommand{\itemize}[1][]{%
  \ifblank{#1}{}{\def\beamer@defaultospec{#1}}%
  \ifnum \@itemdepth >2\relax\@toodeep\else
    \advance\@itemdepth\@ne
    \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
    \usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
    \list
      {\usebeamertemplate{itemize \beameritemnestingprefix item}}
      {\def\makelabel##1{%
          {%
            \hss\llap{{%
                \usebeamerfont*{itemize \beameritemnestingprefix item}%
                \usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
          }%
        }%
      }
  \fi%
  \beamer@cramped%
%  \raggedright%
    \raggedleft%
  \beamer@firstlineitemizeunskip%
}


\def\beamer@enum@{%
  \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
  \usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
  \usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
  \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
  \expandafter
    \list
      {\usebeamertemplate{\beamer@enumtempl}}
      {\usecounter\@enumctr%
        \def\makelabel##1{{\hss\llap{{%
                \usebeamerfont*{enumerate \beameritemnestingprefix item}%
                \usebeamercolor[fg]{enumerate \beameritemnestingprefix item}##1}}}}}%
  \beamer@cramped%
%  \raggedright%
    \raggedleft%
  \beamer@firstlineitemizeunskip%
}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\begin{frame}{שקף ראשון}
\begin{itemize}
\item בלה
\item בלה
\end{itemize}

\begin{enumerate}
\item בלה
\item בלה
\end{enumerate}
\end{frame}

\end{document}

在此处输入图片描述

相关内容