File: tabsignes

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (685 lines) | stat: -rw-r--r-- 26,409 bytes parent folder | download
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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
!!!! tabsignes v1.20 / 24-04-2022
!!!! NEWS :
!! En mode manuel compltion automatique des items manquants en fin de liste par des items vides
!! Option nocss pour ne pas appeler le css via la slib


!if $wims_read_parm!=slib_header
  !goto proc
!endif

slib_title=Tableau de signes d'une fonction numrique
slib_parms=2\
,<strong>les informations permettant de remplir le tableau</strong> en mode semi-automatique ou tout le contenu du tableau en mode non automatique&nbsp;: <ul><li>Pour un calcul semi-automatique du contenu du tableau (entre 2 paires de crochets):<br> <span class="tt wims_code_words">[[</span>la variable,les fonctions spares par des virgules<span class="tt wims_code_words">],[</span>borne inf,borne sup;racines spares par des virgules; valeurs interdites spares par des virgules<span class="tt wims_code_words">]]</span></li><li>Pour un mode non automatique (toutes les informations sont  indiquer entre une seule paire de crochets):<br><span class="tt wims_code_words">[</span>lments ligne 1 spars par des virgules; lments ligne 2 spars par des virgules; ....<span class="tt wims_code_words">]</span></li></ul>\
,<strong>options&nbsp;:</strong> (spares par des espaces).<br class="spacer">Les options marques de (*) ne sont utilisables qu'avec le mode semi-automatique.<ul><li><span class="tt wims_code_words">wimscenter</span> pour centrer le tableau.</li><li><span class="tt wims_code_words">allvalues</span> (*) pour afficher aussi les images autres que 0.</li><li><span class="tt wims_code_words">id</span>=[mon_id] pour donner mon_id comme id au tableau. Par dfaut, si cette option n'est pas utilise, le tableau aura pour id <em>wimstab1</em>. Dans le cas de plusieurs appels de cette slib dans la mme page, les id automatiques seront <em>wimstab1</em>, <em>wimstab2</em>...Les id <em>wimstabxx</em> tant rservs pour des gnrations automatiques d'id, ne pas les utiliser soi-mme pour gnrer un id.</li><li><span class="tt wims_code_words">text</span>=[mon_texte,before,numro de ligne ou all] ou [mon_texte,replace,numro de ligne ou all] pour ajouter mon_texte devant l'expression de la fonction ou remplacer toute l'expression par mon_texte aux lignes indiques.</li><li><span class="tt wims_code_words">+</span>=[red,all] pour mettre tous les signes + en rouge ou <span class="tt wims_code_words">+</span>=[red] pour mettre uniquement les signes + de la dernire ligne en rouge. Idem pour l'option <span class="tt wims_code_words">-</span></li><li><span class="tt wims_code_words">reply</span>=[[ligne_i,colonne_j;ligne_k,colonne_m;...],[n]] pour indiquer les cellules  transformer en champs rponses reply o n est le rang de la premire reply pour une utilisation avec la mthode spciale <span class="tt wims_code_words">codeinput</span>.</li><li><span class="tt wims_code_words">code</span> (*) pour sortir la matrice du contenu du tableau.</li><li><span class="tt wims_code_words">nocss</span> pour ne pas appeler le CSS via la slib (voir les commentaires ci-dessous).</li></ul>

slib_out=<ul><li><span class="tt wims_code_words">Le tableau au format HTML</span> ou <span class="tt wims_code_words">la matrice du contenu du tableau</span> si l'option \
<span class="tt wims_code_words">code</span> a t choisie.</li>\
<li><span class="tt wims_code_words">Le tableau au format HTML,[les rponses attendues spares par une virgule]</span> dans le cas o l'option <span class="tt wims_code_words">reply</span> a t choisie.</li></ul>

slib_comment=<ul><li>Quel que soit le mode, aucun code TeX  saisir pour les \
expressions des fonctions et pour les nombres.</li>\
<li>Utiliser <span class="tt wims_code_words">-Inf</span> et <span class="tt wims_code_words">+Inf</span>.</li>\
<li>Mettre <span class="tt wims_code_words">db</span> pour doubles barres (mode non auto).</li>\
<li>Mettre <span class="tt wims_code_words">ndef</span> pour fonction non dfinie sur un \
intervalle (mode non auto).</li>\
<li>Code TeX autoris pour le rajout de texte avec l'option \
<span class="tt wims_code_words">text</span>.</li>\
<li>Chaque cellule du tableau a un id de la forme \
<span class="tt wims_code_words">id_l_c</span>, o <span class="tt wims_code_words">id</span> \
est l'id du tableau, <span class="tt wims_code_words">l</span> est le numro de \
la ligne et <span class="tt wims_code_words">c</span> est le numro de la colonne.</li>\
<li>Par dfaut, le style CSS utilis pour le tableau de signes est automatiquement appel par la slib \
sauf si l'option <span class="tt wims_code_words">nocss</span> est mise.<br> Dans le cas \
de plusieurs appels de cette slib, sans l'option nocss, dans une mme page, c'est le \
1<sup>er</sup> appel de la slib qui charge le CSS pour toute la page.<br>\
Dans le cas de l'option <span class="tt wims_code_words">nocss</span>, il faut alors appeler \
le CSS avec  <span class="nowrap">&lt;link rel="stylesheet" href="themes/_css/slib/tabsignes.css"&gt;</span>\
dans &#92;css{} par exemple pour un exercice OEF.<br>\
La feuille de style CSS&nbsp;: <a target="wims_external" href="/wims/html/themes/_css/slib/tabsignes.css">tabsignes.css</a>.</li></ul>

!!!! FIN FICHIER LANG

slib_author=Gilles,Marbeuf

slib_example=[[x,1/x],[-Inf,+Inf;;0]]\
[[u,cos(u)],[0,(3*pi)/4; pi/2;]],text=[Signe de,before,2]\
[[u,cos(u)],[0,(3*pi)/4; pi/2;]],allvalues\
[[x,x^2-1,ln(x^2-1)],[-Inf,+Inf;-sqrt(2),-1,1,sqrt(2);-1,1]],allvalues\
[[x,x-4,ln(x-1),(x-4)ln(x-1)],[1,+Inf;2,4;1]],wimscenter id=[tab]\
[[x,x^2-1,sqrt(x^2-1),1/sqrt(x^2-1)],[-Inf,+Inf;1,-1;1,-1]],-=[blue,all] +=[red,all] text=[Signe de,before,2;Signe de,before,3;Signe de \(f(x)\),replace,4]\
[[x,x-1,x+1,x,(x-1)(x+1)/x],[-Inf,+Inf;1,-1,0;0]],wimscenter -=[#3BE41E,all] +=[red] text=[Signe de,before,all]\
[[x,x^2-1,e^x,e^x/(x^2-1)],[-Inf,+Inf;-1,1;-1,1]],reply=[[1,6;4,4;2,3],[1]]\
[[x,x^2-1/4,e^x,e^x/(x^2-1/4)],[-Inf,+Inf;-1/2,1/2;-1/2,1/2]],code\
[x,-Inf,,x_1,,x_2,,+Inf;a x^2+b x +c,,+,0,-,0,-;x^2,2,-,0,+],text=[Signe de,before,2]\
[x,0,,a,,+Inf;f(x),db,-,0,+,],wimscenter +=[red] -=[#FBCC00]\
[x,-Inf,,-1,,1,,+Inf;u(x),,+,0,-,0,+,;sqrt(u(x)),,+,0,ndef,0,+,],reply=[[2,3;2,6;3,7],[2]]
!exit

slib_require=maxima pari
!exit

:proc

!set wims_multiexec=pari maxima yacas octave gap

!!!! METTRE MAXIMA EN MODE ALGEBRAIC - SUPPRIME POUR L INSTANT!!!
!!!!exec maxima algebraic:true;

!!!!! RECUPERATION DES PARAMETRES  !!!!!

!distribute items $wims_read_parm into slib_param1,slib_option
slib_param1=!declosing $slib_param1
slib_nbparam1=!itemcnt $slib_param1

!!! OPTION NE PAS APPELER themes/_css/slib/tabsignes.css prsent sur serveur !!!
!if nocss iswordof $slib_option
  slib_nocss=nocss
!endif


!!! OPTION POUR CENTRER LE TABLEAU  !!!
!if wimscenter iswordof $slib_option
  slib_wimscenter=wimscenter
!endif

!!! OPTION POUR AVOIR QUE LES 0 OU AUTRES IMAGES !!!
!if allvalues iswordof $slib_option
  slib_allvalues=yes
!endif

!!! OPTION EN MODE AUTO POUR SORTIR LA MATRICE CONTENT PLUTOT QUE LE TABLEAU  !!!
!if code iswordof $slib_option
  slib_code=1
!else
  slib_code=0
!endif

!!! OPTION POUR METTRE SIGNES + ET - EN COULEUR
slib_colorplus=!getopt + in $slib_option
slib_colorplus=!lower $slib_colorplus
!if $slib_colorplus!=$empty
  !if $slib_colorplus=+ or $slib_colorplus=all
    slib_colorplus_opt=no
    slib_colorplus=
  !else
    slib_colorplus_opt=yes
    slib_colorplus=!declosing $slib_colorplus
    !if $(slib_colorplus[1])=all
      slib_temp_colorplus1=$(slib_colorplus[1])
      slib_temp_colorplus2=$(slib_colorplus[2])
      slib_colorplus=$slib_temp_colorplus2,$slib_temp_colorplus1
    !endif
  !endif
!else
  slib_colorplus_opt=no
!endif
slib_colormoins=!getopt - in $slib_option
slib_colormoins=!lower $slib_colormoins
!if $slib_colormoins!=$empty
  !if $slib_colormoins=- or $slib_colormoins=all
    slib_colormoins_opt=no
    slib_colormoins=
  !else
    slib_colormoins_opt=yes
    slib_colormoins=!declosing $slib_colormoins
    !if $(slib_colormoins[1])=all
      slib_temp_colormoins1=$(slib_colormoins[1])
      slib_temp_colormoins2=$(slib_colormoins[2])
      slib_colormoins=$slib_temp_colormoins2,$slib_temp_colormoins1
    !endif
  !endif
!else
  slib_colormoins_opt=no
!endif

!!! OPTION POUR METTRE UN ID DANS TABLE  !!!
slib_ident=!getopt id in $slib_option
!if $slib_ident=$empty
  !if $slib_ident_nb=$empty
    slib_ident_nb=1
  !else
    slib_ident_nb=$[$slib_ident_nb+1]
  !endif
  slib_id=wimstab$slib_ident_nb
!else
  slib_id=$slib_ident
!endif

!!! OPTION DE RAJOUT OU REMPLACEMENT DE TEXTE DANS LA PREMIERE COLONNE  !!!!
slib_text=!getopt text in $slib_option
slib_text=!declosing $slib_text
slib_text_nbrow=!rowcnt $slib_text
slib_nbtext=!itemcnt $slib_text
!!!RETRO COMPATIBILITE ENTRE ANCIENNE ET NOUVELLE SYNTAXE !!!
!if $slib_nbtext=1
  slib_text=$slib_text,before,all
!endif


!!! OPTION POUR METTRE DES CHAMPS REPONSES DANS LE TABLEAU EN MODE AUTO OU MANUEL !!!
slib_reponses=!getopt reply in $slib_option

!!!RETRO COMPATIBILITE ENTRE ANCIENNE ET NOUVELLE SYNTAXE !!!
slib_nbbrackets=!text count [ in $slib_reponses
!if $slib_nbbrackets=0
  slib_reponses=!append item 1 to [$slib_reponses]
!endif

!distribute items $slib_reponses into slib_rep,slib_rang
slib_rang=!declosing $slib_rang
slib_rep=!declosing $slib_rep
!if $slib_rep=$empty
  slib_nbrep=0
!else
  slib_nbrep=!exec pari E=[$slib_rep];matsize(E)[1]
  slib_repsort=!exec pari (matsort(mat)=A=[mat];L=List([]);for(i=1,$slib_nbrep,listinsert(L,mat[i,],i));V=Vec(L);N=vecsort(V);N);matsort([$slib_rep])
  !for slib_i=1 to $slib_nbrep
    slib_pos_rep_$slib_i=$(slib_repsort[$slib_i])
    slib_pos_rep_$slib_i=!declosing $(slib_pos_rep_$slib_i)
    slib_pos_rep_$slib_i=!replace internal , by ; in $(slib_pos_rep_$slib_i)
  !next slib_i
!endif

!!! SI LE PREMIER PARAMETRE CONTIENT 2 ITEMS ALORS MODE AUTO SINON MODE MANUEL  !!!
!if $slib_nbparam1=2
  !goto matrixcontent
!else
  slib_content=$slib_param1
  !goto matrixcss
!endif


:matrixcontent

!!!!! CREATION DE LA MATRICE CONTENT POUR LE MODE AUTOMATIQUE  !!!!!
!distribute items $slib_param1 into slib_fonc,slib_data
slib_fonc=!declosing $slib_fonc
slib_data=!declosing $slib_data
slib_fonc=!lines2rows $slib_fonc
slib_data=!lines2rows $slib_data
slib_var=!item 1 of $slib_fonc
slib_nbfonc=!itemcnt $(slib_fonc)

!for slib_i=1 to $[$slib_nbfonc-1]
  slib_fonc$slib_i = !item $[$slib_i+1] of $slib_fonc
  slib_fonc$slib_i=!rawmath $(slib_fonc$slib_i)
!next

slib_bornes=$(slib_data[1;])
slib_bornes=!sort numeric item $slib_bornes
slib_borneinf=!item 1 of $slib_bornes
slib_bornesup=!item 2 of $slib_bornes
slib_racines=$(slib_data[2;])
slib_valinterdites=$(slib_data[3;])

slib_datasort=!replace internal ; by , in $slib_data
slib_datasort=!sort numeric  item $slib_datasort
slib_datasort=!listuniq $slib_datasort

slib_nbdata=!itemcnt $slib_datasort
slib_listabsc=$(slib_datasort[1])
slib_ligne1=$slib_var,$(slib_datasort[1])

!for slib_k=1 to $[$slib_nbdata-1]
  slib_bornea=$(slib_datasort[$slib_k])
  slib_borneb=$(slib_datasort[$[$slib_k+1]])
  !if $slib_bornea=-Inf
    !if $slib_borneb!=+Inf
      slib_milieu=$[$slib_borneb - 1000]
    !else
      slib_milieu=0
    !endif
  !else
    !if $slib_borneb=+Inf
      slib_milieu=$[$slib_bornea + 1000]
    !else
      slib_milieu=$[($slib_bornea + $slib_borneb)/2]
    !endif
  !endif

  slib_listabsc=!append item $slib_milieu to $slib_listabsc
  slib_listabsc=!append item $slib_borneb to $slib_listabsc
  slib_ligne1=!append item $ to $slib_ligne1
  slib_ligne1=!append item $slib_borneb to $slib_ligne1
!next slib_k

!for slib_m=2 to $slib_nbfonc
  slib_ligne$slib_m =!item 1 of $(slib_fonc$[$slib_m -1])
!next

!for slib_r=2 to $slib_nbfonc
  !for slib_col=1 to $[2*$slib_nbdata -1]
    slib_elem=$(slib_listabsc[$slib_col])
    !if $[$slib_col%2]!=0
      !if Inf isin $slib_elem
        slib_temp=$empty
      !else
        slib_temp=!exec maxima subst($slib_elem,$slib_var,$(slib_fonc$[$slib_r -1]));
        slib_temp=!exec maxima radcan(ratsimp($slib_temp));
        slib_temp_img=!exec maxima imagpart($slib_temp);
        !if ((NaN isin $slib_temp) or ($slib_temp=$empty) or ($slib_temp_img!=0))
          !if $slib_elem isitemof $slib_valinterdites
            slib_temp=db
          !else
            slib_temp=ndef
          !endif
        !else
          !if $slib_allvalues!=yes
            !if (($slib_elem isitemof $slib_racines) and $slib_temp!=0)
              slib_temp=$empty
            !endif
            !if (($slib_elem isitemof $slib_valinterdites) and ($slib_temp!=ndef) and ($slib_temp!=db) and $slib_temp!=0)
              slib_temp=$empty
            !endif
            !if (($slib_elem isitemof $slib_bornes) and ($slib_temp!=0))
              slib_temp=$empty
            !endif
          !endif
        !endif
      !endif
    !else
      slib_temp=!exec pari (g(val)=$slib_var=val;f=$(slib_fonc$[$slib_r -1]);eval(f));g($slib_elem)
      slib_temp_img=!exec pari imag($slib_temp)
      slib_varlist=!varlist nofn $slib_temp
      !if ((NaN isin $slib_temp) or ($slib_temp=$empty) or ($slib_varlist!=$empty) or ($slib_temp_img!=0))
        slib_temp=ndef
      !else
        !if $slib_temp<0
          slib_temp=-
        !else
          slib_temp=+
        !endif
      !endif
    !endif
    slib_ligne$slib_r=!append item $slib_temp to $(slib_ligne$slib_r)
  !next slib_col
!next slib_r

slib_nbcol=!itemcnt $(slib_ligne1)

!for slib_z=1 to $slib_nbfonc
  slib_content=!append line $(slib_ligne$slib_z) to $slib_content
!next

slib_content=!translate internal $\
$ to ; in $slib_content

!if $slib_code=1
  !goto sortie
!else
  !goto matrixcss
!endif

:matrixcss

!!!! CREATION DE LA MATRICE DES CLASSES CSS DE CHAQUE CELLULE DU TABLEAU   !!!!!

slib_content=!declosing $slib_content
slib_content=!lines2rows $slib_content

slib_nblines=!rowcnt $slib_content
slib_nbcol=!itemcnt $(slib_content[1;])

## MODE MANUEL : COMPLETER PAR ITEM VIDE LIGNES 2  -1 SI DERNIER ITEM MANQUANT ##
!if $slib_nbparam1!=2
 slib_content_temp=$(slib_content[1;])
 !for slib_kline=2 to $slib_nblines
  slib_line_temp=$(slib_content[$slib_kline;])
  slib_nbelem=!itemcnt $slib_line_temp
  slib_diff=$[$slib_nbcol-$slib_nbelem]
  !if $slib_diff>0
   slib_comp=!makelist @@ for iiii=1 to $slib_diff
   slib_comp=!replace item @@ by $empty in $slib_comp
   slib_line_temp=$slib_line_temp,$slib_comp
  !endif
  slib_content_temp=$slib_content_temp;$slib_line_temp
 !next slib_kline
 slib_content=!lines2rows $slib_content_temp
!endif

slib_class=
!for slib_line=1 to $slib_nblines
  slib_lignecoef=
  !for slib_column=1 to $slib_nbcol
    slib_coef=tab_neutre
    slib_element=$(slib_content[$slib_line;$slib_column])
    slib_element_apres=$(slib_content[$slib_line;$[$slib_column +1]])
    slib_element_avant=$(slib_content[$slib_line;$[$slib_column -1]])
    !if $[$slib_column%2]!=0
      !if $slib_column=1
        slib_coef=tab_fonc
      !else
        !if $slib_element=ndef
          slib_coef=tab_ndef
        !else
          !if $slib_line>1
            !if $slib_element=+
              slib_coef=tab_sign_plus
            !else
              slib_coef=tab_sign_moins
            !endif
          !endif
        !endif
      !endif
    !else
      !if $slib_column=2
        slib_coef=tab_borneinf
        !if ($slib_element=ndef or ((($slib_element=$empty) or ($slib_element=0)) and ($slib_element_apres=ndef)))
          slib_coef=tab_ndef
        !else
          !if $slib_element=db
            !if $slib_element_apres=ndef
              slib_coef=tab_dbl_ndefr
            !else
              slib_coef=tab_dbl
            !endif
          !endif
        !endif
      !else
        !if $slib_column=$slib_nbcol
          slib_coef=tab_bornesup
          !if ($slib_element=ndef or ((($slib_element=$empty) or ($slib_element=0)) and ($slib_element_avant=ndef)))
            slib_coef=tab_ndef
          !else
            !if $slib_element=db
              !if $slib_element_avant=ndef
                slib_coef=tab_dbr_ndefl
              !else
                slib_coef=tab_dbr
              !endif
            !endif
          !endif
        !else
          !if $slib_line>1
            !if $slib_element=db
              !if $slib_element_avant=ndef
                slib_coef=tab_db_ndefl
              !else
                !if $slib_element_apres=ndef
                  slib_coef=tab_db_ndefr
                !else
                  slib_coef=tab_db
                !endif
              !endif
            !else
              !if ($slib_element_apres=ndef and $slib_element_avant=ndef)
                slib_coef=tab_dot_ndeflr
              !else
                !if $slib_element_apres=ndef
                  slib_coef=tab_dot_ndefr
                !else
                  !if $slib_element_avant=ndef
                    slib_coef=tab_dot_ndefl
                  !else
                    slib_coef=tab_dot
                  !endif
                !endif
              !endif
            !endif
          !endif
        !endif
      !endif
    !endif
    slib_lignecoef=!append item $slib_coef to $(slib_lignecoef)
  !next slib_column
  slib_class=$slib_class $\
  $slib_lignecoef
!next slib_line

slib_class= !translate internal $\
$ to ; in $slib_class

slib_class=$(slib_class[2..-1;])

!!!! SURCOUCHE CSS POUR LA COULEUR DES SIGNES !!!!
slib_style_plus=

!if $(slib_colorplus[2])=all
  !for slib_r2=1 to $slib_nblines
    slib_style_plus=!append item style="color:$(slib_colorplus[1]);font-weight:bold;" to $slib_style_plus
  !next slib_r2
!else
  !for slib_r3=1 to $[$slib_nblines-1]
    slib_style_plus=!append item style="" to $slib_style_plus
  !next slib_r3
  !if $slib_colorplus_opt=yes
    slib_style_plus=!append item style="color:$(slib_colorplus[1]);font-weight:bold;" to $slib_style_plus
  !else
    slib_style_plus=!append item style="" to $slib_style_plus
  !endif
!endif

slib_style_moins=
!if $(slib_colormoins[2])=all
  !for slib_y2=1 to $slib_nblines
    slib_style_moins=!append item style="color:$(slib_colormoins[1]);font-weight:bold;" to $slib_style_moins
  !next slib_y2
!else
  !for slib_y3=1 to $[$slib_nblines-1]
    slib_style_moins=!append item style="" to $slib_style_moins
  !next slib_y3
  !if $slib_colormoins_opt=yes
    slib_style_moins=!append item style="color:$(slib_colormoins[1]);font-weight:bold;" to $slib_style_moins
  !else
    slib_style_moins=!append item style="" to $slib_style_moins
  !endif
!endif

!!!! CREATION DE LA MATRICE DES TEXTES DE RAJOUT OU DE REMPLACEMENT (MODE AUTO)!!!!
slib_newtext=,,1
slib_text_pos=!positionof item all in $(slib_text[;3])
!if $slib_text_pos!=$empty
  slib_text_pos=!item -1 of $slib_text_pos
  slib_text_aff=$(slib_text[$slib_text_pos;])
  !for slib_kk=2 to $slib_nblines
    slib_newline=!replace item number 3 by $slib_kk in $slib_text_aff
    slib_newtext=$slib_newtext $\
    $slib_newline
  !next slib_kk
!else
  !for slib_kkk=2 to $slib_nblines
    slib_newline=
    slib_tempo=!positionof item $slib_kkk in $(slib_text[;3])
    !if $slib_tempo!=$empty
      slib_tempo=!item -1 of $slib_tempo
      slib_newline=$(slib_text[$slib_tempo;])
    !else
      slib_newline=,,$slib_kkk
    !endif
    slib_newtext=$slib_newtext $\
    $slib_newline
  !next slib_kkk
!endif
slib_text=!translate internal $\
$ to ; in $slib_newtext


!!!! CREATION DE LA MATRICE DES CONTENUS DE CHAQUE CELLULE A AFFICHER   !!!!

slib_cel=$slib_content
slib_cel=!replace internal db by $empty in $slib_cel
slib_cel=!replace internal ndef by $empty in $slib_cel
slib_cel=!replace item + by \quad\plus\quad in $slib_cel
slib_cel=!replace item - by \quad - \quad in $slib_cel
slib_cel=!replace internal +Inf by +\infty  in $slib_cel
slib_cel=!replace internal $empty by \qquad \qquad in $slib_cel
slib_cel=!replace internal log by ln in $slib_cel
slib_cel=!replace internal ln10 by log in $slib_cel

!goto sortie

:sortie
!!!! SORTIES  !!!!

!if $slib_code=1
  slib_out=[$slib_content]
!else
  !if $slib_nocss=nocss
    slib_out=
  !else
   !if $slib_tabsignes_css=$empty
    slib_tabsignes_css=<link rel="stylesheet" href="themes/_css/slib/tabsignes.css">
    slib_out=$slib_tabsignes_css
   !else
    slib_out=
   !endif
  !endif
  slib_tableau=<div class="table-scroll"><table id="$slib_id" class="tabsignes unstriped $slib_wimscenter">
  !for slib_l=1 to $slib_nblines
    !if $slib_l=1
      slib_tableau=$slib_tableau<thead><tr>
    !else
      slib_tableau=$slib_tableau<tr>
    !endif
    !for slib_c=1 to $slib_nbcol
      slib_elemtcss=
      !if $slib_l=1
        !if $(slib_content[$slib_l;$slib_c])=$empty or [$slib_l,$slib_c] isitemof $slib_repsort
          tab_tag=td
          tab_tag_attr=
        !else
          tab_tag=th
          tab_tag_attr=scope="col"
        !endif
      !else
        !if $slib_c=1
          !if [$slib_l,$slib_c] isitemof $slib_repsort
            tab_tag=td
            tab_tag_attr=
          !else
            tab_tag=th
            tab_tag_attr=scope="row"
          !endif
        !else
          tab_tag=td
          tab_tag_attr=
          slib_elemtcss=$(slib_class[$slib_l;$slib_c])
          slib_elemtcss_apres=$(slib_class[$slib_l;$[$slib_c+1]])
          slib_elemtcss_avant=$(slib_class[$slib_l;$[$slib_c-1]])
          !if [$slib_l,$[$slib_c-1]] isitemof $slib_repsort
            slib_elemt_avant=reply
          !else
            slib_elemt_avant=noreply
          !endif
          !if [$slib_l,$[$slib_c+1]] isitemof $slib_repsort
            slib_elemt_apres=reply
          !else
            slib_elemt_apres=noreply
          !endif
          !if $slib_elemtcss=tab_ndef and (($slib_elemt_apres=reply and $slib_elemtcss_apres=tab_ndef) || ($slib_elemt_avant=reply and $slib_elemtcss_avant=tab_ndef))
            slib_elemtcss=tab_neutre
          !endif
          !if $slib_elemtcss=tab_dbl_ndefr and $slib_elemt_apres=reply
            slib_elemtcss=tab_dbl
          !endif
          !if $slib_elemtcss=tab_db_ndefr and $slib_elemt_apres=reply
            slib_elemtcss=tab_db
          !endif
          !if $slib_elemtcss=tab_dot_ndefr and $slib_elemt_apres=reply
            slib_elemtcss=tab_dot
          !endif
          !if $slib_elemtcss=tab_dot_ndefl and $slib_elemt_avant=reply
            slib_elemtcss=tab_dot
          !endif
          !if $slib_elemtcss=tab_db_ndefl and $slib_elemt_avant=reply
            slib_elemtcss=tab_db
          !endif
          !if $slib_elemtcss=tab_dbr_ndefl and $slib_elemt_avant=reply
            slib_elemtcss=tab_dbr
          !endif
          !if $slib_elemtcss=tab_dot_ndeflr
            !if $slib_elemt_apres=reply
              !if $slib_elemt_avant=reply
                slib_elemtcss=tab_dot
              !else
                slib_elemtcss=tab_dot_ndefl
              !endif
            !else
              !if $slib_elemt_avant=reply
                slib_elemtcss=tab_dot_ndefr
              !endif
            !endif
          !endif
        !endif
      !endif
      !if $slib_elemtcss=$empty
        slib_elemtcss=$(slib_class[$slib_l;$slib_c])
      !endif
      slib_idcell=id="$(slib_id)_$(slib_l)_$(slib_c)"
      !if [$slib_l,$slib_c] isitemof $slib_repsort
        slib_position=!positionof item [$slib_l,$slib_c] in $slib_repsort
        slib_position=$[$slib_position+$slib_rang-1]
        !if $slib_c=1
          !if $slib_l>1
            !if $(slib_text[$slib_l;2])=before
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_fonc" $slib_idcell>$(slib_text[$slib_l;1]) reply$slib_position</$tab_tag>
            !else
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_fonc" $slib_idcell>reply$slib_position</$tab_tag>
            !endif
          !else
            slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_fonc" $slib_idcell>reply$slib_position</$tab_tag>
          !endif
        !else
          slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_neutre" $slib_idcell>reply$slib_position</$tab_tag>
        !endif
      !else
        !if (($slib_c=1) and ($slib_l>1))
          !if $(slib_text[$slib_l;2])=before
            slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="$(slib_class[$slib_l;$slib_c])" $slib_idcell>$(slib_text[$slib_l;1]) \($(slib_cel[$slib_l;$slib_c])\)</$tab_tag>
          !else
            !if $(slib_text[$slib_l;2])=replace
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="$(slib_class[$slib_l;$slib_c])" $slib_idcell>$(slib_text[$slib_l;1])</$tab_tag>
            !else
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="$(slib_class[$slib_l;$slib_c])" $slib_idcell>\($(slib_cel[$slib_l;$slib_c])\)</$tab_tag>
            !endif
          !endif
        !else
          !if $(slib_class[$slib_l;$slib_c])=tab_sign_plus
            slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr $(slib_style_plus[$slib_l]) class="$(slib_class[$slib_l;$slib_c])" $slib_idcell>\($(slib_cel[$slib_l;$slib_c])\)</$tab_tag>
          !else
            !if $(slib_class[$slib_l;$slib_c])=tab_sign_moins
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr $(slib_style_moins[$slib_l]) class="$(slib_class[$slib_l;$slib_c])" $slib_idcell>\($(slib_cel[$slib_l;$slib_c])\)</$tab_tag>
            !else
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="$slib_elemtcss" $slib_idcell>\($(slib_cel[$slib_l;$slib_c])\)</$tab_tag>
            !endif
          !endif
        !endif
      !endif
    !next slib_c
    !if $slib_l=1
      slib_tableau=$slib_tableau</tr></thead><tbody>
    !else
      slib_tableau=$slib_tableau</tr>
    !endif
  !next slib_l
  slib_tableau=$slib_tableau</tbody></table></div>

  !if $slib_nbrep=0
    slib_out=$slib_out$slib_tableau
  !else
    slib_answer=
    !for slib_w=1 to $slib_nbrep
      slib_answer=!append item $(slib_content[$(slib_pos_rep_$slib_w)]) to $slib_answer
    !next slib_w
    slib_out=$slib_out$slib_tableau,[$slib_answer]
  !endif
!endif

!goto resetvar

:resetvar
!!!!  RESET DES VARIABLES  !!!!

!for slib_g=1 to $slib_nbfonc
  !reset slib_fonc$slib_g
!next

!reset slib_fonc slib_data slib_var slib_nbfonc slib_bornes\
  slib_racines slib_valinterdites slib_datasort slib_nbdata \
  slib_listabsc slib_content slib_rep slib_nbrep slib_answer \
  slib_repsort slib_class slib_cel slib_wimscenter slib_code\
  slib_style_plus slib_style_moins slib_tableau slib_answer \
  slib_style_temp slib_allvalues slib_nocss

!!!! SUPPRIME POUR L INSTANT exec maxima algebraic:false;