summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/arabtex/aedpatch.sty
blob: f5f8296fcc96127361db83c4e3238e2632c86220 (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% aedpatch.sty
% patches for EDMAC to operate with ArabTeX
% 19.03.93 2.07 EDMAC 3.00
% 19.06.94 3.02 EDMAC 3.15 compatible
%		\pstart, \pend, \autopar within Arabic
% 06.05.97 3.05 bug fixes, works with EDMAC 3.17
% 05.07.97 3.06 for edmacfss.sty
% 22.01.98 3.06a fixed parafootnote format
% 07.02.98 3.06a fixed parafootnote format for LaTeX
% 08.07.98 3.07  new ArabTeX version
% 10.04.99 3.08  fixed spurious space
% 20.08.03 3.11  cleanup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) Klaus Lagally
%     Institut fuer Informatik
%     Universitaet Stuttgart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ifx \aedatcode \undefined \else \expandafter \endinput
\fi % load only once

\chardef \aedatcode = \catcode`\@  \catcode`\@ = 11

\a@ident {aedpatch.sty} {3.11 ArabTeX extensions for EDMAC} {20.08.2003}

\def \tr@ce@n {\tracingmacros 0}

\def \tr@ce@ff {\edef \tr@ce@n 
	{\nxp\tracingmacros \the\tracingmacros }\tracingmacros 0}
\let \tr@ce@n \relax

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% modify some EDMAC commands in a compatible way

\long \def \text #1#2/{% inside Roman text
% depends on EDMAC version used
\leavevmode 
\begingroup \no@expands
	\xdef\@tag{#1}%
	\set@line \global\insert@count=0
	\ignorespaces #2\relax \flag@start
\endgroup
#1%
\a@end@lemma
\flag@end }

\def \a@end@lemma {% for EDMAC 3.00 and EDMAC 3.15
\ifx \end@lemma \undefined % as in EDMAC 3.15 - 3.17
	\ifx\end@lemmas\empty \else
	    \gl@p\end@lemmas\to\x@lemma
	    \x@lemma
	    \global\let\x@lemma=\relax
	\fi
\else \the\end@lemma % defined or EDMAC 3.00
\fi }

\def \lemma #1{% in argument of \text
% care for delayed expansion of some ArabTeX commands
  \begingroup \def \protect {\noexpand \protect \noexpand }%
     \xdef\@tag{#1}%
  \endgroup \ignorespaces }

\def \do@line {% break off a line from \raw@text
   {\vbadness=10000 \splittopskip=0pt
   \advance \baselineskip 1ex
% guard against some overfull \vboxes !
% Arabic lines have a greater height and depth
   \global \setbox\one@line
   \vsplit \raw@text to \baselineskip }% 
   \unvbox\one@line \global \setbox\one@line \lastbox \getline@num
   \hbox to \hsize {\affixline@num {\hfil
   \hbox to \wd\one@line {\new@line \unhbox\one@line }}}%
   \add@inserts
   \add@penalties }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% variants for use inside an Arabic environment

\def \<#1>{\RL{#1}} % allow long insertions

{\catcode `< \active
\gdef <#1>{\RL{#1}}} % allow long insertions

\def \a@c@text {% internal version of \text
% parameters will have the original catcodes
\tr@ce@n \leavea@vmode \unarab@codes \begingroup 
\tr@ce@ff \rm \tr@ce@n \a@@text }

\long \def \a@@text #1{% auxiliary routine
% to kill leading blanks and remove spurious braces from #2
\def \next@command {\a@@@text {#1}}%
\futurelet \next@token \test@space }

\def \a@append #1{% to the \lineb@x
\setbox \lineb@x \hbox {\unhbox \lineb@x #1}}

\def \a@get@text #1\@@ {% get flags and lemma
\a@append {\flag@start }\a@@Linsert {#1}}

\def \a@put@text {% unpack \Linsertb@x
\a@Lunpack \putwordb@x {\ins@skip }}

\long \def \a@@@text #1#2/{% inside arabic enviroment:
% stay in vertical mode, put the text into a \hbox
% and deposit the box *and* the \writes in the Arabic line
	\no@expands
	\def \next@command {\test@special}%
	\xdef \@tag{#1}\set@line \global\insert@count=0
	\aftergroup \a@get@text 
	% prepare for collecting any side effects of #2
	\ignorespaces #2\relax
\endgroup
	#1\a@end@lemma \@@ % close the text
	\a@put@text \a@append {\flag@end }%
	\arab@codes \a@spacetrue 
\tr@ce@ff \test@token }

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

\def \a@c@label #1{% outside the arguments of \text
% hide the \write commands inside a box in the Arabic line
% otherwise \do@line will not find the correct line breaks
  \do@labelsfile
  \ifx \labelref@list \empty \xdef \label@refs {\zz@@@ }%
  \else \gl@p \labelref@list \to \label@refs
  \fi
  \edef \next {\write\@aux {\string\make@labels \label@refs|{#1}}}%
  \global \setbox \wordb@x \hbox
          {\write\linenum@out {\string\@lab }\next }%
  \put@word \test@token }

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

\let \a@par \a@@par % save for \a@@everypar in \a@c@autopar

\def \a@c@pstart {\pstart \test@token }

\def \a@c@pend {\a@par \pend \a@par \test@token }

\def \a@c@autopar {% use inside Arabic environment
\ifnumbering \else \errmessage 
	{\string\autopar\space must be used within a numbered section}%
	\beginnumbering
\fi
\a@@everypar= {\setbox0 = \box \lineb@x \let \next \test@token
	\a@par \pstart % starts a group
	\def \a@@par {\a@par \pend \a@par }%
	\def \end {\a@par \pend \test@token \end }%
	\a@@everypar= {}\arab@indent }%
\a@spacefalse \test@token }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% allow still more EDMAC commands in Arabic text also

\all@w@ne \pageref      \all@w@ne \lineref      \all@w@ne \sublineref
\all@w@ne \xpageref     \all@w@ne \xlineref     \all@w@ne \xsublineref
\all@wtw@ \makelabel    \all@wtw@ \xxref

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% fix some bugs in EDMAC (Plain TeX and LaTeX2e versions)

\xpa\def \xpa\no@expands \xpa{\no@expands \let ~=0\relax }

\ifx\selectfont\undefined 

\font \nashix	=nash14 scaled 900
\font \nashviii	=nash14 scaled 800

\xpa\def \xpa\eightpoint \xpa{\eightpoint % Arabic is higher
\normalbaselineskip=15.99pt
\setbox\strutbox=\hbox{\vrule height10pt depth6pt width0pt}%
\normallineskiplimit -16pt
\setarabfont \nashviii
\normalbaselines \rm }

\else
\listfiles 

\def\notefontsetup{\rm\fontsize{8}{15.99pt}\selectfont
\lineskiplimit -\baselineskip }

\def \begin #1{% call \a@c@#1
% enable local \end
\@ifundefined {#1}%
{\def \@tempa {\@latexerr {Environment #1 undefined}\@eha }}%
{\def \@tempa {\def \@currenvir {#1}\csname #1\endcsname }}%
\begingroup \let \end \a@l@end \@endpefalse \@tempa }

\def \a@l@end #1{% call \end#1
% local version of \end
\csname end#1\endcsname \@checkend {#1}%
\if@endpe \global \let \@gtempa \@doendpe
\else \global \let \@gtempa \relax
\fi \endgroup \@gtempa }

\fi

\interparanoteglue{1em plus2em minus.4em}
% more stretch for Arabic text

\ifx \LaTeX \undefined \else \listfiles \fi

\def \end {\newlinechar `$\wlog {\arabtexconfig }\@@end }

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

\ifx \edmacloaded \relax
	\ifx \selectfont \undefined 
		\let \notefontsetup \eightpoint
	\fi
	\footnormal{A}	\footnormal{B}	\footnormal{C}
	\footnormal{D}	\footnormal{E}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\catcode`\@ = \aedatcode
\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EOF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%