summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bidi/flowfram-xetex-bidi.def
blob: 4b856895211d002ca4d76c6080e8f3fa28d5f16b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
%%
%% This is file `flowfram-xetex-bidi.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% bidi.dtx  (with options: `flowfram-xetex-bidi.def')
%% 
%%   ______________________________________
%%   Copyright © 2009–2011  Vafa Khalighi
%% 
%%   License information appended.
%% 
%% 
\ProvidesFile{flowfram-xetex-bidi.def}[2010/07/25 v0.2 bidi adaptations for flowfram package for XeTeX engine]
\def\@outputdblcol{%
\@nxtcol=\c@thisframe
\c@curpg=\c@page
\@g@tnextcol{\@nxtcol}%
\if@ff@nwpg % next flow frame starts on new page
  \global\@firstcolumntrue
  \@setcolbox\c@thisframe
  \if@specialpage
    \global\@specialpagefalse
    \@nameuse{ps@\@specialstyle}\relax
  \fi
  \if@twoside
    \ifodd\count\z@
      \let\@thehead\@oddhead
      \let\@thefoot\@oddfoot
    \else
      \let\@thehead\@evenhead
      \let\@thefoot\@evenfoot
    \fi
  \else
    \let\@thehead\@oddhead
    \let\@thefoot\@oddfoot
  \fi
  \@begindvi
  \@dodynamicthehead\@dodynamicthefoot
  \vbadness=\@M
  \setbox\@outputbox\vbox{\hbox to \textwidth{\@ff@do@allframes}}%
  \@combinedblfloats
  \@outputpage
\advance\c@curpg by -\c@page\relax
  \whiledo{\c@curpg>0}{\advance\c@curpg by -1\relax
  \setbox\@outputbox\vbox{\hbox to \textwidth{\@ff@do@allframes}}%
\@outputpage}
  \begingroup
    \@dblfloatplacement
    \@startdblcolumn
    \@whilesw \if@fcolmade \fi
       {\@outputpage \@startdblcolumn }\endgroup
  \@resetst@tics
  \@resetdyn@mics
\else % still on same page, save contents of box255
  \global\@firstcolumnfalse
  \@setcolbox\c@thisframe
\fi
\global\c@thisframe=\@nxtcol
\@setcol{\c@thisframe}\relax
\global\@colht\vsize
}
\def\@outputpage{%
\begingroup
  \let\protect\noexpand
  \@resetactivechars
  \global\let\@@if@newlist\if@newlist
  \global\@newlistfalse\@parboxrestore
  \shipout\vbox{\set@typeset@protect
    \aftergroup
    \endgroup
    \aftergroup
    \set@typeset@protect
    \reset@font\normalsize\normalsfcodes
    \let\label\@gobble
    \let\index\@gobble
    \let\glossary\@gobble
    \baselineskip\z@skip
    \lineskip\z@skip
    \lineskiplimit\z@
    \vskip\topmargin\moveright\@themargin
    \vbox{%
      \vskip\headheight
      \vskip\headsep
      \box\@outputbox
    }}%
  \global\let\if@newlist\@@if@newlist
  \stepcounter{page}%
  \setcounter{displayedframe}{0}%
  \let\firstmark\botmark}

\newcommand*\bidi@s@tfftextcol{\ifthenelse{\equal{\ff@txtcol}{}}{}{%
\expandafter\bidicolor\ff@txtcol}}

\newcommand{\bidi@ff@box}[3]{{\@ffbackground{\vbox to#2
{\hb@xt@ #1{\hss{\bidi@s@tfftextcol #3}\hss}\vss\kern\z@}}}}

\renewcommand*{\@docolbox}[1]{%
\edef\ff@frametype{%
\csname @ff@frametype@\romannumeral#1\endcsname}%
\edef\ff@col{\csname @ff@col@\romannumeral#1\endcsname}%
\edef\ff@txtcol{\csname @ff@txtcol@\romannumeral#1\endcsname}%
\edef\ff@backcol{\csname @ff@backcol@\romannumeral#1\endcsname}%
\@ff@setoffset{#1}%
\rotateframe{\csname @ff@angle@\romannumeral#1\endcsname}{%
\ifthenelse{\boolean{columnframe\romannumeral#1}}{%
\@ff@fbox{\csname colwidth\romannumeral#1\endcsname}%
{\csname colheight\romannumeral#1\endcsname}{%
\expandafter\box\csname column\romannumeral#1\endcsname}{%
\csname\ff@frametype\endcsname}%
}{%
\bidi@ff@box{\csname colwidth\romannumeral#1\endcsname}%
{\csname colheight\romannumeral#1\endcsname}{%
\expandafter\box\csname column\romannumeral#1\endcsname}%
}}}
\@ifclassloaded{book}{%
\renewcommand\theequation
  {\ifnum \c@chapter>\z@ \thechapter\@SepMark\fi \@arabic\c@equation}
\renewcommand \thefigure
     {\ifnum \c@chapter>\z@ \thechapter\@SepMark\fi \@arabic\c@figure}
\renewcommand \thetable
     {\ifnum \c@chapter>\z@ \thechapter\@SepMark\fi \@arabic\c@table}
\renewcommand \thechapter {\@arabic\c@chapter}
\renewcommand \thesection {\thechapter\@SepMark\@arabic\c@section}
\renewcommand\thesubsection   {\thesection\@SepMark\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection \@SepMark\@arabic\c@subsubsection}
\renewcommand\theparagraph    {\thesubsubsection\@SepMark\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph\@SepMark\@arabic\c@subparagraph}}{}
\@ifclassloaded{report}{%
\renewcommand\theequation
  {\ifnum \c@chapter>\z@ \thechapter\@SepMark\fi \@arabic\c@equation}
\renewcommand \thefigure
     {\ifnum \c@chapter>\z@ \thechapter\@SepMark\fi \@arabic\c@figure}
\renewcommand \thetable
     {\ifnum \c@chapter>\z@ \thechapter\@SepMark\fi \@arabic\c@table}
\renewcommand \thechapter {\@arabic\c@chapter}
\renewcommand \thesection {\thechapter\@SepMark\@arabic\c@section}
\renewcommand\thesubsection   {\thesection\@SepMark\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection \@SepMark\@arabic\c@subsubsection}
\renewcommand\theparagraph    {\thesubsubsection\@SepMark\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph\@SepMark\@arabic\c@subparagraph}}{}
\renewcommand{\rotateframe}[2]{\if@ttb@rotate
\rotatebox{#1}{\if@RTL\beginL\fi#2\if@RTL\endL\fi}%
\else
#2\relax
\fi}
%% 
%% Copyright © 2009–2011  Vafa Khalighi <vafaklg@gmail.com>
%% 
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is “author-maintained” (as per LPPL maintenance status)
%% by Vafa Khalighi.
%% 
%% 
%% 
%%
%% End of file `flowfram-xetex-bidi.def'.