diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/beamer-rl/beamer-rl.cls')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/beamer-rl/beamer-rl.cls | 206 |
1 files changed, 51 insertions, 155 deletions
diff --git a/Master/texmf-dist/tex/lualatex/beamer-rl/beamer-rl.cls b/Master/texmf-dist/tex/lualatex/beamer-rl/beamer-rl.cls index 7a6bdc1143e..c85b7c769e2 100644 --- a/Master/texmf-dist/tex/lualatex/beamer-rl/beamer-rl.cls +++ b/Master/texmf-dist/tex/lualatex/beamer-rl/beamer-rl.cls @@ -1,6 +1,6 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesClass{beamer-rl} -[2020/08/04 v1.4a LaTeX class to patch beamer for right to left presentation with babel] +[2021/03/12 v1.4b LaTeX class to patch beamer for right to left presentation with babel] \RequirePackage{kvoptions} \RequirePackage{kvsetkeys} @@ -32,12 +32,12 @@ \ifluatex \else -\ClassError{beamer-rl}{beamer-rl require luatex} +\ClassError{beamer-rl}{beamer-rl require lualatex} \fi \LoadClass[hyperref={unicode}]{beamer} -\RequirePackage[nil,bidi=basic-r]{babel} +\RequirePackage[nil,bidi=basic]{babel} \def\reset@temp#1#2{\expandafter\let\csname beamer@@tmpop@#1@#2\endcsname\relax} \def\@@defbeamertemplate#1#2{\reset@temp{#1}{#2}\defbeamertemplate{#1}{#2}} @@ -90,11 +90,15 @@ % \vskip4bp \setbox\bmb@box=\hbox{% - \begin{minipage}[b]{\bmb@width}% + \begin{minipage}[b]{\bmb@width}% \usebeamercolor[fg]{\bmb@upper}% #2% \end{minipage}}% \ifdim\wd\bmb@box=0pt% + \ifcase\bbl@thetextdir\relax + \else% + \bmb@dimc=\bmb@width% + \fi% <-- \setbox\bmb@box=\hbox{}% \ht\bmb@box=1.5pt% \bmb@prevheight=-4.5pt% @@ -111,12 +115,8 @@ \bmb@temp=\bmb@width% \bmb@dima=\bmb@temp\advance\bmb@dima by2.2bp% \bmb@dimb=\bmb@temp\advance\bmb@dimb by4bp% - \bmb@dimc=0pt% - \ifdim\wd\bmb@box=0pt - \bmb@dimc=\bmb@width% - \fi - \hbox{% - \textdir TLT\begin{pgfpicture}{0bp}{+-\ht\bmb@box}{\bmb@dimc}{+-\ht\bmb@box} + \hbox dir TLT {% + \begin{pgfpicture}{0bp}{+-\ht\bmb@box}{\bmb@dimc}{+-\ht\bmb@box} \ifdim\wd\bmb@box=0pt% \color{lower.bg}% \else% @@ -153,11 +153,6 @@ \nointerlineskip% \vskip-0.5pt% \fi% - \ifbmb@shadow% - \setbox\bmb@boxshadow=\hbox{\pgfuseshading{bmb@shadow}}% - \setbox\bmb@boxshadowball=\hbox{\pgfuseshading{bmb@shadowball}}% - \setbox\bmb@boxshadowballlarge=\hbox{\pgfuseshading{bmb@shadowballlarge}}% - \fi% \setbox\bmb@colorbox=\hbox{{\pgfpicturetrue\pgfsetcolor{lower.bg}}}% \setbox\bmb@box=\hbox\bgroup\begin{minipage}[b]{\bmb@width}% \vskip2pt% @@ -166,113 +161,10 @@ \colorlet{structure}{upper.bg}% %\color{.}% } - - \def\endbeamerboxesrounded{% - \end{minipage}\egroup% - \wd\bmb@box=\bmb@width% - \bmb@temp=\dp\bmb@box% - \advance\bmb@temp by.5pt% - \setbox\bmb@box=\hbox{\raise\bmb@temp\hbox{\box\bmb@box}}% - \dp\bmb@box=0pt% - \bmb@temp=\wd\bmb@box% - \bmb@dima=\bmb@temp\advance\bmb@dima by2.2bp% - \bmb@dimb=\bmb@temp\advance\bmb@dimb by4bp% - \hbox{% - \textdir TLT\begin{pgfpicture}{0bp}{0bp}{0bp}{0bp} - \ifbmb@shadow% - {\pgftransformshift{\pgfpoint{4bp}{-3bp}}\pgftext{\copy\bmb@boxshadowball}} - \begin{pgfscope} - {% - \advance\bmb@temp by-1bp% - \pgfpathrectangle{\pgfpoint{\bmb@temp}{-7bp}}{\pgfpoint{9bp}{9bp}}% - \pgfusepath{clip} - }% - {\pgftransformshift{\pgfpoint{\bmb@temp}{1bp}}\pgftext{\box\bmb@boxshadowballlarge}} - \end{pgfscope} - \begin{pgfscope} - \advance\bmb@temp by-4bp% - \pgfpathrectangle{\pgfpoint{4bp}{-7bp}}{\pgfpoint{\bmb@temp}{5bp}} - \pgfusepath{clip} - {\pgftransformshift{\pgfpoint{4bp}{-7bp}}\pgftext[left,base]{\copy\bmb@boxshadow}}% - \end{pgfscope} - \begin{pgfscope} - \advance\bmb@temp by 4bp% - \bmb@dima=\ht\bmb@box% - \advance\bmb@dima by\bmb@prevheight% - \advance\bmb@dima by 4bp% - \pgfpathrectangle{\pgfpoint{\bmb@temp}{1bp}}{\pgfpoint{4bp}{\bmb@dima}} - \pgfusepath{clip} - \advance\bmb@dima by-4bp% - {\pgftransformshift{\pgfpoint{\bmb@temp}{\bmb@dima}}\pgftext{\box\bmb@boxshadowball}} - \advance\bmb@dima by-1bp% - \pgfpathrectangle{\pgfpoint{\bmb@temp}{1bp}}{\pgfpoint{4bp}{\bmb@dima}} - \pgfusepath{clip} - \advance\bmb@temp by4bp% - {\pgftransformshift{\pgfpoint{\bmb@temp}{-3bp}}% - \pgftransformrotate{90}% - \pgftext[left,base]{\box\bmb@boxshadow}}% - \end{pgfscope} - \fi% - \unhbox\bmb@colorbox% - \pgfpathqmoveto{-4bp}{1bp} - \pgfpathqcurveto{-4bp}{-1.2bp}{-2.2bp}{-3bp}{0bp}{-3bp} - \pgfpathlineto{\pgfpoint{\the\bmb@temp}{-3bp}} - \pgfpathcurveto% - {\pgfpoint{\the\bmb@dima}{-3bp}}% - {\pgfpoint{\the\bmb@dimb}{-1.2bp}}% - {\pgfpoint{\the\bmb@dimb}{1bp}}% - { - \bmb@dima=\ht\bmb@box% - \pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}} - \pgfpathlineto{\pgfpoint{-4bp}{\bmb@dima}} - \pgfusepath{fill} - } - \ifbmb@shadow% - { - \color{black!50!bg} - \pgfsetlinewidth{0pt} - \pgfpathmoveto{\pgfpoint{\bmb@dimb}{-.5bp}} - \bmb@dima=\ht\bmb@box% - \advance\bmb@dima by\bmb@prevheight% - \advance\bmb@dima by 1bp% - \pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}} - \pgfusepath{stroke} - \bmb@temp=\bmb@dima - \advance\bmb@dima by 1bp% - \color{black!31!bg} - \pgfpathmoveto{\pgfpoint{\bmb@dimb}{\bmb@temp}} - \pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}} - \pgfusepath{stroke} - \advance\bmb@dima by 1bp% - \advance\bmb@temp by 1bp% - \color{black!19!bg} - \pgfpathmoveto{\pgfpoint{\bmb@dimb}{\bmb@temp}} - \pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}} - \pgfusepath{stroke} - \advance\bmb@dima by 1bp% - \advance\bmb@temp by 1bp% - \color{black!6!bg} - \pgfpathmoveto{\pgfpoint{\bmb@dimb}{\bmb@temp}} - \pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}} - \pgfusepath{stroke} - \advance\bmb@dima by 1.5bp% - \advance\bmb@temp by 1bp% - \color{bg} - \pgfpathmoveto{\pgfpoint{\bmb@dimb}{\bmb@temp}} - \pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}} - \pgfusepath{stroke} - } - \fi - \end{pgfpicture}% - \box\bmb@box% - }% - \ifbmb@shadow% - \vskip4bp minus 2bp% - \else% - \vskip2bp% - \fi% - \egroup% of \vbox\bgroup -} + +\bbl@sreplace\endbeamerboxesrounded{\begin{pgfpicture}}% + {\textdir TLT\begin{pgfpicture}}% + %% beamerbaseauxtemplates @@ -347,7 +239,7 @@ } \def\insertgotosymbol{% - \begin{pgfpicture}{1pt}{0pt}{6pt}{5pt} +\begin{pgfpicture}{1pt}{0pt}{6pt}{5pt} \pgfuseobject{\ifcase\bbl@thepardir beamergotosymbol\else beamerreturnsymbol\fi}% \end{pgfpicture}} @@ -360,7 +252,7 @@ } \def\insertreturnsymbol{% - \begin{pgfpicture}{1pt}{0pt}{6pt}{5pt} +\begin{pgfpicture}{1pt}{0pt}{6pt}{5pt} \pgfuseobject{\ifcase\bbl@thepardir beamerreturnsymbol\else beamergotosymbol\fi}% \end{pgfpicture}} @@ -388,7 +280,7 @@ } \def\insertskipsymbol{% - \begin{pgfpicture}{-1pt}{0pt}{6pt}{5pt} +\begin{pgfpicture}{-1pt}{0pt}{6pt}{5pt} \pgfuseobject{\ifcase\bbl@thepardir beamerskipsymbol\else beamerskipsymbolrl\fi}% \end{pgfpicture}} @@ -466,16 +358,17 @@ \dp\@tempboxa=0pt% \setbox\beamer@framebox=\vbox to\beamer@frametextheight{{% \ifbeamer@plainframe\beamer@leftmargin=\Gm@lmargin\fi% + \ifcase\bbl@thepardir \else\multiply\@tempdimb by -1\relax\fi% \begin{oldpgfpicture}{\beamer@leftmargin}{-\beamer@frametextheight}{\beamer@leftmargin}{0pt} - \pgftext[left,top]{\box\@tempboxa} - \pgfpathrectangle{\pgfpoint{0pt}{-\@tempdimc}}{\pgfpoint{\ifcase\bbl@thepardir \else-\fi\@tempdimb}{\@tempdimc}}% + \pgftext[left,top]{\box\@tempboxa} + \pgfpathrectangle{\pgfpoint{0pt}{-\@tempdimc}}{\pgfpoint{\@tempdimb}{\@tempdimc}}% \pgfusepath{clip} \begingroup - \pgftransformscale{\beamer@temp} + \pgftransformscale{\beamer@temp} \@tempdima=#4\relax% \@tempdimb=#5\relax% {\pgftransformshift{\pgfpoint{-\@tempdima}{\@tempdimb}}% - \pgftext[left,top]{\vbox{\vbox{}\nointerlineskip\unvbox\beamer@framebox}}} + \pgftext[left,top]{\vbox{\vbox{}\nointerlineskip\unvbox\beamer@framebox }}} \endgroup \end{oldpgfpicture}% }}% @@ -498,30 +391,33 @@ % Shrink stuff % -\def\beamer@shrinkframebox{% - \@tempdima=\ht\beamer@framebox% -% \ifdim\@tempdima>\beamer@frametextheight% - \@tempcnta=\@tempdima% - \divide\@tempcnta by 65536\relax% - \@tempdimc=\beamer@frametextheight% - \divide\@tempdimc by\@tempcnta\relax% - \ifdim\@tempdimc>\beamer@shrinkfactor pt% - \@tempdimc=\beamer@shrinkfactor pt% - \else% - \@tempdima=-100\@tempdimc% - \advance\@tempdima by100pt% - \ClassWarning{beamer}{Frame text is shrunk by a factor of % - \strip@pt\@tempdima\space percent instead of - \beamer@shrinkpercentage\space percent}% - \fi% - \edef\beamer@factortemp{\strip@pt\@tempdimc}% - \setbox\beamer@framebox=\vbox to\beamer@frametextheight{% - \begin{oldpgfpicture}{0pt}{-\beamer@frametextheight}{0pt}{0pt} - {\pgftransformscale{\beamer@factortemp}% - \pgftext[left,top]{\box\beamer@framebox}}% - \end{oldpgfpicture}% - }% -% \fi% -} -\endinput + \bbl@sreplace\beamer@shrinkframebox{\vbox}% + {\vbox dir TLT}% + +% Temporary workaround for issue of \shapemode bug +% https://github.com/latex3/babel/issues/13 +% this work fine with lists inside frame, if they are included within \vbox +% may be we need to insert \shapemode=2 or \shapemode=0 manualy at beginning of list +% \begin{enumerate} \shapemode=.. & \begin{itemize} \shapemode=.. + +\newcounter{beginframepardir} + +\let\oldframe\frame +\def\frame{\setcounter{beginframepardir}{\bbl@getluadir{par}} +% 0 for TLT 1 for TRT +\oldframe} + +\redefbeamertemplate*{itemize/enumerate body begin}{default}{\ifnum\value{beginframepardir}=\bbl@getluadir{par} \else\shapemode=2\fi} + +\redefbeamertemplate*{description body begin}{default}{\ifnum\value{beginframepardir}=\bbl@getluadir{par} \else\shapemode \tw@\fi} + +% Use Amiri as default sans serif font + +\font\sffont@rl="Amiri" at 10pt +\ifx\sffont@rl\nullfont +\else +\babelfont{sf}{Amiri} +\fi + +\endinput
\ No newline at end of file |