7

I have this example of writing right to left list in beamer

\documentclass{beamer}
\usefonttheme{serif}
\usepackage{bidi}

\setbeamertemplate{enumerate item}[circle]
\setbeamertemplate{itemize subitem}[circle]

\begin{document}

\begin{frame}{Frame title}

\setRTL    
\raggedleft

  \begin{enumerate}\raggedleft
  \item Data may be missing
    \begin{itemize}\raggedleft
    \item This makes the problem complete 
    \item even for very restricted cases
    \end{itemize}  % \par solve the problem but add extra space
   this text from right to left   % <-- problem here 
 \end{enumerate}
\end{frame}

\end{document}

enter image description here

The text which comes after the second level list is left to right where it should be right to left. The problem does not appear with other class

\documentclass{article}
\usepackage{bidi}

\renewcommand{\labelenumi}{\arabic{enumi}\null-}
\begin{document}

\setRTL    

 \begin{enumerate}
  \item Data may be missing
    \begin{itemize}
    \item This makes the problem complete 
    \item even for very restricted cases
    \end{itemize} 
   this text from right to left   
 \end{enumerate}

\end{document}

enter image description here

3

How about using the solution you already found with starting a new paragraph and undoing the additional space?

% !TeX TS-program = xelatex
\documentclass{beamer}
\usefonttheme{serif}
\usepackage{bidi}

\setbeamertemplate{enumerate item}[circle]
\setbeamertemplate{itemize subitem}[circle]

\begin{document}

\begin{frame}{Frame title}

\setRTL    
\raggedleft

  \begin{enumerate}\raggedleft
  \item Data may be missing
    \begin{itemize}\raggedleft
    \item This makes the problem complete 
    \item even for very restricted cases
    \end{itemize}  % \par solve the problem but add extra space
    \vspace{-\baselineskip}

   this text from right to left   % <-- problem here 
 \end{enumerate}
\end{frame}

\end{document}
  • I know this, what I can't understand is what's cause this. and how can I do this solution for every like situations ( perhaps \usebeamertemplate{itemize/enumerate subbody end}{.......} ) – Salim Bou Jun 18 '18 at 5:33
  • Any help to automate your solution – Salim Bou Jun 19 '18 at 8:36
  • 1
    @SalimBou Unfortunately I don't understand the mechanism of bidi enough to help with an automated solution. To analysis the problem: beamer redefined itemize and enumerate environments to make them overlay aware - thus they are defined slightly different than in normal document classes and the fixes bidi applies don't work any longer. However I don't really know what exactly would have to be changed... – user36296 Jun 19 '18 at 8:46
1

I hope I understood your question correctly. My train of thought was the following:

The "problem text" can be understood as an \item, except that the "bulletpoint" (the sign before the text) is omitted.

This can be done as follows:

\documentclass{beamer}
\usefonttheme{serif}
\usepackage{bidi}

\setbeamertemplate{enumerate item}[circle]
\setbeamertemplate{itemize subitem}[circle]

\begin{document}

\begin{frame}{Frame title}

\setRTL    
\raggedleft

  \begin{enumerate}\raggedleft
  \item Data may be missing
    \begin{itemize}\raggedleft
    \item This makes the problem complete 
    \item even for very restricted cases
    \end{itemize}  % \par solve the problem but add extra space 
    \vspace{-.6cm}
   \item[] \hspace{2cm} this text from right to left   % <-- problem was here 
 \end{enumerate}
\end{frame}

\end{document}

(The \hspace{2cm} command is just to show that you can move the text anywhere in the horizontal direction – analogous to the \vspace{-.6cm} command.)

  • Welcome to TeX.Stackexchange! – user36296 Jun 17 '18 at 11:07
  • Sure, I've already thought of your solution, but because I was unsure how exactly the solution has to look like, I gave my source code a kind of "free space", so that you can almost (if you want) change the necessary things directly (a kind of template /Mask). But thanks for the hint! ;) – user165228 Jun 17 '18 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.