summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/arabtex/atabg.sty
blob: 06bdc3488e920ad5afe28b72ce13ccf180a44dfa (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% atabg.sty
% called by altxext.sty
% 21.01.1997
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) Klaus Lagally
%     Institut fuer Informatik
%     Universitaet Stuttgart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\a@ident {atabg.sty} {3.05 LaTeX tabbing macros for Arabic} {21.01.1997}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \a@tabdef #1{\xpa\def \csname a@c@\string #1\endcsname }

\def \a@c@tabbing {% tabbing in Arabic mode
\a@tabdef >{\a@rtab 	\test@token }
\a@tabdef ={\a@settab 	\test@token }
\a@tabdef <{\@ltab 	\test@token }
\a@tabdef +{\@tabplus 	\test@token }
\a@tabdef -{\@tabminus 	\test@token }
\a@tabdef `{\a@tabrj 	\test@token }
\a@tabdef '{\a@tablab 	\test@token }
\def \a@last@line {\let \next \a@tabcr }
\let \endtabbing \a@endtabbing
\a@@par \lineskip \z@skip 
\@hightab \@firsttab \global\@nxttabmar \@firsttab
\dimen\@firsttab \@totalleftmargin \global\@tabpush \z@ 
\global\@rjfieldfalse
\trivlist \item\relax
\if@minipage \else \vskip\parskip \fi
\setbox\@tabfbox \hbox
	{\rlap {\indent \hskip\@totalleftmargin \the\everypar }}%
\def \@itemfudge {\box\@tabfbox }%
\a@startline \test@token }

\def \a@endtabbing {% end of Arabic tabbing environment
\a@stopline \aftergroup \a@spacefalse
\ifnum\@tabpush >\z@ \@badpoptabs \fi
\endtrivlist }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \a@startline{% open new tabbing line
\ifnum \@nxttabmar >\@hightab \@badtab \global\@nxttabmar \@hightab \fi
\global\@curtabmar \@nxttabmar \global\@curtab \@curtabmar
\global\setbox\@curline \hbox {}\a@startfield }

\def \a@stopline {% deposit tabbing line
\a@stopfield \a@spacefalse
\if@rjfield \global\@rjfieldfalse
	\@tempdima\@totalleftmargin \advance\@tempdima\linewidth
	\putwordb@x {\hb@xt@ \@tempdima
	{\box\@curfield \hfil \box\@curline
	\hskip\dimen\@curtabmar \@itemfudge }}%
\else \a@addfield \putwordb@x {\hbox
	{\box\@curline \hskip\dimen\@curtabmar \@itemfudge }}%
\fi \short@line }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \a@startfield {% new tabbing field
\initlineb@x \putwordb@x {\color@endgroup }}

\def \a@stopfield {% end of tabbing field
\global\setbox\@curfield \hbox {\color@begingroup \unhbox\lineb@x }}

\def \a@contfield {% continue tabbing field
\setbox\lineb@x \box\@curfield 
\a@spacefalse \putwordb@x {\color@endgroup }}

\def \a@addfield {% add field to current line
\ifdim \wd\@curfield = \z@ \else
\global\setbox\@curline \hbox 
	{\arab@space \unhbox\@curfield \unhbox\@curline }\fi }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \a@tabcr {\a@stopline \@ifstar{\penalty \@M \a@xtabcr }\a@xtabcr }
\def \a@xtabcr {\@ifnextchar[\a@itabcr {\a@startline \test@token }}
\def \a@itabcr [#1]{\vskip #1\a@startline \test@token }

\def \a@c@kill {\a@stopfield \a@startline \test@token }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \a@rtab {% \> skip right
\a@stopfield \a@addfield
\ifnum \@curtab<\@hightab \global\advance\@curtab \@ne 
\else\@badtab\fi
\@tempdima \dimen\@curtab
\advance\@tempdima -\dimen\@curtabmar
\advance\@tempdima -\wd\@curline
\global\setbox\@curline \hbox {\hskip\@tempdima \unhbox\@curline }%
\a@startfield }

\def \a@settab {% \= set tab
\a@stopfield \a@addfield
\ifnum \@curtab <\@maxtab
	\ifnum\@curtab =\@hightab \advance\@hightab \@ne \fi
	\global\advance\@curtab \@ne
\else \@latex@error{Tab overflow}\@ehd \fi
\dimen\@curtab \dimen\@curtabmar \advance\dimen\@curtab \wd\@curline
\a@startfield }

\def \a@tabrj {% \` field at right margin
\a@stopfield \a@addfield \global\@rjfieldtrue \a@startfield }

\def \a@tablab {% \' field right adjusted to last tab
\a@stopfield \dimen@ \wd\@curfield
\global\setbox\@curline \hbox {\hskip\tabbingsep \box\@curfield
	\hskip-\dimen@ \hskip-\tabbingsep \box\@curline }%
\a@startfield }

\def \a@c@pushtabs {% new level of tabs
\a@stopfield \a@addfield \global\advance\@tabpush \@ne 
\begingroup \a@contfield \test@token }

\def \a@c@poptabs {% return to previous level
\a@stopfield \a@addfield
\ifnum \@tabpush >\z@ \endgroup \global\advance\@tabpush \m@ne
	\ifnum \@curtab >\@hightab \global\@curtab \@hightab \@badtab \fi
\else \@badpoptabs \fi
\a@contfield \test@token }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EOF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%