From 7576bebf95b7501ef361c4c491c7960df42ec52b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 29 Aug 2019 15:46:02 +0000 Subject: luabidi (29aug19) git-svn-id: svn://tug.org/texlive/trunk@51983 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/lualatex/luabidi/doc/test.tex | 13 --- Master/texmf-dist/doc/lualatex/luabidi/test.tex | 13 +++ .../doc/lualatex/luabidi/tex/arabmaths.tex | 2 - .../doc/lualatex/luabidi/tex/autofootnoterule.tex | 116 --------------------- .../doc/lualatex/luabidi/tex/luabidi.sty | 56 ---------- .../lualatex/luabidi/tex/textwidthfootnoterule.tex | 2 - .../texmf-dist/tex/lualatex/luabidi/arabmaths.tex | 2 + .../tex/lualatex/luabidi/autofootnoterule.tex | 116 +++++++++++++++++++++ Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty | 56 ++++++++++ .../tex/lualatex/luabidi/textwidthfootnoterule.tex | 2 + Master/tlpkg/libexec/ctan2tds | 2 + 11 files changed, 191 insertions(+), 189 deletions(-) delete mode 100644 Master/texmf-dist/doc/lualatex/luabidi/doc/test.tex create mode 100644 Master/texmf-dist/doc/lualatex/luabidi/test.tex delete mode 100644 Master/texmf-dist/doc/lualatex/luabidi/tex/arabmaths.tex delete mode 100644 Master/texmf-dist/doc/lualatex/luabidi/tex/autofootnoterule.tex delete mode 100644 Master/texmf-dist/doc/lualatex/luabidi/tex/luabidi.sty delete mode 100644 Master/texmf-dist/doc/lualatex/luabidi/tex/textwidthfootnoterule.tex create mode 100644 Master/texmf-dist/tex/lualatex/luabidi/arabmaths.tex create mode 100644 Master/texmf-dist/tex/lualatex/luabidi/autofootnoterule.tex create mode 100644 Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty create mode 100644 Master/texmf-dist/tex/lualatex/luabidi/textwidthfootnoterule.tex diff --git a/Master/texmf-dist/doc/lualatex/luabidi/doc/test.tex b/Master/texmf-dist/doc/lualatex/luabidi/doc/test.tex deleted file mode 100644 index 1b51109ad46..00000000000 --- a/Master/texmf-dist/doc/lualatex/luabidi/doc/test.tex +++ /dev/null @@ -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} diff --git a/Master/texmf-dist/doc/lualatex/luabidi/test.tex b/Master/texmf-dist/doc/lualatex/luabidi/test.tex new file mode 100644 index 00000000000..1b51109ad46 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/luabidi/test.tex @@ -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} diff --git a/Master/texmf-dist/doc/lualatex/luabidi/tex/arabmaths.tex b/Master/texmf-dist/doc/lualatex/luabidi/tex/arabmaths.tex deleted file mode 100644 index e125dce795e..00000000000 --- a/Master/texmf-dist/doc/lualatex/luabidi/tex/arabmaths.tex +++ /dev/null @@ -1,2 +0,0 @@ -\mathdir TRT -\def\@eqnnum{{\normalfont \normalcolor \textdir TLT ({\textdir TRT\theequation})}} diff --git a/Master/texmf-dist/doc/lualatex/luabidi/tex/autofootnoterule.tex b/Master/texmf-dist/doc/lualatex/luabidi/tex/autofootnoterule.tex deleted file mode 100644 index f7706946522..00000000000 --- a/Master/texmf-dist/doc/lualatex/luabidi/tex/autofootnoterule.tex +++ /dev/null @@ -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@fn{% - \hbox to \columnwidth - {\pagedir TLT\vbox{\kern -3\p@ - \hrule width .4\columnwidth \kern2.6\p@}\hfil}} -\def\r@fn{% - \hrule width .4\columnwidth\kern 2.6\p@} - - -\def\@makefnmark{\hbox{$^{\hbox{\scriptsize\@thefnmark}}\m@th$}} - - -\def\leftfootnoterule{\global\def\footnoterule{\l@fn}} -\def\rightfootnoterule{\global\def\footnoterule{\r@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@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@footnote] % -}% - } -\def\footnotemark{% - \@ifnextchar[% % ] (Emacs) - \@xfootnotemark - {\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnotemark[\the\c@footnote]}% - } - - - - -\def\footnotemarkLR{% - \@ifnextchar[% % ] (Emacs) - \@xfootnotemark - {\fnpp_next_footnote \ifnum\autofootnote=1\leftfootnoterule\fi\@xfootnotemark[\the\c@footnote]}% - } - - -\def\Footnote#1{% -\begingroup -\footnotemarkLR% -\renewcommand{\thefootnote}{\@arabic\c@footnote}% -\pardir TLT \textdir TLT\footnotetext{#1}% -\endgroup -} diff --git a/Master/texmf-dist/doc/lualatex/luabidi/tex/luabidi.sty b/Master/texmf-dist/doc/lualatex/luabidi/tex/luabidi.sty deleted file mode 100644 index abc1d2a9367..00000000000 --- a/Master/texmf-dist/doc/lualatex/luabidi/tex/luabidi.sty +++ /dev/null @@ -1,56 +0,0 @@ -%% This file is luabidi.sty -%% -%% 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. -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luabidi}[2019/08/24 v0.4 - Bidirectional typesetting in LuaTeX] -\newif\if@RTL -\newif\if@RTLmain -\def\setRTLmain{\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} -\let\setLR=\setLTR -\let\unsetRTL=\setLTR -\let\unsetLTR=\setRTL -\def\RTL{\@RTLtrue\trivlist \pardir TRT \textdir TRT\item\relax} -\def\endRTL{\@RTLfalse\endtrivlist} -\def\LTR{\trivlist \pardir TLT \textdir TLT\item\relax} -\def\endLTR{\endtrivlist} -\def\@ensure@RTL#1{\if@RTL#1\else\RLE{#1}\fi} -\def\@ensure@LTR#1{\if@RTL\LRE{#1}\else{#1}\fi} -\def\@ensure@dir#1{\if@RTL\RLE{#1}\else{#1}\fi} -\let\@ensure@maindir=\@ensuredir -\@RTLmainfalse -\DeclareOption{arabmaths}{\input{arabmaths}} -\DeclareOption{textwidthfootnoterule}{\input{textwidthfootnoterule}} -\let\n@xt=\ -\DeclareRobustCommand*\LRE{\protect\pLRE} -\def\pLRE{\protect\afterassignment\moreLRE \let\n@xt= } -\DeclareRobustCommand*\RLE{\protect\pRLE} -\def\pRLE{\protect\afterassignment\moreRLE \let\n@xt= } -\def\bracetext{\ifcat\n@xt{\else\ifcat\n@xt}\fi - \errmessage{Missing left brace has been substituted}\fi \bgroup} -\def\moreLRE{\bracetext \aftergroup\unsetLTR \setLTR\@RTLfalse} -\def\moreRLE{\bracetext \aftergroup\unsetRTL \setRTL\@RTLtrue} -\let\LR=\LRE -\let\RL=\RLE - -\def\Footnote#1{% -\begingroup -\footnotemark -\renewcommand{\thefootnote}{\@arabic\c@footnote}% -\pardir TLT \textdir TLT\footnotetext{#1}% -\endgroup -} - -\DeclareOption{autofootnoterule}{\input{autofootnoterule}} - - - -\ProcessOptions -\endinput diff --git a/Master/texmf-dist/doc/lualatex/luabidi/tex/textwidthfootnoterule.tex b/Master/texmf-dist/doc/lualatex/luabidi/tex/textwidthfootnoterule.tex deleted file mode 100644 index 7fc71e0cefc..00000000000 --- a/Master/texmf-dist/doc/lualatex/luabidi/tex/textwidthfootnoterule.tex +++ /dev/null @@ -1,2 +0,0 @@ -\def\footnoterule{\kern-3\p@ - \hrule \@width \textwidth \kern 2.6\p@} diff --git a/Master/texmf-dist/tex/lualatex/luabidi/arabmaths.tex b/Master/texmf-dist/tex/lualatex/luabidi/arabmaths.tex new file mode 100644 index 00000000000..e125dce795e --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/luabidi/arabmaths.tex @@ -0,0 +1,2 @@ +\mathdir TRT +\def\@eqnnum{{\normalfont \normalcolor \textdir TLT ({\textdir TRT\theequation})}} diff --git a/Master/texmf-dist/tex/lualatex/luabidi/autofootnoterule.tex b/Master/texmf-dist/tex/lualatex/luabidi/autofootnoterule.tex new file mode 100644 index 00000000000..f7706946522 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/luabidi/autofootnoterule.tex @@ -0,0 +1,116 @@ +\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@fn{% + \hbox to \columnwidth + {\pagedir TLT\vbox{\kern -3\p@ + \hrule width .4\columnwidth \kern2.6\p@}\hfil}} +\def\r@fn{% + \hrule width .4\columnwidth\kern 2.6\p@} + + +\def\@makefnmark{\hbox{$^{\hbox{\scriptsize\@thefnmark}}\m@th$}} + + +\def\leftfootnoterule{\global\def\footnoterule{\l@fn}} +\def\rightfootnoterule{\global\def\footnoterule{\r@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@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@footnote] % +}% + } +\def\footnotemark{% + \@ifnextchar[% % ] (Emacs) + \@xfootnotemark + {\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnotemark[\the\c@footnote]}% + } + + + + +\def\footnotemarkLR{% + \@ifnextchar[% % ] (Emacs) + \@xfootnotemark + {\fnpp_next_footnote \ifnum\autofootnote=1\leftfootnoterule\fi\@xfootnotemark[\the\c@footnote]}% + } + + +\def\Footnote#1{% +\begingroup +\footnotemarkLR% +\renewcommand{\thefootnote}{\@arabic\c@footnote}% +\pardir TLT \textdir TLT\footnotetext{#1}% +\endgroup +} diff --git a/Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty b/Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty new file mode 100644 index 00000000000..abc1d2a9367 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/luabidi/luabidi.sty @@ -0,0 +1,56 @@ +%% This file is luabidi.sty +%% +%% 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. +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{luabidi}[2019/08/24 v0.4 + Bidirectional typesetting in LuaTeX] +\newif\if@RTL +\newif\if@RTLmain +\def\setRTLmain{\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} +\let\setLR=\setLTR +\let\unsetRTL=\setLTR +\let\unsetLTR=\setRTL +\def\RTL{\@RTLtrue\trivlist \pardir TRT \textdir TRT\item\relax} +\def\endRTL{\@RTLfalse\endtrivlist} +\def\LTR{\trivlist \pardir TLT \textdir TLT\item\relax} +\def\endLTR{\endtrivlist} +\def\@ensure@RTL#1{\if@RTL#1\else\RLE{#1}\fi} +\def\@ensure@LTR#1{\if@RTL\LRE{#1}\else{#1}\fi} +\def\@ensure@dir#1{\if@RTL\RLE{#1}\else{#1}\fi} +\let\@ensure@maindir=\@ensuredir +\@RTLmainfalse +\DeclareOption{arabmaths}{\input{arabmaths}} +\DeclareOption{textwidthfootnoterule}{\input{textwidthfootnoterule}} +\let\n@xt=\ +\DeclareRobustCommand*\LRE{\protect\pLRE} +\def\pLRE{\protect\afterassignment\moreLRE \let\n@xt= } +\DeclareRobustCommand*\RLE{\protect\pRLE} +\def\pRLE{\protect\afterassignment\moreRLE \let\n@xt= } +\def\bracetext{\ifcat\n@xt{\else\ifcat\n@xt}\fi + \errmessage{Missing left brace has been substituted}\fi \bgroup} +\def\moreLRE{\bracetext \aftergroup\unsetLTR \setLTR\@RTLfalse} +\def\moreRLE{\bracetext \aftergroup\unsetRTL \setRTL\@RTLtrue} +\let\LR=\LRE +\let\RL=\RLE + +\def\Footnote#1{% +\begingroup +\footnotemark +\renewcommand{\thefootnote}{\@arabic\c@footnote}% +\pardir TLT \textdir TLT\footnotetext{#1}% +\endgroup +} + +\DeclareOption{autofootnoterule}{\input{autofootnoterule}} + + + +\ProcessOptions +\endinput diff --git a/Master/texmf-dist/tex/lualatex/luabidi/textwidthfootnoterule.tex b/Master/texmf-dist/tex/lualatex/luabidi/textwidthfootnoterule.tex new file mode 100644 index 00000000000..7fc71e0cefc --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/luabidi/textwidthfootnoterule.tex @@ -0,0 +1,2 @@ +\def\footnoterule{\kern-3\p@ + \hrule \@width \textwidth \kern 2.6\p@} diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 50ccac91902..a7c7363f11b 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -736,6 +736,7 @@ chomp (my $ctan_root = `tlpkginfo --ctan-root`); 'ltxmisc', "die 'skipping, too complicated, sorry'", 'ltxtable', "die 'skipping, use carlisle'", 'lua-visual-debug', "&MAKEflatten", + 'luabidi', "&MAKEflatten", 'luamesh', "&MAKEflatten", 'luarandom', "&MAKEflatten", 'luatex-def', "die 'skipping, replaced by graphics-def'", @@ -1862,6 +1863,7 @@ $standardtex 'lua-check-hyphen', '\.lua|' . $standardtex, 'lua-visual-debug', '\.lua|' . $standardtex, 'lua2dox', 'NULL', # .def is lua code + 'luabidi', '(arabmaths|footnoterule)|' . $standardtex, 'luaintro', 'NULL', # doc pkg 'lualatex-math', '\.sty', # not phst-doc.cls 'luamesh', '\.sty', # not lltxdoc.cls -- cgit v1.2.3