LTR text where it should be RTL (right to left) in beamer list second level

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}


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}


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}{.......} ) Jun 18 '18 at 5:33
• Any help to automate your solution Jun 19 '18 at 8:36
• @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... Jun 19 '18 at 8:46

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