summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/arabtex/arabaux.sty
blob: 490c00af79ca1aa5acb3ead69f0f745af5964ccb (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabaux.sty
% auxiliary macros for ArabTeX 
% 27.04.2003
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) Klaus Lagally
%     Institut fuer Formale Methoden der Informatik
%     Universitaet Stuttgart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\a@ident {arabaux.sty} {3.11 auxiliary macros for ArabTeX} {21.05.2003}

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

\def \a@message #1{% ArabTeX message
\message{(ArabTeX) #1}}

\def \isfalse {\xxpa \iffalse \fi }   % invert condition before \fi
\def \setiffalse {\xpa \iffalse \fi } % invert condition before \fi

\def \NOT #1{00\if #1\xpa \setiffalse \fi }

\def \AND #1#2{00\if #1\if #2\else \xxpa \setiffalse \fi
\else \xpa \setiffalse \fi }

\def \OR #1#2{00\if #1\else \if #2\else \xpa \setiffalse \fi \fi }

\def \isx #1#2{00\ifx #1#2\else\xpa \setiffalse \fi }

\def \iscat #1#2{00\ifcat #1#2\else\xpa \setiffalse \fi }

\def \is #1#2{00\if #1#2\else\xpa \setiffalse \fi }

\long\def \Return #1\fi {\fi #1}
\long\def \ReturnFi #1\fi {\fi #1}
\long\def \ReturnElseFi #1\else #2\fi {\fi #1}

\long\def \cond #1#2#3\fi {% call conditional
#1\ReturnElseFi {#2}\else \ReturnFi {#3}\fi }

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

\def \@gobble #1{}

\let \protect \relax

\ifx \@\undefined \def \@{@}\fi

\ifx \nil \undefined \def \nil {NIL}\fi

\def \pdef #1{% define robust command
\edef #1{\nxp\protect \xpa\nxp\csname \xpa\@gobble\string #1 \endcsname }%
\xpa\def \csname \xpa\@gobble\string #1 \endcsname }

\def \a@extend #1#2{% extend command definition, no pars!
\xpa\gdef \xpa#1\xpa{#1#2}}

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

% map token to action
% allow list of labels
\def \case #1\of #{%
  \begingroup \tracingmacros 0
  \def \l@@kup ##1#1##2##{\h@@d }%
  \getc@se #1\of }

\def \getc@se #1\of #2#3\endcase {%
  \doc@se #1#2\default {}\@end }

\def \doc@se #1#2\default #3#4\@end {%
  \l@@kup #2#1{#3}\@end }

\def \h@@d #1#2\@end {\endgroup #1}

% evaluate map: sets \result
\def \evalcase #1\of #{%
  \begingroup \tracingmacros 0
  \def \l@@kup ##1#1##2##{\r@sult }%
  \getc@se #1\of }

\def \r@sult #1#2\@end {\endgroup \def \result {#1}}

% apply function to map: 
\def \apply #1\tocase #2\of #{%
  \begingroup \tracingmacros 0
  \def \l@@kup ##1#2##2##{\@pply {#1}}%
  \getc@se #2\of }

\def \@pply #1#2#3\@end {\endgroup #1{#2}}

%%%%%%%%%%%%%%%%%%%%%%%% tracing control %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \tr@ceoff {% suspend temporarily, local, no nesting!
\edef \tr@ceon {\nxp\tracingmacros \the\tracingmacros }\tracingmacros 0 }

\def \notr@ce {% suspend temporarily, for NFSS only, no nesting!
\edef \dotr@ce {\nxp\tracingmacros \the\tracingmacros }\tracingmacros 0 }

\let \tr@ceon \relax     \let \dotr@ce \relax

\let \a@setfontsize \@setfontsize

\def \@setfontsize #1#2#3{% do not trace NFSS routine
\notr@ce \a@setfontsize {#1}{#2}{#3}\dotr@ce }

%%%%%%%%%%%%%%%%%%%%%%%% list utilities %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\long\def \is@in@list #1#2>{00% #1 token, #2 list                
  \begingroup \tracingmacros 0
  \def \l@@kup ##1#1##2\@ {\endgroup \ifx >##2\isfalse \fi }% 
  \l@@kup #2#1>\@ }

\long\def \ismember #1#2{00% #1 token, #2 list                
  \begingroup \tracingmacros 0
  \def \l@@kup ##1#1##2\@@ {\endgroup \ifx \nil ##2\xpa \setiffalse \fi }% 
  \l@@kup #2#1\nil \@@ }

\long\def \is@in@set #1#2{% #1 = symbol, #2 = token list of symbols
\xpa \ismember \xpa #1\xpa {\the #2}}

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

\newcount \hours        \newcount \mins

\def \timeofday 
{\hours \time \divide \hours 60 \the\hours:%
\mins \time \multiply \hours 60 \advance \mins -\hours 
\ifnum 10 > \mins \relax 0\fi \the\mins }

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