summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi/multicol-xetex-bidi.def
blob: 604dd09d70e9b3a238129462fec87477feca6343 (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
162
163
164
165
%%
%% This is file `multicol-xetex-bidi.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% bidi.dtx  (with options: `table,multicol-xetex-bidi.def')
%% 
%%   __________________________________________________
%%   Copyright © 2009–2014  Vafa Khalighi <persian-tex@tug.org>
%% 
%%   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.
%% 
%% 
%% \CheckSum{43075}
%% \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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\ProvidesFile{multicol-xetex-bidi.def}[2014/09/20 v0.6 bidi adaptations for multicol package for XeTeX engine]
\def\page@sofar{%
   \process@cols\mult@rightbox
       {\ifvoid\count@
          \setbox\count@\hbox to\hsize{}%
        \else
          \wd\count@\hsize
        \fi}%
   \count@\col@number \advance\count@\m@ne
   \mult@info\z@
    {Column spec: \the\full@width\space = indent
                  + columns + sep =\MessageBreak
        \the\multicol@leftmargin\space
        + \the\col@number\space
        x \the\hsize\space
        + \the\count@\space
        x \the\columnsep
     }%
\ifvmode\else\errmessage{Multicol Error}\fi
   \nointerlineskip
   \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@
   \moveright\multicol@leftmargin
    \hbox to\full@width{%
       \bidi@multicol@align@columns
       \rlap{\phantom p}%
    }%
 \prevdepth\z@
 \kern-\dimen\tw@
 \ifdim\dimen\tw@ > \mc@gridwarn
   \PackageWarning{multicol}%
     {Very deep columns!\MessageBreak
      Grid alignment might be broken}%
 \fi
}
\def\LTR@column@boxes{%
    \process@cols\mult@gfirstbox{%
       \ifdim\dp\count@>\dimen\tw@
         \global\dimen\tw@\dp\count@ \fi
       \mc@col@status@write
       \box\count@
       \hss{\columnseprulecolor\vrule
              \@width\columnseprule}\hss}%
     \ifdim\dp\mult@rightbox>\dimen\tw@
       \global\dimen\tw@\dp\mult@rightbox \fi
     \mc@lastcol@status@write
     \box\mult@rightbox
}

\def\RTL@column@boxes{%
     \process@cols\mult@gfirstbox{%
       \hskip\hsize
       \hss{\columnseprulecolor\vrule
              \@width\columnseprule}\hss
     }%
     \hskip\hsize
     \process@cols\mult@gfirstbox{%
       \ifdim\dp\count@>\dimen\tw@
         \global\dimen\tw@\dp\count@ \fi
       \hskip-\hsize
       \mc@col@status@write
       \box\count@
       \hskip-\hsize
       \hskip-\columnsep
     }%
     \ifdim\dp\mult@rightbox>\dimen\tw@
       \global\dimen\tw@\dp\mult@rightbox \fi
     \hskip-\hsize
     \mc@lastcol@status@write
     \box\mult@rightbox
     \hskip-\hsize
     \hskip\full@width
 }
\newcommand\RTLmulticolcolumns
    {\let\bidi@multicol@align@columns
         \RTL@column@boxes}
\newcommand\LTRmulticolcolumns
    {\let\bidi@multicol@align@columns
      \LTR@column@boxes}
\newcommand\bidi@multicol@align@columns
    {\if@RTLmain\RTL@column@boxes\else\LTR@column@boxes\fi}
\def\multicols#1{\col@number#1\relax
  \ifnum\col@number<\tw@
     \PackageWarning{multicol}%
      {Using `\number\col@number'
       columns doesn't seem a good idea.^^J
       I therefore use two columns instead}%
     \col@number\tw@ \fi
  \ifnum\col@number>10
     \PackageError{multicol}%
      {Too many columns}%
      {Current implementation doesn't
       support more than 10 columns.%
       \MessageBreak
       I therefore use 10 columns instead}%
     \col@number10 \fi
     \ifx\@footnotetext\mult@footnotetext\else
       \let\orig@footnotetext\@footnotetext
       \let\@footnotetext\mult@footnotetext
     \fi
     \ifx\@LTRfootnotetext\mult@LTRfootnotetext\else
       \let\orig@LTRfootnotetext\@LTRfootnotetext
       \let\@LTRfootnotetext\mult@LTRfootnotetext
     \fi
     \ifx\@RTLfootnotetext\mult@RTLfootnotetext\else
       \let\orig@RTLfootnotetext\@RTLfootnotetext
       \let\@RTLfootnotetext\mult@RTLfootnotetext
     \fi
  \@ifnextchar[\mult@cols{\mult@cols[]}}
\long\def\mult@footnotetext#1{\begingroup
         \hsize\textwidth
         \columnwidth\textwidth
         \orig@footnotetext{#1}\endgroup}
\long\def\mult@LTRfootnotetext#1{\begingroup
         \hsize\textwidth
         \columnwidth\textwidth
         \orig@LTRfootnotetext{#1}\endgroup}
\long\def\mult@RTLfootnotetext#1{\begingroup
         \hsize\textwidth
         \columnwidth\textwidth
         \orig@RTLfootnotetext{#1}\endgroup}
\def\right@footnoterule{%
  \hbox to \textwidth
  {\beginR \vbox{\kern -3\p@
   \hrule width .4\columnwidth \kern2.6\p@}\hfil\endR}}
\def\textwidth@footnoterule{\kern-3\p@
  \hrule \@width \textwidth \kern 2.6\p@}
\endinput
%%
%% End of file `multicol-xetex-bidi.def'.