From c2f884c98cd0f2ffdf2b5d3d2b6e1a840db656e5 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 6 Jun 2022 20:29:58 +0000
Subject: bidi (6jun22)

git-svn-id: svn://tug.org/texlive/trunk@63499 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/source/xelatex/bidi/bidi.dtx | 553 +++++++++++++++++++++++--
 1 file changed, 527 insertions(+), 26 deletions(-)

(limited to 'Master/texmf-dist/source/xelatex/bidi/bidi.dtx')

diff --git a/Master/texmf-dist/source/xelatex/bidi/bidi.dtx b/Master/texmf-dist/source/xelatex/bidi/bidi.dtx
index 8ca3b27d8b4..d4571534829 100644
--- a/Master/texmf-dist/source/xelatex/bidi/bidi.dtx
+++ b/Master/texmf-dist/source/xelatex/bidi/bidi.dtx
@@ -5,7 +5,7 @@
 %<*readme>
 ___________________
 The bidi package
-v37.2
+v37.3
 
 This package provides a convenient interface for typesetting
 bidirectional texts in Plain TeX and LaTeX, using XeTeX engine.
@@ -30,7 +30,7 @@ The announcements for the new releases of the package will
 also appear in the Discussions space under the Announcements
 category.
   
-Current version release date: 2022/06/01
+Current version release date: 2022/06/06
 
 ___________________________________________
 Vafa Khalighi
@@ -90,8 +90,11 @@ by Vafa Khalighi.
 \generate{\file{beamerbaseframecomponents-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerbaseframecomponents-xetex-bidi.def}}}
 \generate{\file{beamerbaselocalstructure-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerbaselocalstructure-xetex-bidi.def}}}
 \generate{\file{beamerinnerthemedefault-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerinnerthemedefault-xetex-bidi.def}}}
+\generate{\file{beamerinnerthemecircles-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerinnerthemecircles-xetex-bidi.def}}}
+\generate{\file{beamerinnerthemerectangles-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerinnerthemerectangles-xetex-bidi.def}}}
 \generate{\file{beamerinnerthemerounded-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerinnerthemerounded-xetex-bidi.def}}}
 \generate{\file{beamerouterthemeinfolines-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerouterthemeinfolines-xetex-bidi.def}}}
+\generate{\file{beamerouterthemesidebar-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerouterthemesidebar-xetex-bidi.def}}}
 \generate{\file{beamerouterthemesplit-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerouterthemesplit-xetex-bidi.def}}}
 \generate{\file{beamerouterthemeshadow-xetex-bidi.def}{\from{\jobname.dtx}{table,beamerouterthemeshadow-xetex-bidi.def}}}
 \generate{\file{bidi.sty}{\from{\jobname.dtx}{table,bidi.sty}}}
@@ -158,6 +161,7 @@ by Vafa Khalighi.
 \generate{\file{lettrine-xetex-bidi.def}{\from{\jobname.dtx}{table,lettrine-xetex-bidi.def}}}
 \generate{\file{lineno-xetex-bidi.def}{\from{\jobname.dtx}{table,lineno-xetex-bidi.def}}}
 \generate{\file{listings-xetex-bidi.def}{\from{\jobname.dtx}{table,listings-xetex-bidi.def}}}
+\generate{\file{lstmisc-xetex-bidi.def}{\from{\jobname.dtx}{table,lstmisc-xetex-bidi.def}}}
 \generate{\file{loadingorder-xetex-bidi.def}{\from{\jobname.dtx}{table,loadingorder-xetex-bidi.def}}}
 \generate{\file{longtable-xetex-bidi.def}{\from{\jobname.dtx}{table,longtable-xetex-bidi.def}}}
 \generate{\file{lscape-xetex-bidi.def}{\from{\jobname.dtx}{table,lscape-xetex-bidi.def}}}
@@ -246,7 +250,7 @@ by Vafa Khalighi.
 \documentclass{ltxdoc}
 \input{bidi-doc-preamble.ltx}
 \hypersetup{%
-  pdftitle={Source documentation for version 37.2 of the bidi
+  pdftitle={Source documentation for version 37.3 of the bidi
                 package}%
 }
 \EnableCrossrefs
@@ -265,7 +269,7 @@ by Vafa Khalighi.
 % \GetFileInfo{\jobname.dtx}
 % \title{\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}}\\
 %\LARGE Bidirectional typesetting in plain \TeX{} and \LaTeX, using \XeTeX{} engine\\[5pt]
-%\large Source documentation for \textcolor{blue!65!black}{version 37.2}}
+%\large Source documentation for \textcolor{blue!65!black}{version 37.3}}
 % \author{Vafa Khalighi\thanks{Thanks to the bidi-tex GitHub organization consisted of David Carlisle and other members of the  {\LaTeX} team to maintain the package in the period 2018--2020.}}
 %\setcounter{page}{0}
 %\thispagestyle{empty}
@@ -275,7 +279,7 @@ by Vafa Khalighi.
 %\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}}
 %
 %\Large
-%Source documentation for \textcolor{blue!65!black}{version 37.2}}
+%Source documentation for \textcolor{blue!65!black}{version 37.3}}
 %
 %\vskip 0pt plus 3fill
 %\textit{\large to my Master, \textbf{Ferdowsi The Great}}
@@ -324,7 +328,7 @@ by Vafa Khalighi.
 %\iffalse
 %<*table>
 %\fi
-%% \CheckSum{52449}
+%% \CheckSum{53104}
 %% \CharacterTable
 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -1943,7 +1947,12 @@ by Vafa Khalighi.
 %\fi
 % \section{File \texttt{beamer-xetex-bidi.def}}
 %    \begin{macrocode}
-\ProvidesFile{beamer-xetex-bidi.def}[2022/05/24 v0.1 bidi adaptations for beamer class for XeTeX engine]
+\ProvidesFile{beamer-xetex-bidi.def}[2022/06/06 v0.2 bidi adaptations for beamer class for XeTeX engine]
+\bidi@patchcmd{\mathdisplay}{\else}{%
+  \else
+  \rightskip\z@
+}{}{}
+
 \AtBeginDocument{%
   \if@RTLmain
     \raggedleft
@@ -1951,6 +1960,7 @@ by Vafa Khalighi.
     \raggedright
   \fi  
 }
+
 \renewcommand*{\bidi@beamer@ragged}{%
   \if@RTL
     \raggedleft
@@ -1958,6 +1968,8 @@ by Vafa Khalighi.
     \raggedright
   \fi
 }
+
+
 %    \end{macrocode}
 % \iffalse
 %</beamer-xetex-bidi.def>
@@ -1965,7 +1977,165 @@ by Vafa Khalighi.
 %\fi
 % \section{File \texttt{beamerbaseauxtemplates-xetex-bidi.def}}
 %    \begin{macrocode}
-\ProvidesFile{beamerbaseauxtemplates-xetex-bidi.def}[2022/06/01 v0.1 bidi adaptations for beamerbaseauxtemplates package for XeTeX engine]
+\ProvidesFile{beamerbaseauxtemplates-xetex-bidi.def}[2022/06/06 v0.2 bidi adaptations for beamerbaseauxtemplates package for XeTeX engine]
+\bidi@csundef{beamer@@tmpop@section in toc@circle}
+
+\bidi@csundef{beamer@@tmpop@subsection in toc@circle}
+
+\bidi@csundef{beamer@@tmpop@subsubsection in toc@circle}
+
+\defbeamertemplate{section in toc}{circle}
+{\leavevmode\bidi@beamer@leftskip=2ex%
+  \llap{%
+    \usebeamerfont*{section number projected}%
+    \usebeamercolor{section number projected}%
+    \begin{pgfpicture}{-1ex}{0ex}{1ex}{2ex}
+      \color{bg}
+      \pgfpathcircle{\pgfpoint{0pt}{.75ex}}{1.2ex}
+      \pgfusepath{fill}
+      \pgftext[base]{\color{fg}\inserttocsectionnumber}
+    \end{pgfpicture}\kern1.25ex%
+  }%
+  \inserttocsection\par}
+
+\defbeamertemplate{subsection in toc}{circle}
+{\leavevmode\bidi@beamer@leftskip=2em\inserttocsubsection\par}
+
+\defbeamertemplate{subsubsection in toc}{circle}
+{\leavevmode\normalsize\usebeamerfont{subsection in
+    toc}\bidi@beamer@leftskip=3em\usebeamerfont{subsubsection in toc}%
+  \inserttocsubsubsection\par}
+
+\bidi@csundef{beamer@@tmpop@section in toc@square}
+
+\bidi@csundef{beamer@@tmpop@subsection in toc@square}
+
+\bidi@csundef{beamer@@tmpop@subsubsection in toc@square}
+
+\bidi@csundef{beamer@@tmpop@enumerate item@square}
+
+\bidi@csundef{beamer@@tmpop@enumerate subitem@square}
+
+\bidi@csundef{beamer@@tmpop@enumerate subsubitem@square}
+
+\bidi@csundef{beamer@@tmpop@enumerate mini template@square}
+
+\defbeamertemplate{section in toc}{square}
+{\leavevmode\bidi@beamer@leftskip=1.75ex%
+  \llap{{%
+    \usebeamerfont*{section number projected}%
+    \usebeamercolor[bg]{section number projected}%
+    \if@RTL
+    \else
+      \vrule width2.25ex height1.85ex depth.4ex%
+      \hskip-2.25ex%
+    \fi
+    \hbox to2.25ex{{\hfil\color{fg}\inserttocsectionnumber\hfil}}%
+    \if@RTL
+      \hskip-2.25ex%
+      \vrule width2.25ex height1.85ex depth.4ex%
+    \fi
+    }}%
+  \kern1.25ex\inserttocsection\par}
+  
+\defbeamertemplate{subsection in toc}{square}
+{\leavevmode\bidi@beamer@leftskip=5ex\llap{{%
+    \usebeamercolor[bg]{subsection number projected}%
+    \vrule width1ex height1ex\kern1ex}}\inserttocsubsection\par}
+    
+\defbeamertemplate{subsubsection in toc}{square}
+{\leavevmode\normalsize\usebeamerfont{subsection in
+    toc}\bidi@beamer@leftskip=7ex\usebeamerfont{subsubsection in toc}%
+  \llap{{%
+    \usebeamercolor[bg]{subsubsection number projected}%
+    \vrule width0.75ex height0.75ex\kern1ex}}\inserttocsubsubsection\par}
+    
+\defbeamertemplate{enumerate item}{square}
+{
+  \hbox{{%
+    \usebeamerfont*{item projected}%
+    \usebeamercolor[bg]{item projected}%
+    \if@RTL
+    \else
+      \vrule width2.25ex height1.85ex depth.4ex%
+      \hskip-2.25ex%
+    \fi
+    \hbox to2.25ex{{%
+      \hfil%
+      \color{fg}\insertenumlabel%
+      \hfil}}%
+      \if@RTL
+        \hskip-2.25ex%
+        \vrule width2.25ex height1.85ex depth.4ex%
+      \fi
+  }}%
+}
+[action]
+{\setbeamerfont{item projected}{size=\scriptsize}}
+
+\defbeamertemplate{enumerate subitem}{square}
+{
+  \hbox{{%
+    \usebeamerfont*{subitem projected}%
+    \usebeamercolor[bg]{subitem projected}%
+    \if@RTL
+    \else
+      \vrule width2.25ex height1.85ex depth.4ex%
+      \hskip-2.25ex%
+    \fi
+    \hbox to2.25ex{{%
+      \hfil%
+      \color{fg}\insertsubenumlabel%
+      \hfil}}%
+      \if@RTL
+        \hskip-2.25ex%
+        \vrule width2.25ex height1.85ex depth.4ex%
+      \fi
+  }}%
+}
+
+\defbeamertemplate{enumerate subsubitem}{square}
+{
+  \hbox{{%
+    \usebeamerfont*{subitem projected}%
+    \usebeamercolor[bg]{subsubitem projected}%
+    \if@RTL
+    \else
+      \vrule width2.25ex height1.85ex depth.4ex%
+      \hskip-2.25ex%
+    \fi
+    \hbox to2.25ex{{%
+      \hfil%
+      \color{fg}\insertsubsubenumlabel%
+      \hfil}}%
+      \if@RTL
+        \hskip-2.25ex%
+        \vrule width2.25ex height1.85ex depth.4ex%
+      \fi
+  }}%
+}
+
+\defbeamertemplate{enumerate mini template}{square}
+{
+  \hbox{{%
+    \usebeamerfont*{\beameritemnestingprefix item projected}%
+    \usebeamercolor[bg]{\beameritemnestingprefix item projected}%
+    \if@RTL
+    \else
+      \vrule width2.25ex height1.85ex depth.4ex%
+      \hskip-2.25ex%
+    \fi
+    \hbox to2.25ex{{%
+      \hfil%
+      \color{fg}\insertenumlabel%
+      \hfil}}%
+      \if@RTL
+        \hskip-2.25ex%
+        \vrule width2.25ex height1.85ex depth.4ex%
+      \fi
+  }}%
+}
+
 \bidi@csundef{beamer@@tmpop@section in toc@ball}
 
 \bidi@csundef{beamer@@tmpop@subsection in toc@ball}
@@ -2236,7 +2406,148 @@ by Vafa Khalighi.
 %\fi
 % \section{File \texttt{beamerbaseframecomponents-xetex-bidi.def}}
 %    \begin{macrocode}
-\ProvidesFile{beamerbaseframecomponents-xetex-bidi.def}[2022/05/24 v0.1 bidi adaptations for beamerbaseframecomponents package for XeTeX engine]
+\ProvidesFile{beamerbaseframecomponents-xetex-bidi.def}[2022/06/06 v0.2 bidi adaptations for beamerbaseframecomponents package for XeTeX engine]
+\renewcommand{\setbeamersize}[1]{%
+  \beamer@dogeometryfalse%
+  \setkeys{beamer@margin}{#1}%
+  \ifbeamer@dogeometry%
+    % Reset left margin now
+    \beamer@tempdim=\beamer@leftmargin%
+    \advance\beamer@tempdim by\beamer@leftsidebar%
+    \if@RTLmain
+      \geometry{right=\the\beamer@tempdim}%
+    \else
+      \geometry{left=\the\beamer@tempdim}%
+    \fi
+    % Reset right margin now
+    \beamer@tempdim=\beamer@rightmargin%
+    \advance\beamer@tempdim by\beamer@rightsidebar%
+    \if@RTLmain
+      \geometry{left=\the\beamer@tempdim}%
+    \else
+      \geometry{right=\the\beamer@tempdim}%
+    \fi
+  \fi%
+}
+
+\newcommand*{\bidi@beamer@Gm@lmargin}{%
+  \if@RTLmain
+    \Gm@rmargin
+  \else
+    \Gm@lmargin
+  \fi
+}
+
+\newcommand*{\bidi@beamer@Gm@rmargin}{%
+  \if@RTLmain
+    \Gm@lmargin
+  \else
+    \Gm@rmargin
+  \fi
+}
+
+\def\ps@navigation{
+  \def\@oddhead{%
+    \begingroup%
+    \setbox\beamer@tempbox=\hbox{\usebeamertemplate***{background canvas}\hyper@pagetransition\hyper@pageduration}%
+    \beamer@tempdim=\ht\beamer@tempbox%
+    \setbox\beamer@tempbox=\hbox{\lower\beamer@tempdim\hbox{\box\beamer@tempbox}}%
+    \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+    \setbox\@tempboxa=\hbox{\usebeamertemplate***{background}}%
+    \beamer@tempdim=\ht\@tempboxa%
+    \setbox\@tempboxa=\hbox{\lower\beamer@tempdim\hbox{\box\@tempboxa}}%
+    \wd\@tempboxa=0pt\ht\@tempboxa=0pt\dp\@tempboxa=0pt%
+    \vbox{\hbox{\hskip-\bidi@beamer@Gm@lmargin\box\beamer@tempbox\box\@tempboxa}%
+      \hbox{%
+        {%
+          \setbox\beamer@tempbox=\hbox{\hskip-\bidi@beamer@Gm@lmargin%
+          \if@RTLmain
+                      {%
+              \vbox to \sidebarheight{%
+                \usebeamertemplate***{sidebar left}%
+                \vfil%
+            }}%
+            \hskip-\textwidth
+            \fi
+            {\setbox\beamer@tempbox=\hbox{\vbox to \sidebarheight{%
+                  \usebeamercolor*{sidebar left}%
+                  \usebeamertemplate{sidebar canvas left}%
+                  \vss%
+                }}%
+              \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+              \box\beamer@tempbox}%
+              \if@RTLmain
+              \else
+            {%
+              \vbox to \sidebarheight{%
+                \usebeamertemplate***{sidebar left}%
+                \vfil%
+            }}\fi}%
+          \beamer@tempdim=\ht\beamer@tempbox%
+          \setbox\beamer@tempbox=\hbox{{\lower\beamer@tempdim\hbox{\box\beamer@tempbox}}}%
+          \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+          \box\beamer@tempbox%
+        }%
+        {% print right sidebar first, since it should be overwritten by headline
+          \setbox\beamer@tempbox=\hbox{\hskip\textwidth\hskip\beamer@rightmargin%
+          \if@RTLmain
+                      {%
+              \vbox to \sidebarheight{%
+                \usebeamertemplate***{sidebar right}%
+                \vfil%
+            }}%
+            \hskip-\textwidth
+            \fi
+            {\setbox\beamer@tempbox=\hbox{\vbox to \sidebarheight{%
+                  \usebeamercolor*{sidebar right}%
+                  \usebeamertemplate{sidebar canvas right}%
+                  \vss%
+                }}%
+              \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+              \box\beamer@tempbox}%
+              \if@RTLmain
+              \else
+            {%
+              \vbox to \sidebarheight{%
+                \usebeamertemplate***{sidebar right}%
+                \vfil%
+            }}\fi}%
+          \beamer@tempdim=\ht\beamer@tempbox%
+          \setbox\beamer@tempbox=\hbox{{\lower\beamer@tempdim\hbox{\box\beamer@tempbox}}}%
+          \wd\beamer@tempbox=0pt\ht\beamer@tempbox=0pt\dp\beamer@tempbox=0pt%
+          \box\beamer@tempbox%
+        }%
+        \beamer@typesetheadorfoot{headline}%
+      }%
+      \hfil}%
+    \endgroup}
+  \def\@oddfoot{%
+    \vbox{\offinterlineskip\hbox{\beamer@typesetheadorfoot{footline}%
+    \hfil}\hbox{}}\hfil
+  }%
+  \let\@evenhead\@oddhead
+  \let\@evenfoot\@oddfoot}
+
+\AtBeginDocument{%
+  \pagestyle{navigation}%
+}
+
+\def\beamer@typesetheadorfoot#1{% typeset the head or footline
+  {\parskip0pt\offinterlineskip%
+    \hbox{%
+      \hskip-\bidi@beamer@Gm@lmargin%
+      \hbox{%
+        \vbox{%
+          \@tempdima=\textwidth%
+          \textwidth=\paperwidth%
+          \hsize=\textwidth%
+          \def\\{,}%
+          \usebeamertemplate***{#1}%
+        }}%
+      \hskip-\bidi@beamer@Gm@rmargin%
+    }}\hfil%
+}
+
 \renewcommand<>\beamer@columncom[2][\beamer@colmode]{%
   \beamer@colclose%
   \def\beamer@colclose{\end{minipage}\hfill\end{actionenv}\ignorespaces}%
@@ -2336,8 +2647,9 @@ by Vafa Khalighi.
     \color@endgroup}}
     
 \renewcommand<>\@mpfootnotetext[1]{%
+\ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\if@RTL@footnote\global\let\bidi@mpfootnoterule\right@footnoterule\else\global\let\bidi@mpfootnoterule\left@footnoterule\fi\fi\fi
   \global\setbox\@mpfootins\vbox{%
-    \ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\if@RTL@footnote\global\let\bidi@mpfootnoterule\right@footnoterule\else\global\let\bidi@mpfootnoterule\left@footnoterule\fi\fi\fi
+    \if@RTL@footnote\@RTLtrue\else\@RTLfalse\fi
     \unvbox\@mpfootins
     \reset@font
     \bidi@@footnotetext@font
@@ -2351,8 +2663,9 @@ by Vafa Khalighi.
     \color@endgroup}}
     
 \renewcommand<>\@mpRTLfootnotetext[1]{%
+\ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\global\let\bidi@mpfootnoterule\right@footnoterule\fi\fi
   \global\setbox\@mpfootins\vbox{%
-  \ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\global\let\bidi@mpfootnoterule\right@footnoterule\fi\fi
+     \@RTLtrue
     \unvbox\@mpfootins
     \reset@font
     \bidi@@RTLfootnotetext@font
@@ -2366,8 +2679,9 @@ by Vafa Khalighi.
     \color@endgroup}}
     
 \renewcommand<>\@mpLTRfootnotetext[1]{%
+\ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\global\let\bidi@mpfootnoterule\left@footnoterule\fi\fi
   \global\setbox\@mpfootins\vbox{%
-  \ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\global\let\bidi@mpfootnoterule\left@footnoterule\fi\fi
+  \@RTLfalse
     \unvbox\@mpfootins
     \reset@font
     \bidi@@LTRfootnotetext@font
@@ -2436,7 +2750,7 @@ by Vafa Khalighi.
         \csname c@\beamer@mpfn\endcsname\beamer@footarg\relax
         \unrestored@protected@xdef\@thefnmark{\beamer@thempfn}%
       \endgroup
-      \@footnotemark\beamer@footnotetext#2}%
+      \@footnotemark\beamer@RTLfootnotetext#2}%
   \fi%
   \beamer@next}
   
@@ -2462,7 +2776,7 @@ by Vafa Khalighi.
         \csname c@\beamer@mpfn\endcsname\beamer@footarg\relax
         \unrestored@protected@xdef\@thefnmark{\beamer@thempfn}%
       \endgroup
-      \@footnotemark\beamer@footnotetext#2}%
+      \@footnotemark\beamer@LTRfootnotetext#2}%
   \fi%
   \beamer@next}
   
@@ -2567,7 +2881,7 @@ by Vafa Khalighi.
 %\fi
 % \section{File \texttt{beamerinnerthemedefault-xetex-bidi.def}}
 %    \begin{macrocode}
-\ProvidesFile{beamerinnerthemedefault-xetex-bidi.def}[2022/06/01 v0.2 bidi adaptations for beamerinnerthemedefault package for XeTeX engine]
+\ProvidesFile{beamerinnerthemedefault-xetex-bidi.def}[2022/06/06 v0.2 bidi adaptations for beamerinnerthemedefault package for XeTeX engine]
 \newcommand*{\bidi@beamer@leftskip}{%
   \if@RTL
     \rightskip
@@ -2615,24 +2929,48 @@ by Vafa Khalighi.
 
 \bidi@undef\beamer@@tmpop@footnote@default
 
+\newcommand*{\bidi@beamer@@footnote@ragged}{%
+  \if@RTL
+    \bidi@beamer@@footnote@raggedleft
+  \else
+    \bidi@beamer@@footnote@raggedright
+  \fi
+}
+
+\newcommand*{\bidi@beamer@@footnote@raggedright}{%
+  \if@hboxRconstruct
+    \raggedleft
+  \else
+    \raggedright
+  \fi
+}
+
+\newcommand*{\bidi@beamer@@footnote@raggedleft}{%
+  \if@hboxRconstruct
+    \raggedright
+  \else
+    \raggedleft
+  \fi
+}
+
 \defbeamertemplate*{footnote}{default}
 {
   \parindent 1em\noindent%
-  \bidi@beamer@ragged
+  \bidi@beamer@@footnote@ragged
   \hbox to 1.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
 }
 
 \defbeamertemplate*{RTLfootnote}{default}
 {
   \parindent 1em\noindent%
-  \raggedleft
+  \bidi@beamer@@footnote@raggedleft
   \hbox to 1.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
 }
 
 \defbeamertemplate*{LTRfootnote}{default}
 {
   \parindent 1em\noindent%
-  \raggedright
+  \bidi@beamer@@footnote@raggedright
   \hbox to 1.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
 }
 
@@ -2655,6 +2993,27 @@ by Vafa Khalighi.
 %    \end{macrocode}
 % \iffalse
 %</beamerinnerthemedefault-xetex-bidi.def>
+%<*beamerinnerthemecircles-xetex-bidi.def>
+%\fi
+% \section{File \texttt{beamerinnerthemecircles-xetex-bidi.def}}
+%    \begin{macrocode}
+\ProvidesFile{beamerinnerthemecircles-xetex-bidi.def}[2022/06/06 v0.1 bidi adaptations for beamerinnerthemecircles package for XeTeX engine]
+\setbeamertemplate{sections/subsections in toc}[circle]
+
+%    \end{macrocode}
+% \iffalse
+%</beamerinnerthemecircles-xetex-bidi.def>
+%<*beamerinnerthemerectangles-xetex-bidi.def>
+%\fi
+% \section{File \texttt{beamerinnerthemerectangles-xetex-bidi.def}}
+%    \begin{macrocode}
+\ProvidesFile{beamerinnerthemerectangles-xetex-bidi.def}[2022/06/06 v0.1 bidi adaptations for beamerinnerthemerectangles package for XeTeX engine]
+\setbeamertemplate{sections/subsections in toc}[square]
+\setbeamertemplate{items}[square]
+
+%    \end{macrocode}
+% \iffalse
+%</beamerinnerthemerectangles-xetex-bidi.def>
 %<*beamerinnerthemerounded-xetex-bidi.def>
 %\fi
 % \section{File \texttt{beamerinnerthemerounded-xetex-bidi.def}}
@@ -2702,6 +3061,116 @@ by Vafa Khalighi.
 %    \end{macrocode}
 % \iffalse
 %</beamerouterthemeinfolines-xetex-bidi.def>
+%<*beamerouterthemesidebar-xetex-bidi.def>
+%\fi
+% \section{File \texttt{beamerouterthemesidebar-xetex-bidi.def}}
+%    \begin{macrocode}
+\ProvidesFile{beamerouterthemesidebar-xetex-bidi.def}[2022/06/06 v0.1 bidi adaptations for beamerouterthemesidebar package for XeTeX engine]
+\bidi@csundef{beamer@@tmpop@frametitle@sidebar theme}
+
+\bidi@csundef{beamer@@tmpop@headline@sidebar theme}
+
+\bidi@csundef{beamer@@tmpop@sidebar left@sidebar theme}
+
+\bidi@csundef{beamer@@tmpop@sidebar right@sidebar theme}
+
+\ifdim\beamer@headheight>0pt
+
+  \defbeamertemplate*{frametitle}{sidebar theme}
+  {%
+    \nointerlineskip%
+    \ifbeamer@plainframe%
+      \hbox{\usebeamercolor[bg]{frametitle}%
+        \@tempdima\paperwidth\advance\@tempdima-\beamer@sidebarwidth
+        \hskip-\beamer@leftmargin\vrule height\beamer@headheight width\@tempdima\hskip-\beamer@rightmargin}%
+      \nointerlineskip%
+    \fi%
+    \vskip-\beamer@headheight%
+    \vbox to \beamer@headheight{%
+      \vfil
+      \bidi@beamer@leftskip=-\beamer@leftmargin%
+      \advance\bidi@beamer@leftskip by0.3cm%
+      \bidi@beamer@rightskip=-\beamer@rightmargin%
+      \advance\bidi@beamer@rightskip by0.3cm plus1fil%
+      {\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\strut\insertframetitle\par}%
+      \ifx\insertframesubtitle\@empty\else%
+        {\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\strut\insertframesubtitle\par}%
+      \fi%
+      \vbox{}%
+      \vskip-1em%
+      \vfil
+    }%
+  }
+
+  \defbeamertemplate*{headline}{sidebar theme}
+  {%
+    \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
+      \ifx\beamer@sidebarside\beamer@lefttext%
+      \else%
+        \hfill%
+      \fi%
+      \ifdim\beamer@sidebarwidth>0pt%  
+        \bgroup
+        \usebeamercolor[bg]{logo}%
+        \if@RTLmain
+        \else
+          \vrule width\beamer@sidebarwidth height \beamer@headheight%
+          \hskip-\beamer@sidebarwidth%
+        \fi
+        \hbox to \beamer@sidebarwidth{\hss\vbox to
+          \beamer@headheight{\vss\hbox{{\color{fg}\insertlogo}}\vss}\hss}%
+          \if@RTLmain
+            \hskip-\beamer@sidebarwidth%
+            \vrule width\beamer@sidebarwidth height \beamer@headheight%
+          \fi
+          \egroup
+      \else%
+        \vrule width0pt height \beamer@headheight%  
+      \fi%
+    \end{beamercolorbox}
+  }
+\fi
+
+\ifdim\beamer@sidebarwidth>0pt
+
+\AtBeginDocument{%
+  \setbeamersize{sidebar width \beamer@sidebarside=\beamer@sidebarwidth}%
+}
+
+  \defbeamertemplate*{sidebar \beamer@sidebarside}{sidebar theme}
+  {
+    \beamer@tempdim=\beamer@sidebarwidth%
+    \advance\beamer@tempdim by -6pt%
+    {\usebeamerfont{title in sidebar}%
+      \vskip1.5em%
+      \hskip3pt%
+      \bgroup
+      \usebeamercolor[fg]{title in sidebar}%
+      \insertshorttitle[width=\beamer@tempdim,center,respectlinebreaks]\egroup\par%
+      \vskip1.25em%
+    }%
+    {%
+      \hskip3pt%
+      \bgroup
+      \usebeamercolor[fg]{author in sidebar}%
+      \usebeamerfont{author in sidebar}%
+      \insertshortauthor[width=\beamer@tempdim,center,respectlinebreaks]\egroup\par%
+      \vskip1.25em%
+    }%
+    \insertverticalnavigation{\beamer@sidebarwidth}%
+    \vfill
+    \ifx\beamer@sidebarside\beamer@lefttext%
+    \else%
+      \usebeamercolor{normal text}%
+      \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
+      \vskip2pt%
+    \fi%
+  }%
+\fi
+
+%    \end{macrocode}
+% \iffalse
+%</beamerouterthemesidebar-xetex-bidi.def>
 %<*beamerouterthemesplit-xetex-bidi.def>
 %\fi
 % \section{File \texttt{beamerouterthemesplit-xetex-bidi.def}}
@@ -2787,8 +3256,8 @@ by Vafa Khalighi.
 % \section{File \texttt{bidi.sty}}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\def\bididate{2022/06/01}
-\def\bidi@version{37.2}
+\def\bididate{2022/06/06}
+\def\bidi@version{37.3}
 \ProvidesPackage{bidi}[\bididate\space v\bidi@version\space
 Bidirectional typesetting in plain TeX and LaTeX]
 \edef\@bidi@info{****************************************************^^J%
@@ -2876,7 +3345,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
 }
 \newcommand*{\@bidi@pdfcustomproperties}{%
   This is the bidi package, Version \bidi@version,
-  Released June 1, 2022. 
+  Released June 6, 2022. 
 }
 \newcommand*{\bidi@beamer@ragged}{}
 \@RTLmainfalse
@@ -3120,9 +3589,9 @@ Bidirectional typesetting in plain TeX and LaTeX]
 %\fi
 % \section{File \texttt{bidi.tex}}
 %    \begin{macrocode}
-\def\bididate{2022/06/01}
+\def\bididate{2022/06/06}
 \catcode`@=11
-\def\bidi@version{37.2}
+\def\bidi@version{37.3}
 \let \protect \relax
 \newlinechar`\^^J
 \edef\@bidi@info{****************************************************^^J%
@@ -3224,7 +3693,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
 }
 \def\@bidi@pdfcustomproperties{%
   This is the bidi package, Version \bidi@version,
-  Released June 1, 2022. 
+  Released June 6, 2022. 
 }
 \def\bidi@pdfm@mark{%
   \special{pdf:%
@@ -3985,7 +4454,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
 % \section{File \texttt{biditools.sty}}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{biditools}[2022/02/01 v2.1 Programming tools for bidi package]
+\ProvidesPackage{biditools}[2022/06/06 v2.2 Programming tools for bidi package]
 \providecommand{\@bidi@saveprimitive}[2]{\begingroup\escapechar`\\\relax
   \edef\@tempa{\string#1}\edef\@tempb{\meaning#1}%
   \ifx\@tempa\@tempb \global\let#2#1%
@@ -4265,6 +4734,12 @@ ill-advised in the old versions of bidi package.%
 \expandafter\let\csname#1\endcsname#2}}
 \newcommand{\bidi@namelongdef}[1]{%
   \long\expandafter\def\csname #1\endcsname}
+\newcommand{\bidi@namelonggdef}[1]{%
+  \long\expandafter\gdef\csname #1\endcsname}
+\newcommand{\bidi@namelongedef}[1]{%
+  \long\expandafter\edef\csname #1\endcsname}
+\newcommand{\bidi@namelongxdef}[1]{%
+  \long\expandafter\xdef\csname #1\endcsname}
 \def\bidi@ensure@newcommand{\@star@or@long\bidi@ensure@new@command}
 \def\bidi@ensure@new@command#1{%
   \begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup
@@ -15371,6 +15846,28 @@ bidi implementation of tufte title]
 %    \end{macrocode}
 % \iffalse
 %</listings-xetex-bidi.def>
+%<*lstmisc-xetex-bidi.def>
+%\fi
+% \section{File \texttt{lstmisc-xetex-bidi.def}}
+%    \begin{macrocode}
+\ProvidesFile{lstmisc-xetex-bidi.def}[2022/06/06 v0.1 bidi adaptations for lstmisc package for XeTeX engine]
+\bidi@patchcmd{\lsthk@Init}{%
+  \rightskip\@rightskip 
+  \leftskip\z@skip 
+}{%
+  \if@hboxRconstruct
+    \leftskip\@flushglue
+    \rightskip\z@skip 
+  \else
+    \rightskip\@rightskip 
+    \leftskip\z@skip 
+  \fi
+}{}{}
+
+
+%    \end{macrocode}
+% \iffalse
+%</lstmisc-xetex-bidi.def>
 %<*loadingorder-xetex-bidi.def>
 %\fi
 % \section{File \texttt{loadingorder-xetex-bidi.def}}
@@ -23649,7 +24146,7 @@ to\rtside{\box\bslice\hfil}}
 %\fi
 % \section{File \texttt{latex-xetex-bidi.def}}
 %    \begin{macrocode}
-\ProvidesFile{latex-xetex-bidi.def}[2022/06/01 v1.4.2 bidi adaptations  for `latex.ltx' for XeTeX engine]
+\ProvidesFile{latex-xetex-bidi.def}[2022/06/06 v1.4.3 bidi adaptations  for `latex.ltx' for XeTeX engine]
 \newcommand{\TeXXeTOn}{\TeXXeTstate\@ne}
 \newcommand{\TeXXeTOff}{\TeXXeTstate\z@}
 \TeXXeTOn
@@ -24549,6 +25046,7 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
 \@ifpackageloaded{lettrine}{\input{lettrine-xetex-bidi.def}}{}
 \@ifpackageloaded{lineno}{\input{lineno-xetex-bidi.def}}{}
 \@ifpackageloaded{listings}{\input{listings-xetex-bidi.def}}{}
+\@ifpackageloaded{lstmisc}{\input{lstmisc-xetex-bidi.def}}{}
 \@ifpackageloaded{media9}{\RequirePackage{bidi-media9}}{}
 \@iftexfileloaded{pstricks}{\input{pstricks-xetex-bidi.def}}{}
 \@iftexfileloaded{pgfcorescopes.code}{\input{pgfcorescopes.code-xetex-bidi.def}}{}
@@ -24608,8 +25106,11 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
 \@ifpackageloaded{beamerbaseframecomponents}{\input{beamerbaseframecomponents-xetex-bidi.def}}{}
 \@ifpackageloaded{beamerbaselocalstructure}{\input{beamerbaselocalstructure-xetex-bidi.def}}{}
 \@ifpackageloaded{beamerinnerthemedefault}{\input{beamerinnerthemedefault-xetex-bidi.def}}{}
+\@ifpackageloaded{beamerinnerthemecircles}{\input{beamerinnerthemecircles-xetex-bidi.def}}{}
+\@ifpackageloaded{beamerinnerthemerectangles}{\input{beamerinnerthemerectangles-xetex-bidi.def}}{}
 \@ifpackageloaded{beamerinnerthemerounded}{\input{beamerinnerthemerounded-xetex-bidi.def}}{}
 \@ifpackageloaded{beamerouterthemeinfolines}{\input{beamerouterthemeinfolines-xetex-bidi.def}}{}
+\@ifpackageloaded{beamerouterthemesidebar}{\input{beamerouterthemesidebar-xetex-bidi.def}}{}
 \@ifpackageloaded{beamerouterthemesplit}{\input{beamerouterthemesplit-xetex-bidi.def}}{}
 \@ifpackageloaded{beamerouterthemeshadow}{\input{beamerouterthemeshadow-xetex-bidi.def}}{}
 %    \end{macrocode}
-- 
cgit v1.2.3

