texlive[52549] Master/texmf-dist: luabidi (28oct19)

commits+karl at tug.org commits+karl at tug.org
Mon Oct 28 21:55:01 CET 2019


Revision: 52549
          http://tug.org/svn/texlive?view=revision&revision=52549
Author:   karl
Date:     2019-10-28 21:55:00 +0100 (Mon, 28 Oct 2019)
Log Message:
-----------
luabidi (28oct19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.pdf
    trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.tex
    trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-arabmaths.def
    trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-autofootnoterule.def
    trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-footnotes.def
    trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-test-arabmaths.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/lualatex/luabidi/test.tex
    trunk/Master/texmf-dist/tex/lualatex/luabidi/arabmaths.tex
    trunk/Master/texmf-dist/tex/lualatex/luabidi/autofootnoterule.tex
    trunk/Master/texmf-dist/tex/lualatex/luabidi/textwidthfootnoterule.tex

Added: trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.pdf	2019-10-28 00:53:47 UTC (rev 52548)
+++ trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.pdf	2019-10-28 20:55:00 UTC (rev 52549)

Property changes on: trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.tex	2019-10-28 20:55:00 UTC (rev 52549)
@@ -0,0 +1,237 @@
+% !TeX spellcheck = en_US
+% !TeX TS-program = lualatex
+\documentclass[11pt]{ltxdoc}
+\usepackage{color}
+\usepackage{xspace,fancyvrb,booktabs}
+\usepackage[neverdecrease]{paralist}
+\definecolor{myblue}{rgb}{0.02,0.04,0.48}
+\definecolor{lightblue}{rgb}{0.61,.8,.8}
+\definecolor{myred}{rgb}{0.65,0.04,0.07}
+\usepackage[
+unicode=true,
+bookmarks=true,
+colorlinks=true,
+linkcolor=myblue,
+urlcolor=myblue,
+citecolor=myblue,
+hyperindex=false,
+hyperfootnotes=false,
+pdftitle={luabidi: Bidirectional typesetting in LuaLaTeX},
+pdfauthor={V Khalighi, A Reutenauer, J Spitzmüller},
+pdfkeywords={luatex, lualatex, multilingual, bidi}
+]{hyperref}
+\usepackage{metalogo}
+%\let\XeTeX\undefined
+%\let\XeLaTeX\undefined
+\usepackage{polyglossia}
+\usepackage{luabidi}
+
+\setmainlanguage{english}
+\usepackage[protrusion]{microtype}
+\newcommand*\Cmd[1]{\cmd{#1}\DescribeMacro{#1}\xspace}
+\newcommand*{\cscmd}[1]{\texttt{\textbackslash #1}}
+\newcommand*\pkg[1]{\textsf{\color{myblue}#1}}
+\newcommand*\file[1]{\texttt{\color{myblue}#1}}
+\newcommand*\TR[1]{\textcolor{myred}{#1}}
+\newcommand*\TX[1]{\hyperref[#1]{\textcolor{myred}{#1}}}
+\newcommand*\TB[1]{\textcolor{myblue}{\bf #1}}
+\newcommand*\TA[1]{\textsc{\color{myblue}#1}}
+\newcommand*\link[1]{\href{#1}{#1}}
+\def\eg{\textit{e.g.,}\xspace}
+\def\ie{\textit{i.e.,}\xspace}
+\def\ca{\textit{ca.}\@\xspace}
+\def\Eg{\textit{E.g.,}\xspace}
+\def\Ie{\textit{I.e.,}\xspace}
+\def\etc{\@ifnextchar.{\textit{etc}}{\textit{etc.}\@\xspace}}
+
+%% Sidenotes  << copied from fontspec.dtx
+\newcommand\new[1]{%
+	\edef\thisversion{#1}%
+	\ifhmode\unskip~\fi{\ifx\thisversion\fileversion\color{blue}\else\color[gray]{0.5}\fi
+		$\leftarrow$}%
+	\marginpar{\centering
+		\small\ifx\thisversion\fileversion\color{blue}\else\color[gray]{0.5}\fi
+		\textsf{#1}}}
+\newcommand\displaycmd[2]{%
+	\\\DescribeMacro{#2}\centerline{\cmd{#1}}}
+\renewenvironment{itemize}{\begin{compactitem}[\char"2023]}%[{\fontspec{DejaVu Sans}\char"25BB}]}%
+	{\end{compactitem}}
+
+\def\condbreak#1{%
+	\vskip 0pt plus #1\pagebreak[3]\vskip 0pt plus -#1\relax}
+
+\newcommand*\lbd{\pkg{luabidi}}
+\newcommand*\Lbd{\pkg{Luabidi}}
+
+%% fontspec declarations:
+\setmainfont{Linux Libertine O}
+\setsansfont{Linux Biolinum O}
+\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
+
+\linespread{1.05}
+\frenchspacing
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+% COMMENT THE NEXT LINE TO INCLUDE THE CODE
+\AtBeginDocument{\OnlyDescription}
+
+
+\begin{document}
+\hyphenation{Kha-li-ghi Reu-ten-auer}
+\GetFileInfo{luabidi.sty}
+
+\title{\lbd\\\color{myblue}Bidirectional typesetting in \LuaLaTeX}
+
+\date{\color{myblue}\filedate \qquad \fileversion\\
+	\footnotesize (\textsc{pdf} file generated on \today)}
+
+\author{\TA{Vafa Khalighi} \and \TA{Arthur Reutenauer}\thanks{%
+		Current maintainer. Please submit bug reports and feature requests to \protect\url{https://github.com/bidi-tex/luabidi/issues}.}
+	    \and \TA{Jürgen Spitzmüller}}
+
+\maketitle
+
+\DeleteShortVerb{\|}
+\MakeShortVerb{\¦}
+
+\tableofcontents
+
+\condbreak{2\baselineskip}
+\section{Objectives}
+\Lbd\ is an attempt to provide bidirectional writing support for the \LuaTeX\ engine in the same vein as the \pkg{bidi} package\footnote{%
+See \url{https://ctan.org/pkg/bidi}.} enables bidirectional writing with \XeTeX. The most prominent user of this package is \pkg{polyglossia}\footnote{%
+See \url{https://ctan.org/pkg/polyglossia}.} which uses \lbd\ with RTL languages and \LuaTeX\ output (as opposed to \pkg{bidi} with \XeTeX). Note, however, that \lbd\ is much more limited than \textsf{bidi}. Currently, only a very basic
+subset of the latter's features is supported.
+
+\section{Package Options}
+
+\begin{description}
+	\item[\TB{arabmaths}] By default, \lbd\ generates left-to-right maths. If you would like to have right-to-left maths, use this option.
+	\item[\TB{textwidthfootnoterule}] expands the footnote rule to the whole text width.
+	\item[\TB{autofootnoterule}] sets the footnote rule right or left aligned, depending on the direction of the first footnote
+	that follows the rule (\ie that comes on the current page).
+\end{description}
+
+\section{User Commands}
+
+\subsection{Main Text Direction}
+
+By default, the main directionality of the document is left-to-right. To change it to right-to-left, use the switch
+
+\begin{quote}
+	\Cmd\setRTLmain
+\end{quote}
+%
+This is advisable if your document consists mainly of right-to-left text.
+
+\subsection{Paragraph Text Direction}
+
+To change directionality for paragraphs, you can use the following switches:
+\begin{description}
+	\item[\cmd{\setRTL}]\DescribeMacro{\setRTL} (alias: \Cmd{\setRL}, \Cmd{\unsetLTR}) changes paragraph direction to right-to-left.
+	\item[\cmd{\setLTR}]\DescribeMacro{\setLTR} (alias: \Cmd{\setLR}, \Cmd{\unsetRTL}) changes paragraph direction to left-to-right.
+\end{description}
+%
+\condbreak{2\baselineskip}
+Alternatively,\DescribeMacro{RTL}\DescribeMacro{LTR} you can also use the environments
+
+\begin{quote}
+	\begin{verbatim}
+	\begin{RTL}
+		...
+	\end{RTL}
+	\end{verbatim}
+\end{quote}
+%
+or
+
+\begin{quote}
+	\begin{verbatim}
+	\begin{LTR}
+	...
+	\end{LTR}
+	\end{verbatim}
+\end{quote}
+
+\subsection{Inline Text Direction}
+
+To change directionality for text chunks inside paragraphs, use
+\begin{description}
+	\item[\cmd\RLE\{...\}]\DescribeMacro{\RLE} (alias: \Cmd\RL) changes the directionality locally to right-to-left.
+	\item[\cmd\LRE\{...\}]\DescribeMacro{\LRE} (alias: \Cmd\LR) changes the directionality locally to left-to-right.
+\end{description}
+
+\subsection{Footnotes}
+
+\subsubsection{Horizontal Footnote Position}
+
+\Lbd\ provides two additional footnote commands in addition to standard \cmd{\footnote}:
+\Cmd{\RTLfootnote}\new{v0.5} and \Cmd{\LTRfootnote}\new{v0.5}.
+The standard \cmd{\footnote} command thereby places the footnote always on the side that is currently the origin of direction:
+on the left side of the page in LTR paragraphs and on the right in RTL paragraphs.
+
+\cmd{\LTRfootnote}, in contrast, always places the footnote on the left side, notwithstanding the current
+directionality. \cmd{\RTLfootnote} always places it on the right side. Like \cmd{\footnote}, \cmd{\RTLfootnote}
+and \cmd{\LTRfootnote} have an optional argument to customize the number.
+
+
+\subsubsection{Footnote Rule Length and Position}
+
+By default, the placement of the footnote rule depends on the main text directionality:
+
+\begin{itemize}
+	\item In default mode (\ie if \cmd{\setRTLmain} is not used), the footnote rule is always set left-aligned (as usual in LTR documents).
+	\item If the main direction is RTL (\ie if \cmd{\setRTLmain} is used), the footnote rule is always set right-aligned (as usual in RTL documents)
+\end{itemize}
+%
+However, with the switch \Cmd{\leftfootnoterule}\new{v0.5}, all subsequent footnote rules are always placed on the left.
+Likewise, \Cmd{\rightfootnoterule}\new{v0.5} causes all subsequent footnote rules to be always placed on the right.
+
+The switch \Cmd{\autofootnoterule}\new{v0.5} and the corresponding package option advise \lbd\ to automatically determine the rule position,
+depending on the directionality of the first footnote on the page. Note that this automatic can fail with footnotes at page boundaries
+that differ in directionality from the first footnote on the page. You can work around such cases by switching to \cmd{\rightfootnoterule}
+or \cmd{\leftfootnoterule} on these pages.
+
+If you want a footnote rule that spans the whole text width, you can use the switch \Cmd{\textwidth\-footnoterule}\new{v0.5}
+or the respective package option.
+
+The length of left and right footnote rules can be adjusted via
+
+\begin{quote}
+  ¦\setlength\footenoterulewidth{⟨length⟩}¦\DescribeMacro{\footenoterulewidth}
+\end{quote}
+%
+The predefined ¦⟨length⟩¦ is ¦0.4\columnwidth¦.
+
+
+
+\section{Commands for Package Authors}
+
+The following tests are provided to be used in packages:
+
+\begin{description}
+	\item[\cscmd{if at RTL}]\DescribeMacro{\if at RTL} determines whether the current paragraph direction is right-to-left.
+	\item[\cscmd{if at RTLmain}]\DescribeMacro{\if at RTLmain} determines whether the main direction is right-to-left.
+\end{description}
+%
+The following macros are provided:
+\begin{description}
+	\item[\cscmd{@ensure at RTL\{...\}}]\DescribeMacro{\@ensure at RTL} Ensure that the argument is typeset RTL.
+	\item[\cscmd{@ensure at LTR\{...\}}]\DescribeMacro{\@ensure at LTR} Ensure that the argument is typeset LTR.
+	\item[\cscmd{@ensure at dir\{...\}}]\DescribeMacro{\@ensure at dir} (alias: \cmd{\@ensure at maindir\{...\}}\DescribeMacro{\@ensure at maindir}) If used in RTL mode, the argument is put inside \cmd{\RLE}, if used in LTR mode, the argument is output as is.
+    \item[\cscmd{hboxR\{...\}}]\DescribeMacro{\hboxR}\new{v0.5} Puts its argument in a RTL \cmd{\hbox}.
+\end{description}
+
+\section{Revision Log}
+
+\begin{description}
+	\item[v. 0.5 (2019/10/27)] Add \cmd{\RTLfootnote}, \cmd{\LTRfootnote}, and \cmd{\hboxR}; fix \texttt{autofootnoterule} option; add \cmd{\autofootnoterule},
+	     \cmd{\leftfootnoterule}, \cmd{\rightfootnoterule} and \cmd{\textwidthfootnoterule}; add manual.
+	\item[v. 0.4 (2019/08/24)] Fix \cmd{\@ensure at RTL}.
+	\item[v. 0.3 (2019/07/10)] Fix compatibility with recent \LuaTeX\ (this version was never released to CTAN).
+	\item[v. 0.2 (2013/05/27)] Fix additional files.
+	\item[v. 0.1 (2009/04/01)] Initial release.
+\end{description}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/lualatex/luabidi/luabidi.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/lualatex/luabidi/test.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luabidi/test.tex	2019-10-28 00:53:47 UTC (rev 52548)
+++ trunk/Master/texmf-dist/doc/lualatex/luabidi/test.tex	2019-10-28 20:55:00 UTC (rev 52549)
@@ -1,13 +0,0 @@
-\documentclass[12pt]{article}
-\usepackage[arabmaths]{luabidi}
-\begin{document}
-\setRTLmain
-\section{ghesmate 1}
-
-in yek ghesmat ast ke an ra dar inja minevisam
-
-\begin{equation}
-1+2=3
-\end{equation}
-in ham dobare masalei ast ke man minevisam va shoma an ra mibinid.
-\end{document}

Deleted: trunk/Master/texmf-dist/tex/lualatex/luabidi/arabmaths.tex
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luabidi/arabmaths.tex	2019-10-28 00:53:47 UTC (rev 52548)
+++ trunk/Master/texmf-dist/tex/lualatex/luabidi/arabmaths.tex	2019-10-28 20:55:00 UTC (rev 52549)
@@ -1,2 +0,0 @@
-\mathdir TRT
-\def\@eqnnum{{\normalfont \normalcolor \textdir TLT ({\textdir TRT\theequation})}}

Deleted: trunk/Master/texmf-dist/tex/lualatex/luabidi/autofootnoterule.tex
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luabidi/autofootnoterule.tex	2019-10-28 00:53:47 UTC (rev 52548)
+++ trunk/Master/texmf-dist/tex/lualatex/luabidi/autofootnoterule.tex	2019-10-28 20:55:00 UTC (rev 52549)
@@ -1,116 +0,0 @@
-\ifx \CatEscape\undefined
-    \chardef\CatEscape=0
-    \chardef\CatOpen=1
-    \chardef\CatClose=2
-    \chardef\CatIgnore=9
-    \chardef\CatLetter=11
-    \chardef\CatOther=12
-    \chardef\CatActive=13		% is defined in Plain already
-
-    \chardef\CatUsCode=\catcode`\_
-\fi
-
-\catcode`\_=\CatLetter			% top level macro file
-
-
-\def\l at fn{%
-  \hbox to \columnwidth
-  {\pagedir TLT\vbox{\kern -3\p@
-   \hrule width .4\columnwidth \kern2.6\p@}\hfil}}
-\def\r at fn{%
-   \hrule width .4\columnwidth\kern 2.6\p@}
-
-
-\def\@makefnmark{\hbox{$^{\hbox{\scriptsize\@thefnmark}}\m at th$}}
-
-
-\def\leftfootnoterule{\global\def\footnoterule{\l at fn}}
-\def\rightfootnoterule{\global\def\footnoterule{\r at fn}}
-\leftfootnoterule
-
-%%% \beginprog
-\newread\old_foot_file
-\newwrite\foot_file
-\def\foot_file_name{\jobname.fot\relax}
-\def\init_footnote{%
-   \openin\old_foot_file\foot_file_name
-   \ifeof\old_foot_file  \closein\old_foot_file
-   \else  \closein\old_foot_file
-      \read_foot_file
-   \fi
-   \immediate\openout\foot_file\foot_file_name
-   \immediate\write\foot_file{\relax}%
-   \global\let\init_footnote\relax
-   }
-
-\newcount\foot_name_no  % for generating footnote mark names
-
-
-
-
-
-\newcount\autofootnote
-\def\fnpp_next_footnote{%
-    \init_footnote
-    \global\advance\foot_name_no\@ne
-    \global\advance\c at footnote\@ne
-    \edef\do_write{%
-	\immediate\write\foot_file{%
-	    \string\advance\autofootnote\@ne
-	    \string\expandafter\xdef
-			\string\csname\space f@\number\foot_name_no \endcsname{%
-		\string\number\autofootnote
-		}%
-	    }%
-	}%
-    \do_write
-    \global\autofootnote 0\csname f@\number\foot_name_no \endcsname \relax
-    }
-
-\def\read_foot_file{%
-   \begingroup
-      \catcode`\@\CatLetter \catcode`\^^M\CatIgnore
-      \input \foot_file_name
-   \endgroup
-   }
-
-\let\fnpp_orig_outputpage=\@outputpage
-\def\@outputpage{%
-    \ifx \init_footnote\relax
-	\immediate\write\foot_file{\autofootnote\z@}%
-    \fi
-    \fnpp_orig_outputpage
-    }
-
-\let\FnppOrigFootnote=\footnote		% save original bindings
-\let\FnppOrigFootnotemark=\footnotemark
-
-\def\footnote{%
-    \@ifnextchar[%			% ] (Emacs)
-	\@xfootnote
-	{\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnote[\the\c at footnote] %
-}%
-    }
-\def\footnotemark{%
-    \@ifnextchar[%			% ] (Emacs)
-	\@xfootnotemark
-	{\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnotemark[\the\c at footnote]}%
-    }
-
-
-
-
-\def\footnotemarkLR{%
-    \@ifnextchar[%			% ] (Emacs)
-	\@xfootnotemark
-	{\fnpp_next_footnote \ifnum\autofootnote=1\leftfootnoterule\fi\@xfootnotemark[\the\c at footnote]}%
-    }
-
-
-\def\Footnote#1{%
-\begingroup
-\footnotemarkLR%
-\renewcommand{\thefootnote}{\@arabic\c at footnote}%
-\pardir TLT \textdir TLT\footnotetext{#1}%
-\endgroup
-}

Added: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-arabmaths.def
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-arabmaths.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-arabmaths.def	2019-10-28 20:55:00 UTC (rev 52549)
@@ -0,0 +1,11 @@
+%% This file is luabidi-arabmaths.def
+%% This is part of the luabidi package
+%%
+%% Copyright © 2009 Vafa Khalighi, 2013--2019 Arthur Reutenauer, 2019 Jürgen Spitzmüller
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+
+\mathdir TRT
+\def\@eqnnum{{\normalfont \normalcolor \textdir TLT ({\textdir TRT\theequation})}}


Property changes on: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-arabmaths.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-autofootnoterule.def
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-autofootnoterule.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-autofootnoterule.def	2019-10-28 20:55:00 UTC (rev 52549)
@@ -0,0 +1,72 @@
+%% This file is luabidi-autofootnoterule.def
+%% This is part of the luabidi package
+%%
+%% Copyright © 2009 Vafa Khalighi, 2013--2019 Arthur Reutenauer, 2019 Jürgen Spitzmüller
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+
+
+%
+% Determine first footnote on current page
+%
+
+\RequirePackage{perpage}
+\newcounter{pagefnt}
+\setcounter{pagefnt}{0}
+\MakePerPage[0]{pagefnt}
+
+
+%
+% Footnote redefinitions
+%
+
+% Save original definitions
+\let\FnppOrigFootnote=\footnote
+\let\FnppOrigFootnotemark=\footnotemark
+
+% Default: left-aligned rule
+\leftfootnoterule
+
+% \footnote
+\def\footnote{%
+    \@ifnextchar[%			% ] (Editor)
+	\@xfootnote
+	{\stepcounter\@mpfn\stepcounter{pagefnt}%
+         \ifnum\value{pagefnt}=0%
+             \if at RTL%
+                 \rightfootnoterule%
+             \else%
+                 \leftfootnoterule%
+             \fi%
+         \fi%
+         \@xfootnote[\the\c at footnote]%
+        }%
+}
+
+% \RTLfootnote
+\def\footnotemarkRL{%
+    \@ifnextchar[%			% ] (Editor)
+	\@xfootnotemark
+	{\stepcounter\@mpfn\stepcounter{pagefnt}%
+         \ifnum\value{pagefnt}=0%
+             \rightfootnoterule%
+         \fi%
+         \@xfootnotemark[\the\c at footnote]%
+        }%
+}
+
+% \LTRfootnote
+\def\footnotemarkLR{%
+    \@ifnextchar[%			% ] (Editor)
+	\@xfootnotemark
+	{\stepcounter\@mpfn\stepcounter{pagefnt}%
+         \ifnum\value{pagefnt}=0%
+            \leftfootnoterule%
+         \fi%
+         \@xfootnotemark[\the\c at footnote]%
+        }%
+}
+
+% Finis


Property changes on: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-autofootnoterule.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-footnotes.def
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-footnotes.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-footnotes.def	2019-10-28 20:55:00 UTC (rev 52549)
@@ -0,0 +1,76 @@
+%% This file is luabidi-footnotes.def
+%% This is part of the luabidi package
+%%
+%% Copyright © 2009 Vafa Khalighi, 2013--2019 Arthur Reutenauer, 2019 Jürgen Spitzmüller
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+
+%
+% Footnotes
+%
+
+% These are defined in polyglossia. Provide simple fallbacks
+\providecommand*\localnumeral{\@ifstar\@@localnumeral\@localnumeral}
+
+\providecommand*\@localnumeral[1]{#1}
+\providecommand*\@@localnumeral[1]{%
+      \protect\@arabic\csuse{c@#1}%
+}
+
+\let\footnotemarkLR\footnotemark
+\let\footnotemarkRL\footnotemark
+
+\providecommand\LTRfootnote[2][]{%
+  \begingroup
+    \ifx#1\\\\\footnotemarkLR
+        \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
+    \else%
+        \footnotemarkLR[#1]%
+        \renewcommand{\thefootnote}{\localnumeral{#1}}%
+    \fi
+    \pardir TLT \textdir TLT\footnotetext{#2}%
+  \endgroup
+}
+
+\providecommand\RTLfootnote[2][]{%
+  \begingroup
+    \ifx#1\\\\\footnotemarkRL%
+       \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
+    \else%
+       \footnotemarkRL[#1]%
+       \renewcommand{\thefootnote}{\localnumeral{#1}}%
+    \fi
+    \pardir TRT \textdir TRT\footnotetext{#2}%
+  \endgroup
+}
+
+% backwards compatibility
+\def\Footnote#1{\LTRfootnote{#1}}
+
+%
+% Footnote rules
+%
+
+% adjustable rule length
+\newlength\footnoterulewidth
+\setlength\footnoterulewidth{.4\columnwidth}
+
+% The left, right and full width rules
+\def\luabidi at left@fn{%
+  \hbox to \columnwidth
+  {\pagedir TLT\textdir TLT\vbox{\kern -3\p@
+   \hrule\@width\footnoterulewidth\kern2.6\p@}\hfil}}
+\def\luabidi at right@fn{%
+   \pagedir TRT\textdir TRT\hrule\@width\footnoterulewidth\kern2.6\p@}
+\def\luabidi at textwidth@fn{%
+   \kern-3\p@\hrule\@width\textwidth\kern2.6\p@}
+
+% switches for the rule position
+\def\leftfootnoterule{\global\def\footnoterule{\luabidi at left@fn}}
+\def\rightfootnoterule{\global\def\footnoterule{\luabidi at right@fn}}
+\def\textwidthfootnoterule{\global\def\footnoterule{\luabidi at textwidth@fn}}
+\def\autofootnoterule{\luabidi at autofootnoteruletrue}
+
+% Finis


Property changes on: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-footnotes.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-test-arabmaths.tex
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-test-arabmaths.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-test-arabmaths.tex	2019-10-28 20:55:00 UTC (rev 52549)
@@ -0,0 +1,13 @@
+\documentclass[12pt]{article}
+\usepackage[arabmaths]{luabidi}
+\begin{document}
+\setRTLmain
+\section{ghesmate 1}
+
+in yek ghesmat ast ke an ra dar inja minevisam
+
+\begin{equation}
+1+2=3
+\end{equation}
+in ham dobare masalei ast ke man minevisam va shoma an ra mibinid.
+\end{document}


Property changes on: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi-test-arabmaths.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty	2019-10-28 00:53:47 UTC (rev 52548)
+++ trunk/Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty	2019-10-28 20:55:00 UTC (rev 52549)
@@ -1,4 +1,5 @@
 %% This file is luabidi.sty
+%% This is part of the luabidi package
 %%
 %% Copyright © 2009 Vafa Khalighi, 2013--2019 Arthur Reutenauer, 2019 Jürgen Spitzmüller
 %%
@@ -6,11 +7,30 @@
 %% conditions of the LaTeX Project Public License, either version 1.3c
 %% of this license or (at your option) any later version.
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luabidi}[2019/08/24 v0.4
+\ProvidesPackage{luabidi}[2019/10/27 v0.5
 	Bidirectional typesetting in LuaTeX]
+
+\RequirePackage{etoolbox}
+
+%
+% Package options
+%
+
+\DeclareOption{arabmaths}{\input{luabidi-arabmaths.def}}
+\newif\ifluabidi at autofootnoterule
+\DeclareOption{autofootnoterule}{\luabidi at autofootnoteruletrue}
+\newif\ifluabidi at textwidthfootnoterule
+\DeclareOption{textwidthfootnoterule}{\luabidi at textwidthfootnoteruletrue}
+\ProcessOptions
+
+%
+% General command and switches
+%
+
 \newif\if at RTL
 \newif\if at RTLmain
-\def\setRTLmain{\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT}
+\@RTLmainfalse
+\def\setRTLmain{\@RTLmaintrue\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT}
 \def\setRTL{\@RTLtrue\pardir TRT \textdir TRT}
 \let\setRL=\setRTL
 \def\setLTR{\@RTLfalse\pardir TLT \textdir TLT}
@@ -25,9 +45,6 @@
 \def\@ensure at LTR#1{\if at RTL\LRE{#1}\else{#1}\fi}
 \def\@ensure at dir#1{\if at RTL\RLE{#1}\else{#1}\fi}
 \let\@ensure at maindir=\@ensuredir
-\@RTLmainfalse
-\DeclareOption{arabmaths}{\input{arabmaths}}
-\DeclareOption{textwidthfootnoterule}{\input{textwidthfootnoterule}}
 \let\n at xt=\
 \DeclareRobustCommand*\LRE{\protect\pLRE}
 \def\pLRE{\protect\afterassignment\moreLRE \let\n at xt= }
@@ -39,18 +56,25 @@
 \def\moreRLE{\bracetext \aftergroup\unsetRTL \setRTL\@RTLtrue}
 \let\LR=\LRE
 \let\RL=\RLE
+\def\hboxR#1{\hbox{\RL{#1}}}
 
-\def\Footnote#1{%
-\begingroup
-\footnotemark
-\renewcommand{\thefootnote}{\@arabic\c at footnote}%
-\pardir TLT \textdir TLT\footnotetext{#1}%
-\endgroup
-}
+%
+% Footnotes
+%
 
-\DeclareOption{autofootnoterule}{\input{autofootnoterule}}
+\input{luabidi-footnotes.def}
 
+\ifluabidi at textwidthfootnoterule
+   \textwidthfootnoterule
+\fi
 
+% This needs to be loaded late because of the switch
+\AtEndPreamble{%
+  \makeatletter
+     \ifluabidi at autofootnoterule
+         \input{luabidi-autofootnoterule.def}
+     \fi
+  \makeatother
+}
 
-\ProcessOptions
 \endinput

Deleted: trunk/Master/texmf-dist/tex/lualatex/luabidi/textwidthfootnoterule.tex
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luabidi/textwidthfootnoterule.tex	2019-10-28 00:53:47 UTC (rev 52548)
+++ trunk/Master/texmf-dist/tex/lualatex/luabidi/textwidthfootnoterule.tex	2019-10-28 20:55:00 UTC (rev 52549)
@@ -1,2 +0,0 @@
-\def\footnoterule{\kern-3\p@
-  \hrule \@width \textwidth \kern 2.6\p@}



More information about the tex-live-commits mailing list