summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi/ftnright-xetex-bidi.def
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-29 21:26:04 +0000
committerKarl Berry <karl@freefriends.org>2018-09-29 21:26:04 +0000
commit77872db57134ce690bf9ee630569ae942b917af9 (patch)
tree749769ba90fb80e20fe4b7be1f364ff223b75899 /Master/texmf-dist/tex/xelatex/bidi/ftnright-xetex-bidi.def
parent0a07d00af20143947cb66d788e41fe3a50461e46 (diff)
bidi (29sep18)
git-svn-id: svn://tug.org/texlive/trunk@48787 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/ftnright-xetex-bidi.def')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi/ftnright-xetex-bidi.def141
1 files changed, 139 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/ftnright-xetex-bidi.def b/Master/texmf-dist/tex/xelatex/bidi/ftnright-xetex-bidi.def
index f6344c9d918..708be994da9 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/ftnright-xetex-bidi.def
+++ b/Master/texmf-dist/tex/xelatex/bidi/ftnright-xetex-bidi.def
@@ -17,7 +17,7 @@
%% by Vafa Khalighi.
%%
%%
-%% \CheckSum{50190}
+%% \CheckSum{50462}
%% \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
@@ -34,7 +34,15 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
-\ProvidesFile{ftnright-xetex-bidi.def}[2017/05/06 v0.5 bidi adaptations for ftnright package for XeTeX engine]
+\ProvidesFile{ftnright-xetex-bidi.def}[2018/09/29 v0.6 bidi adaptations for ftnright package for XeTeX engine]
+
+\def\prepare@bidi@copyins{%
+ \global\bidi@rcol@copyinsskip\skip\@bidi@copyins@
+ \global\skip\@bidi@copyins@\z@
+ \global\count\@bidi@copyins@\z@
+ \global\dimen\@bidi@copyins@\textheight}
+
+\newskip\bidi@rcol@copyinsskip
\def\LTR@outputdblcol{%
\if@firstcolumn
@@ -42,6 +50,8 @@
\global\setbox\@leftcolumn\copy\@outputbox
\global\count\footins\@m
\global\skip\footins\rcol@footinsskip
+ \global\count\@bidi@copyins@\@m
+ \global\skip\@bidi@copyins@\bidi@rcol@copyinsskip
\splitmaxdepth\maxdimen
\vbadness\maxdimen
\setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}%
@@ -59,6 +69,7 @@
\fi
\else
\preparefootins
+ \prepare@bidi@copyins
\global\@firstcolumntrue
\setbox\@outputbox\vbox{%
\hb@xt@\textwidth{%
@@ -88,6 +99,8 @@
\global\setbox\@leftcolumn\copy\@outputbox
\global\count\footins\@m
\global\skip\footins\rcol@footinsskip
+ \global\count\@bidi@copyins@\@m
+ \global\skip\@bidi@copyins@\bidi@rcol@copyinsskip
\splitmaxdepth\maxdimen
\vbadness\maxdimen
\setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}%
@@ -105,6 +118,7 @@
\fi
\else
\preparefootins
+ \prepare@bidi@copyins
\global\@firstcolumntrue
\setbox\@outputbox\vbox{%
\hb@xt@\textwidth{%
@@ -132,6 +146,125 @@
\endgroup
\fi}%
+\def\@startcolumn{%
+ \ifx\@deferlist\@empty
+ \global\@fcolmadefalse
+ \global\@colroom\@colht
+ \else
+ \ifvoid\footins\else
+ \ftn@amount\ht\footins
+ \advance\ftn@amount\dp\footins
+ \advance\ftn@amount\skip\footins
+ \fi
+ \ifvoid\@bidi@copyins@\else
+ \bidi@copyins@amount\ht\@bidi@copyins@
+ \advance\bidi@copyins@amount\dp\@bidi@copyins@
+ \advance\bidi@copyins@amount\skip\@bidi@copyins@
+ \fi
+ \global\advance\@colht-\ftn@amount
+ \global\advance\@colht-\bidi@copyins@amount
+ \global\@colroom\@colht
+ \@xstartcol
+ \global\advance\@colht\ftn@amount
+ \global\advance\@colroom\ftn@amount
+ \global\advance\@colht\bidi@copyins@amount
+ \global\advance\@colroom\bidi@copyins@amount
+ \fi
+ \if@fcolmade
+ \setbox\@cclv\box\@outputbox
+ \@makecol
+ \else
+ \ifvoid\footins\else
+ \insert\footins{\unvbox\footins}\fi
+ \ifvoid\@bidi@copyins@\else
+ \insert\@bidi@copyins@{\unvbox\@bidi@copyins@}\fi
+ \fi}
+
+\newdimen\bidi@copyins@amount
+
+\def\@makecol{\if@firstcolumn
+ \setbox\@outputbox\box\@cclv
+ \if@twocolumn \else
+ \ifvoid\footins \else
+ \@latexerr{ftnright package
+ used in one-column mode}%
+ {The ftnright package was designed to
+ work with LaTeX's standard^^Jtwocolumn
+ option. It does *not* work with the
+ multicol package.^^JSo please specify
+ `twocolumn' in the
+ \noexpand\documentclass command.}%
+ \shipout\box\footins \fi
+ \ifvoid\@bidi@copyins@ \else
+ \@latexerr{ftnright package
+ used in one-column mode}%
+ {The ftnright package was designed to
+ work with LaTeX's standard^^Jtwocolumn
+ option. It does *not* work with the
+ multicol package.^^JSo please specify
+ `twocolumn' in the
+ \noexpand\documentclass command.}%
+ \shipout\box\@bidi@copyins@ \fi\fi
+ \ifnum\insertpenalties>\z@
+ \@latexerr{ftnright package
+ scrambled footnotes}%
+ {There is too much footnote material in
+ the first column and ftnright^^Jis
+ unable to cope with this.^^JYou need
+ to reduce the amount to get a properly
+ formatted page.}%
+ \fi
+ \else
+ \ifvoid\footins
+ \ifvoid\@bidi@copyins@
+ \setbox\@outputbox\box\@cclv
+ \else
+ \setbox\@outputbox\vbox
+ {\ifvoid\@cclv \else
+ \unvbox\@cclv
+ \vskip \skip\@bidi@copyins@
+ \fi
+ \color@begingroup
+ \normalcolor
+ \unvbox \@bidi@copyins@
+ \color@endgroup}%
+ \fi
+ \else
+ \setbox\@outputbox\vbox
+ {\ifvoid\@cclv \else
+ \unvbox\@cclv
+ \vskip\skip\footins\fi
+ \color@begingroup
+ \normalcolor
+ \footnoterule\unvbox\footins
+ \color@endgroup
+ \ifvoid\@bidi@copyins@
+ \else
+ \vskip \skip\@bidi@copyins@
+ \color@begingroup
+ \normalcolor
+ \unvbox \@bidi@copyins@
+ \color@endgroup
+ \fi
+ }%
+ \fi
+ \fi
+ \xdef\@freelist{\@freelist\@midlist}%
+ \global \let \@midlist \@empty
+ \@combinefloats
+ \ifvbox\@kludgeins
+ \@makespecialcolbox
+ \else
+ \setbox\@outputbox\vbox to\@colht
+ {\boxmaxdepth\maxdepth
+ \@texttop
+ \@tempdima\dp\@outputbox
+ \unvbox\@outputbox
+ \vskip-\@tempdima
+ \@textbottom}%
+ \fi
+ \global\maxdepth\@maxdepth}
+
\let\leftfootnoterule\@empty
\let\rightfootnoterule\@empty
\let\textwidthfootnoterule\@empty
@@ -140,6 +273,10 @@
\long\def\@makefntext#1{\parindent 1em
\noindent\hbox to 2em{}%
\llap{\@thefnmark\hbox{.}\,\,}#1}
+
+\setlength{\skip\@bidi@copyins@}
+ {10pt plus 5pt minus 3pt}
+\AtBeginDocument{\prepare@bidi@copyins}
\endinput
%%
%% End of file `ftnright-xetex-bidi.def'.