@@ -139,6 +139,23 @@ $endif$
139$if(verbatim-in-note)$
139$if(verbatim-in-note)$
140\VerbatimFootnotes % allows verbatim text in footnotes
140\VerbatimFootnotes % allows verbatim text in footnotes
144+ % load bidi as late as possible as it modifies e.g. graphicx
146+ \usepackage[RTLdocument]{bidi}
151+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
153+ \newcommand{\RL}[1]{\beginR #1\endR}
154+ \newcommand{\LR}[1]{\beginL #1\endL}
155+ \newenvironment{RTL}{\beginR}{\endR}
156+ \newenvironment{LTR}{\beginL}{\endL}
143$if(title)$
160$if(title)$
144\title{$title$$if(subtitle)$\\\vspace{0.5em}{\large $subtitle$}$endif$}
161\title{$title$$if(subtitle)$\\\vspace{0.5em}{\large $subtitle$}$endif$}