blob: d575c60dbdfb0749fac2a2d2cf0b463a4459f5c7 (
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
%%
%% This is file `tabvar.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tabvar.dtx (with options: `sty')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from tabvar.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file tabvar.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%% Copyright (C) Daniel Flipo 2003-2012 <daniel.flipo at free.fr>
%%
\NeedsTeXFormat{LaTeX2e}[1997/06/01]
\ProvidesFile{tabvar.sty}
[2012/03/14 v1.61 (Daniel Flipo)]
\newif\ifFlechesMP \FlechesMPfalse
\DeclareOption{FlechesMP}{\FlechesMPtrue}
\DeclareOption{FlechesPS}{\FlechesMPfalse}
\ProcessOptions
\RequirePackage{array}
\RequirePackage{colortbl}
\RequirePackage{varwidth}
\RequirePackage{ifthen}
\RequirePackage{graphicx}
\RequirePackage{ifpdf}
\ifpdf
\DeclareGraphicsRule{*}{mps}{*}{}
\fi
\providecommand{\f@size}{10}
\newcommand{\TVarrowscale}{\strip@pt\dimexpr\f@size pt/10\relax}
\newcommand*{\TVarrowscolstretch}{1}
\newcommand*{\TV@arrowcol@stretch}[1]{%
\makebox[\TVarrowscolstretch\width][c]{#1}}
\newcommand*{\enearrow}{\enearrowi}
\newcommand*{\esearrow}{\esearrowi}
\newcommand*{\eastarrow}{\eastarrowi}
\newcommand*{\FlechesPS}[1]{%
\renewcommand*{\enearrow}{%
\csname enearrow\romannumeral#1\endcsname}%
\renewcommand*{\esearrow}{%
\csname esearrow\romannumeral#1\endcsname}%
\renewcommand*{\eastarrow}{%
\csname eastarrow\romannumeral#1\endcsname}%
}
\AtBeginDocument{%
\ifFlechesMP
\newsavebox{\arup}%
\newsavebox{\ardown}%
\newsavebox{\arhor}%
\sbox{\arup}{\includegraphics[scale=\TVarrowscale]{tabvar.1}}%
\sbox{\ardown}{\includegraphics[scale=\TVarrowscale]{tabvar.2}}%
\sbox{\arhor}{\includegraphics[scale=\TVarrowscale]{tabvar.3}}%
\newcommand*{\FlecheC}{%
\TV@arrowcol@stretch{\raisebox{.5ex}{\usebox{\arup}}}}%
\newcommand*{\FlecheD}{%
\TV@arrowcol@stretch{\raisebox{.5ex}{\usebox{\ardown}}}}%
\newcommand*{\FlecheH}{%
\TV@arrowcol@stretch{\raisebox{.5ex}{\usebox{\arhor}}}}%
\else
\DeclareFontFamily{U}{tv}{}%
\DeclareFontShape{U}{tv}{m}{n}{<->tabvar}{}%
\DeclareSymbolFont{tvsymbols}{U}{tv}{m}{n}%
\DeclareMathSymbol{\eastarrowi}{\mathrel}{tvsymbols}{"21}%
\DeclareMathSymbol{\enearrowi}{\mathrel}{tvsymbols}{"25}%
\DeclareMathSymbol{\esearrowi}{\mathrel}{tvsymbols}{"26}%
\DeclareMathSymbol{\eastarrowii}{\mathrel}{tvsymbols}{"31}%
\DeclareMathSymbol{\enearrowii}{\mathrel}{tvsymbols}{"35}%
\DeclareMathSymbol{\esearrowii}{\mathrel}{tvsymbols}{"36}%
\DeclareMathSymbol{\eastarrowiii}{\mathrel}{tvsymbols}{"3B}%
\DeclareMathSymbol{\enearrowiii}{\mathrel}{tvsymbols}{"3F}%
\DeclareMathSymbol{\esearrowiii}{\mathrel}{tvsymbols}{"40}%
\DeclareMathSymbol{\eastarrowiv}{\mathrel}{tvsymbols}{"46}%
\DeclareMathSymbol{\enearrowiv}{\mathrel}{tvsymbols}{"4A}%
\DeclareMathSymbol{\esearrowiv}{\mathrel}{tvsymbols}{"4B}%
\newcommand*{\FlecheC}{%
\TV@arrowcol@stretch{\ensuremath{\enearrow}}}%
\newcommand*{\FlecheD}{%
\TV@arrowcol@stretch{\ensuremath{\esearrow}}}%
\newcommand*{\FlecheH}{%
\TV@arrowcol@stretch{\ensuremath{\eastarrow}}}%
\fi}
\newdimen\TVextraheight
\setlength{\TVextraheight}{.7\baselineskip}
\newcount\@niveaux
\newcount\@pos
\newif\if@socle
\newcommand{\niveau}[2]{\global\@pos=#1 \global\@niveaux=#2
\global\@socletrue}
\newcommand{\@socle}{%
\ifnum\@pos=1 \@soclefalse \fi
\if@socle
\rule{\z@}{\TVextraheight}%
\@tempcnta=\@pos
\advance\@tempcnta by -1
\whiledo{\@tempcnta>0}{\TVnl \null \advance\@tempcnta by -1}%
\fi}
\newif\ifreset@niveaux
\newcommand{\reset@niveaux}{%
\ifreset@niveaux
\global\@niveaux=1 \global\@pos=1 \global\@soclefalse
\fi}
\newdimen\TVmaxcolwidth
\setlength{\TVmaxcolwidth}{\linewidth}
\newcolumntype{C}{%
>{\begin{varwidth}[b]{\TVmaxcolwidth}\let\TVnl=\\
\let\\=\TVtabularnewline $}%
c%
<{\@socle \reset@niveaux
$\@finalstrut\@arstrutbox\end{varwidth}}}
\newcolumntype{L}{%
>{\begin{varwidth}[b]{\TVmaxcolwidth}\let\TVnl=\\
\let\\=\TVtabularnewline $}%
l%
<{\@socle \reset@niveaux
$\@finalstrut\@arstrutbox\end{varwidth}}}
\newcolumntype{R}{%
>{\begin{varwidth}[b]{\TVmaxcolwidth}\let\TVnl=\\
\let\\=\TVtabularnewline $}%
r%
<{\@socle \reset@niveaux
$\@finalstrut\@arstrutbox\end{varwidth}}}
\definecolor{TVcolor}{gray}{0.7}
\newdimen\TVarraycolsep
\newdimen\TVcolorLeftSep
\newdimen\TVcolorRightSep
\setlength{\TVcolorLeftSep}{\TVarraycolsep}
\setlength{\TVcolorRightSep}{\TVarraycolsep}
\newcolumntype{U}{%
>{\columncolor{TVcolor}[\TVcolorLeftSep][\TVcolorRightSep]}
c}
\AtBeginDocument{%
\@ifundefined{NC@find@N}%
{\newcolumntype{N}{U}}%
{\PackageWarning{tabvar}{Le type de colonne N est d\'efini par
ailleurs. \MessageBreak Remplacer N par
U dans \protect\begin{tabvar}{...N...}
\MessageBreak}}%
}
\newcommand{\decroit}{\FlecheD
\global\advance\@pos by -1
\ifnum\@pos<1
\PackageError{tabvar.sty}%
{Les arguments la commande
\protect\niveau\space sont incorrects}%
\fi}
\newcommand{\croit} {\raisebox{-\baselineskip}{\FlecheC}%
\global\advance\@pos by 1
\ifnum\@pos>\@niveaux
\PackageError{tabvar.sty}%
{Les arguments la commande
\protect\niveau\space sont incorrects}%
\fi}
\newcommand{\constante}{\FlecheH}
\newcommand{\barre@dth}{%
\ifnum\@niveaux=1
\@tempdimc=\TVarraystretch\baselineskip
\else
\@tempcnta=\@niveaux
\advance\@tempcnta by -1
\@tempdimc=\@tempcnta\baselineskip
\@tempdimb=\TVextraheight
\ifdim\@tempdimb<.7\baselineskip
\@tempdimb=.7\baselineskip
\fi
\advance\@tempdimc by \@tempdimb
\advance\@tempdimc by \dp\@arstrutbox
\fi
\@tempdimb=\dp\@arstrutbox}
\newcommand{\dbarre}{%
\barre@dth
\rule[-\@tempdimb]{.5\p@}{\@tempdimc}%
\kern 2\p@
\rule[-\@tempdimb]{.5\p@}{\@tempdimc}%
\@soclefalse}
\newsavebox{\tab@box}
\definecolor{TVbarrecolor}{gray}{0.7}
\newcommand{\barre}[1]{%
\sbox{\tab@box}{\ensuremath{#1}}%
\barre@dth
\@tempcnta=\@pos
\advance\@tempcnta by -1
\advance\@tempdimb by \@tempcnta\baselineskip
\raisebox{-\@tempdimb}[0pt][0pt]{%
\makebox[\wd\tab@box][c]{\color{TVbarrecolor}%
\rule{.5\p@}{\@tempdimc}}}%
\kern-\wd\tab@box\usebox{\tab@box}%
}
\newcommand{\discont}[4][0]{%
\settowidth{\@tempdimc}{\ensuremath{#2}}%
\settowidth{\@tempdimb}{\ensuremath{#4}}%
\ifdim\@tempdimc<\@tempdimb \@tempdimc=\@tempdimb\fi
\rule{\z@}{\TVextraheight}%
\@soclefalse
\ifthenelse{\equal{#3}{<}}%
{\makebox[\@tempdimc]{\ensuremath{#4}}%
\@tempcnta=#1
\whiledo{\@tempcnta>0}{\TVnl \null \advance\@tempcnta by -1}%
\TVnl
\makebox[\@tempdimc]{\ensuremath{#2}}%
\@tempcnta=\@pos
\advance\@tempcnta by -1
\whiledo{\@tempcnta>0}{\TVnl \null \advance\@tempcnta by -1}%
\global\advance\@pos by 1
\global\advance\@pos by #1
}%
{\ifthenelse{\equal{#3}{>}}%
{\makebox[\@tempdimc]{\ensuremath{#2}}%
\@tempcnta=#1
\whiledo{\@tempcnta>0}{\TVnl \null \advance\@tempcnta by -1}%
\TVnl
\makebox[\@tempdimc]{\ensuremath{#4}}%
\@tempcnta=\@pos
\advance\@tempcnta by -2
\advance\@tempcnta by -#1
\whiledo{\@tempcnta>0}{\TVnl \null \advance\@tempcnta by -1}%
\global\advance\@pos by -1
\global\advance\@pos by -#1
}%
{\PackageError{tabvar.sty}%
{Le second argument de \protect\discont\space doit \^etre
\MessageBreak soit '<' soit '>'}}%
}%
}
\newcommand*{\TVcenter}[1]{%
\@tempcnta=\@niveaux \advance\@tempcnta by -1 \divide\@tempcnta by 2
\@tempdimb=\@tempcnta\baselineskip
\ifodd\@niveaux\else\advance\@tempdimb by .5\baselineskip\fi
\@pos=1\raisebox{\@tempdimb}{\ensuremath{#1}}%
}
\newcommand{\TVarraystretch}{1.5}
\setlength{\TVarraycolsep}{1pt}
\newenvironment{tabvar}[1]
{\renewcommand{\arraystretch}{\TVarraystretch}%
\setlength{\arraycolsep}{\TVarraycolsep}%
\global\@niveaux=1 \global\@pos=1 \global\@soclefalse
\def\TVtabularnewline{\reset@niveauxtrue\tabularnewline}%
\begin{array}{#1}}
{\end{array}}
\InputIfFileExists{tabvar.cfg}
{\typeout{loading tabvar.cfg}}
{\typeout{tabvar.cfg not found, using default values}}
\endinput
%%
%% End of file `tabvar.sty'.
|