summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tabvar/demo.tex
blob: a1bcb77f94ad4a0fa7ada3488505f570354607fd (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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
%Format: PDF

\documentclass[a4paper,11pt]{article}

\addtolength{\textwidth}{10mm}
\addtolength{\oddsidemargin}{-5mm}
\setlength{\parindent}{0mm}
\setlength{\parskip}{.5\baselineskip}

\usepackage{tabvar}
%\usepackage[FlechesPS]{tabvar}
%\usepackage[FlechesMP]{tabvar}

\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}

\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}

\begin{document}
\thispagestyle{empty}

\begin{center}
  \Large\bfseries Exemples de tableaux de variations avec \texttt{tabvar}
\end{center}

Un exemple simple : 
$\displaystyle f(x)=\frac{x^3+2}{2x} \qquad f'(x)=\frac{x^3-1}{x^2}$.

\[\begin{tabvar}{|C|CCCCCCCCC|} \hline
 x    &-\infty &   &-\sqrt[3]{2} &   & 0       &   & 1  &    &+\infty      
\\ \hline
f'(x) &        & - &             & - & \dbarre & - & 0  & +  & 
\\ \hline
\niveau{3}{3}f(x)  
      &+\infty                       &\decroit 
      &0                             &\decroit
      &\discont{-\infty}{<}{+\infty} &\decroit
      &\frac{3}{2}                   &\croit
      &+\infty
\\ \hline
\end{tabvar}\]

Le codage du tableau est le suivant :
\begin{verbatim}
\[\begin{tabvar}{|C|CCCCCCCCC|} \hline
 x    &-\infty &  &-\sqrt[3]{2} &  &0       &  & 1 &  &+\infty      
\\ \hline
f'(x) &        &- &             &- &\dbarre &- & 0 &+ & 
\\ \hline
\niveau{3}{3}f(x)  
      &+\infty                       &\decroit 
      &0                             &\decroit
      &\discont{-\infty}{<}{+\infty} &\decroit
      &\frac{3}{2}                   &\croit
      &+\infty
\\ \hline
\end{tabvar}\]
\end{verbatim}

L'argument optionnel de \verb|\discont| n'a pas été utilisé, on obtiendrait
une meilleure présentation en lui donnant la valeur~1, ce qui écarterait
d'un interligne les valeurs $+\infty$ et~$-\infty$, mettant ainsi
les trois valeurs~$+\infty$ sur la même ligne.

D'autre part, $f(x)$ est placé au niveau~3 par la commande \verb|\niveau|.
Si on souhaitait que $f(x)$ soit placé plus bas, au niveau~2 par exemple,
il faudrait coder :\\
\verb|\niveau{2}{3}f(x)} &\niveau{3}{3}+\infty}|

Voici le résultat obtenu avec ces deux modifications :
\[\begin{tabvar}{|C|CCCCCCCCC|} \hline
 x    &-\infty &  &-\sqrt[3]{2} &  &0       &  & 1 &  &+\infty      
\\ \hline
f'(x) &        &- &             &- &\dbarre &- & 0 &+ & 
\\ \hline
\niveau{2}{3}f(x)  
      &\niveau{3}{3}+\infty             &\decroit 
      &0                                &\decroit
      &\discont[1]{-\infty}{<}{+\infty} &\decroit
      &\frac{3}{2}                      &\croit
      &+\infty
\\ \hline
\end{tabvar}\]

Une présentation plus traditionnelle du tableau de variations serait la
suivante (on renonce à l'utilisation de \verb|\discont| et on remplace
la colonne \texttt{C} par trois colonnes \texttt{LCR}, la colonnne
centrale contenant une double barre).

\[\begin{tabvar}{|C|CCCCLCRCCCC|} \hline
 x    &-\infty &  &-\sqrt[3]{2} &  & &0       & &  & 1 &  &+\infty      
\\ \hline
f'(x) &        &- &             &- & &\dbarre & &- & 0 &+ & 
\\ \hline
\niveau{2}{3}f(x)  
      &\niveau{3}{3}+\infty                    &\decroit 
      &0                                       &\decroit
      &-\infty  &\dbarre &\niveau{3}{3}+\infty &\decroit
      &\frac{3}{2}                             &\croit
      &+\infty
\\ \hline
\end{tabvar}\]

Le codage est le suivant :
\begin{verbatim}
\[\begin{tabvar}{|C|CCCCRCLCCCC|} \hline
 x    &-\infty &  &-\sqrt[3]{2} &  & &0       & &  & 1 &  &+\infty      
\\ \hline
f'(x) &        &- &             &- & &\dbarre & &- & 0 &+ & 
\\ \hline
\niveau{2}{3}f(x)  
      &\niveau{3}{3}+\infty                    &\decroit 
      &0                                       &\decroit
      &-\infty  &\dbarre &\niveau{3}{3}+\infty &\decroit
      &\frac{3}{2}                             &\croit
      &+\infty
\\ \hline
\end{tabvar}\]
\end{verbatim}

Noter la présence de la seconde commande \verb|\niveau| pour
positionner le terme \verb|+\infty| au niveau~3 après la discontinuité.

\newpage
Un exemple de courbe paramétrée :
$\displaystyle x(t)= t + \frac{1}{t}\qquad y(t) = t + \frac{1}{2t^2}$.

\[
\begin{tabvar}{|C|CCRCCCCCC|} \hline
 t    &-\infty &   &-1  &   & 0       &   & 1  &   &+\infty      
\\ \hline
x'(t) &        &+  & 0  & - & \dbarre & - & 0  & + & 
\\ \hline
\niveau{1}{3}
x(t) &-\infty                                &\croit 
           &-2                               &\decroit 
           &\discont[1]{-\infty}{<}{+\infty} &\decroit 
           &2                                &\croit
           &+\infty
\\ \hline
\niveau{1}{3}
y(t) &-\infty            &\croit 
           &-\frac{1}{2} &\croit
           &+\infty      &\decroit
           &\frac{3}{2}  &\croit
           &+\infty
\\ \hline
y'(t) &        &+  &2   & + & \dbarre & - & 0  &+   &             
\\ \hline
\end{tabvar}
\]

Le codage est le suivant :
\begin{verbatim}
\[\begin{tabvar}{|C|CCRCCCCCC|} \hline
 t    &-\infty &   &-1  &   & 0       &   & 1  &   &+\infty      
\\ \hline
x'(t) &        &+  & 0  & - & \dbarre & - & 0  & + & 
\\ \hline
\niveau{1}{3}
x(t) &-\infty                                &\croit 
           &-2                               &\decroit 
           &\discont[1]{-\infty}{<}{+\infty} &\decroit 
           &2                                &\croit
           &+\infty
\\ \hline
\niveau{1}{3}
y(t) &-\infty            &\croit 
           &-\frac{1}{2} &\croit
           &+\infty      &\decroit
           &\frac{3}{2}  &\croit
           &+\infty
\\ \hline
y'(t) &        &+  &2   & + & \dbarre & - & 0  &+   &             
\\ \hline
\end{tabvar}\]
\end{verbatim}

\newpage
Le même tableau de variations en présentation \og traditionnelle \fg :

\[\begin{tabvar}{|C|CCRCRCLCCCC|} \hline
 t    &-\infty &  &-1  &   & &0       &  &   & 1 &   &+\infty      
\\ \hline
x'(t) &        &+ & 0  & - & &\dbarre &  & - & 0 & + & 
\\ \hline
\niveau{1}{3}
x(t) &-\infty                                       &\croit 
           &-2                                      &\decroit 
           &-\infty  &\dbarre &\niveau{3}{3}+\infty &\decroit 
           &2                                       &\croit
           &+\infty
\\ \hline
\niveau{1}{3}
y(t) &-\infty                         &\croit 
           &-\frac{1}{2}              &\croit
           &+\infty &\dbarre &+\infty &\decroit
           &\frac{3}{2}               &\croit
           &+\infty
\\ \hline
y'(t) &        &+  &2   & + & & \dbarre & & - & 0  &+   &             
\\ \hline
\end{tabvar}\]

Le codage est le suivant :

\begin{verbatim}
\[\begin{tabvar}{|C|CCRCRCLCCCC|} \hline
 t    &-\infty &   &-1  &   & & 0       &  &   & 1  &    &+\infty      
\\ \hline
x'(t) &        &+  & 0  & - & & \dbarre &  & - & 0  & +  & 
\\ \hline
\niveau{1}{3}
x(t) &-\infty                                       &\croit 
           &-2                                      &\decroit 
           &-\infty  &\dbarre &\niveau{3}{3}+\infty &\decroit 
           &2                                       &\croit
           &+\infty
\\ \hline
\niveau{1}{3}
y(t) &-\infty                         &\croit 
           &-\frac{1}{2}              &\croit
           &+\infty &\dbarre &+\infty &\decroit
           &\frac{3}{2}               &\croit
           &+\infty
\\ \hline
y'(t) &        &+  &2   & + & & \dbarre & & - & 0  &+   &             
\\ \hline
\end{tabvar}\]
\end{verbatim}

\newpage
Le même tableau encore, mais cette fois on utilise les flèches
dessinées en MetaPost :
\begingroup
\renewcommand{\FlecheC}{\FlecheCm}
\renewcommand{\FlecheD}{\FlecheDm}
\renewcommand{\FlecheH}{\FlecheHm}

\[\begin{tabvar}{|C|CCRCRCLCCCC|} \hline
 t    &-\infty &  &-1  &   & &0       &  &   & 1 &   &+\infty      
\\ \hline
x'(t) &        &+ & 0  & - & &\dbarre &  & - & 0 & + & 
\\ \hline
\niveau{1}{3}
x(t) &-\infty                                       &\croit 
           &-2                                      &\decroit 
           &-\infty  &\dbarre &\niveau{3}{3}+\infty &\decroit 
           &2                                       &\croit
           &+\infty
\\ \hline
\niveau{1}{3}
y(t) &-\infty                         &\croit 
           &-\frac{1}{2}              &\croit
           &+\infty &\dbarre &+\infty &\decroit
           &\frac{3}{2}               &\croit
           &+\infty
\\ \hline
y'(t) &        &+  &2   & + & & \dbarre & & - & 0  &+   &             
\\ \hline
\end{tabvar}\]
\endgroup

Le choix entre les flèches MetaPost et celles de Michel \textsc{Bovani} se
fait normalement soit à l'aide des options 
%\texttt{FlechesMP} ou\texttt{FlechesPS} 
de \texttt{tabvar} (\verb|\usepackage[FlechesMP]{tabvar}|)
soit dans le préambule ou dans le fichier \texttt{tabvar.cfg}, à l'aide du
drapeau \verb|\FlechesMP| : \verb|\FlechesMPtrue| pour les 
flèches MetaPost (par défaut les flèches 
\og bovaniennes \fg{} sont utilisées).

Un exemple de fonction non définie partout :
$\displaystyle f(x) = \sqrt{\frac{x-1}{x+1}}$. 

\[\begin{tabvar}{|C|CCRNLCC|} \hline
 x    &-\infty &       &-1       &\hspace*{15mm} & 1              &    &+\infty
\\ \hline
 f'(x) &       & +     &         &               &+\infty         & +  &
\\ \hline
\niveau{1}{2}
f(x)  &1     &\croit &+\infty   &               
          &\niveau{1}{2}0 &\croit & 1
\\ \hline
\end{tabvar}\]

Le codage est le suivant
\begin{verbatim}
\[\begin{tabvar}{|C|CCRNLCC|} \hline
 x     &-\infty &  &-1 &\hspace*{15mm} & 1      &  &+\infty
\\ \hline
 f'(x) &        &+ &   &               &+\infty &+ &
\\ \hline
\niveau{1}{2}
f(x)  &1     &\croit &+\infty   &               
          &\niveau{1}{2}0 &\croit & 1
\\ \hline
\end{tabvar}\]
\end{verbatim}

La largeur de la colonne grisée est fixée à~15mm par le \verb|\hspace*{15mm}|
placé dans une ligne quelconque du tableau. Certains visualiseurs
(Xdvi par exemple) n'affichent pas correctement les couleurs ;
en cas de doute, vérifier sur une sortie PostScript ou PDF. 

Noter l'emploi d'une seconde commande \verb|\niveau{1}{2}| pour positionner
la valeur de~$f$ au point~1 (sans celle-ci, cette valeur serait placée
au niveau de la valeur précédente, ici~$+\infty$. 

Si on prolongeait la définition de $f$ en posant $f(x)=0$ sur $[-1,1]$
on aurait le tableau suivant :

\[\begin{tabvar}{|C|CCRCCCCC|} \hline
 x     &-\infty &       &        &-1      &   & 1      &  &+\infty
\\ \hline
 f'(x) &        &+      &        &\dbarre & 0 &+\infty &+ &
\\ \hline
\niveau{1}{2}
f(x)  &1        &\croit &+\infty &\niveau{1}{2}0 
                                   &\constante &0 &\croit & 1
\\ \hline
\end{tabvar}\]

Le codage est le suivant :

\begin{verbatim}
\[\begin{tabvar}{|C|CCRCCCCC|} \hline
 x     &-\infty &       &        &-1      &   & 1      &  &+\infty
\\ \hline
 f'(x) &        &+      &        &\dbarre & 0 &+\infty &+ &
\\ \hline
\niveau{1}{2}
f(x)  &1        &\croit &+\infty &\niveau{1}{2}0 
                                   &\constante &0 &\croit & 1
\\ \hline
\end{tabvar}\]
\end{verbatim}

\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% coding: latin-1
%%% End: