Subversion Repositories wimsdev

Rev

Rev 15744 | Rev 16616 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
15745 bpr 1
!!!! tabsignes v1.19 / 01-04-2021
2
!!!! Correction : oubli réinitialisation variable slib_allvalues en fin appel slib
13917 bpr 3
 
15745 bpr 4
 
13917 bpr 5
!if $wims_read_parm!=slib_header
6
  !goto proc
7
!endif
8
 
14579 bpr 9
slib_title=Tableau de signes d'une fonction numérique
13917 bpr 10
slib_parms=2\
15744 bpr 11
,<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<br/> [[la variable,les fonctions séparées par des virgules],[borne inf,borne sup;racines séparées par des virgules; valeurs interdites séparées par des virgules]]</li><li>Pour un mode non automatique (toutes les informations sont à indiquer) :<br />[éléments de la ligne 1 séparés par des virgules; éléments de la ligne 2 séparés par des virgules; ....]</li></ul>\
12
,<strong>options&nbsp;:</strong> (séparées par des espaces).<br class="spacer">Les options marquées 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 défaut, si cette option n'est pas utilisée, le tableau aura pour id <em>wimstab1</em>. Dans le cas de plusieurs appels de cette slib dans la même page, les id automatiques seront <em>wimstab1</em>, <em>wimstab2</em>...Les id <em>wimstabxx</em> étant réservés pour des générations automatiques d'id, ne pas les utiliser soi-même pour générer un id.</li><li><span class="tt wims_code_words">text</span>=[mon_texte,before,numéro de ligne ou all] ou [mon_texte,replace,numéro de ligne ou all] pour ajouter mon_texte devant l'expression de la fonction ou remplacer toute l'expression par mon_texte aux lignes indiquées.</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 dernière 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 réponses reply où n est le rang de la première reply pour une utilisation avec la méthode spéciale <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></ul>
13917 bpr 13
 
15635 obado 14
slib_out=<ul><li>Le tableau au format HTML ou la matrice du contenu du tableau si l'option \
15
<span class="tt">code</span> a été choisie.</li>\
16
<li>Le tableau au format HTML,[les réponses attendues séparées par une virgule] dans le cas où l'option <span class="tt">reply</span> a été choisie.</li></ul>
14579 bpr 17
 
15744 bpr 18
slib_comment=<ul><li>Quel que soit le mode, aucun code TeX à saisir pour les \
19
expressions des fonctions et pour les nombres ;</li>\
20
<li>utiliser <span class="tt">-Inf</span> et <span class="tt">+Inf</span>&nbsp;;</li>\
21
<li>mettre <span class="tt">db</span> pour doubles barres (mode non auto)&nbsp;;</li>\
22
<li>mettre <span class="tt">ndef</span> pour fonction non définie sur un \
23
intervalle (mode non auto)&nbsp;;</li>\
24
<li>code TeX autorisé pour le rajout de texte avec l'option \
25
<span class="tt">text</span>.</li>\
26
<li>chaque cellule du tableau a un id de la forme \
27
<span class="tt wims_code_words">id_l_c</span>, où <span class="tt wims_code_words">id</span> \
28
est l'id du tableau, <span class="tt wims_code_words">l</span> est le numéro de \
29
la ligne et <span class="tt wims_code_words">c</span> est le numéro de la colonne.</li></ul>
13917 bpr 30
 
31
!!!! FIN FICHIER LANG
32
 
33
slib_author=Gilles,Marbeuf
34
 
35
slib_example=[[x,1/x],[-Inf,+Inf;;0]]\
14579 bpr 36
[[u,cos(u)],[0,(3*pi)/4; pi/2;]],text=[Signe de,before,2]\
15744 bpr 37
[[u,cos(u)],[0,(3*pi)/4; pi/2;]],allvalues\
38
[[x,x^2-1,ln(x^2-1)],[-Inf,+Inf;-sqrt(2),-1,1,sqrt(2);-1,1]],allvalues\
39
[[x,x-4,ln(x-1),(x-4)ln(x-1)],[1,+Inf;2,4;1]],wimscenter id=[tab]\
14579 bpr 40
[[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]\
41
[[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]\
42
[[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]]\
13917 bpr 43
[[x,x^2-1/4,e^x,e^x/(x^2-1/4)],[-Inf,+Inf;-1/2,1/2;-1/2,1/2]],code\
14579 bpr 44
[x,-Inf,,x_1,,x_2,,+Inf;a x^2+b x +c,,+,0,-,0,+,],text=[Signe de,before,2]\
13917 bpr 45
[x,0,,a,,+Inf;f(x),db,-,0,+,],wimscenter +=[red] -=[#FBCC00]\
14579 bpr 46
[x,-Inf,,-1,,1,,+Inf;u(x),,+,0,-,0,+,;sqrt(u(x)),,+,0,ndef,0,+,],reply=[[2,3;2,6;3,7],[2]]
13917 bpr 47
!exit
48
 
49
slib_require=maxima pari
50
!exit
51
 
52
:proc
53
 
13920 bpr 54
!set wims_multiexec=pari maxima yacas octave gap
13917 bpr 55
 
13920 bpr 56
!!!! METTRE MAXIMA EN MODE ALGEBRAIC - SUPPRIME POUR L INSTANT!!!
57
!!!!exec maxima algebraic:true;
58
 
13917 bpr 59
!!!!! RECUPERATION DES PARAMETRES  !!!!!
60
 
61
!distribute items $wims_read_parm into slib_param1,slib_option
62
slib_param1=!declosing $slib_param1
63
slib_nbparam1=!itemcnt $slib_param1
64
 
65
!!! OPTION POUR CENTRER LE TABLEAU  !!!
66
!if wimscenter iswordof $slib_option
67
  slib_wimscenter=wimscenter
68
!endif
69
 
15744 bpr 70
!!! OPTION POUR AVOIR QUE LES 0 OU AUTRES IMAGES !!!
71
!if allvalues iswordof $slib_option
72
  slib_allvalues=yes
73
!endif
74
 
13917 bpr 75
!!! OPTION EN MODE AUTO POUR SORTIR LA MATRICE CONTENT PLUTOT QUE LE TABLEAU  !!!
76
!if code iswordof $slib_option
77
  slib_code=1
78
!else
79
  slib_code=0
80
!endif
81
 
82
!!! OPTION POUR METTRE SIGNES + ET - EN COULEUR
83
slib_colorplus=!getopt + in $slib_option
15689 bpr 84
slib_colorplus=!lower $slib_colorplus
13917 bpr 85
!if $slib_colorplus!=$empty
15689 bpr 86
  !if $slib_colorplus=+ or $slib_colorplus=all
87
    slib_colorplus_opt=no
88
    slib_colorplus=
89
  !else
90
    slib_colorplus_opt=yes
91
    slib_colorplus=!declosing $slib_colorplus
92
    !if $(slib_colorplus[1])=all
93
      slib_temp_colorplus1=$(slib_colorplus[1])
94
      slib_temp_colorplus2=$(slib_colorplus[2])
95
      slib_colorplus=$slib_temp_colorplus2,$slib_temp_colorplus1
96
    !endif
97
  !endif
98
!else
99
  slib_colorplus_opt=no
13917 bpr 100
!endif
101
slib_colormoins=!getopt - in $slib_option
15689 bpr 102
slib_colormoins=!lower $slib_colormoins
13917 bpr 103
!if $slib_colormoins!=$empty
15689 bpr 104
  !if $slib_colormoins=- or $slib_colormoins=all
105
    slib_colormoins_opt=no
106
    slib_colormoins=
107
  !else
108
    slib_colormoins_opt=yes
109
    slib_colormoins=!declosing $slib_colormoins
110
    !if $(slib_colormoins[1])=all
111
      slib_temp_colormoins1=$(slib_colormoins[1])
112
      slib_temp_colormoins2=$(slib_colormoins[2])
113
      slib_colormoins=$slib_temp_colormoins2,$slib_temp_colormoins1
114
    !endif
115
  !endif
116
!else
117
  slib_colormoins_opt=no
13917 bpr 118
!endif
119
 
120
!!! OPTION POUR METTRE UN ID DANS TABLE  !!!
121
slib_ident=!getopt id in $slib_option
122
!if $slib_ident=$empty
15744 bpr 123
  !if $slib_ident_nb=$empty
124
    slib_ident_nb=1
125
  !else
126
    slib_ident_nb=$[$slib_ident_nb+1]
127
  !endif
128
  slib_id=wimstab$slib_ident_nb
13917 bpr 129
!else
15744 bpr 130
  slib_id=$slib_ident
13917 bpr 131
!endif
132
 
14579 bpr 133
!!! OPTION DE RAJOUT OU REMPLACEMENT DE TEXTE DANS LA PREMIERE COLONNE  !!!!
13917 bpr 134
slib_text=!getopt text in $slib_option
14579 bpr 135
slib_text=!declosing $slib_text
136
slib_text_nbrow=!rowcnt $slib_text
137
slib_nbtext=!itemcnt $slib_text
138
!!!RETRO COMPATIBILITE ENTRE ANCIENNE ET NOUVELLE SYNTAXE !!!
139
!if $slib_nbtext=1
140
  slib_text=$slib_text,before,all
141
!endif
13917 bpr 142
 
14579 bpr 143
 
13917 bpr 144
!!! OPTION POUR METTRE DES CHAMPS REPONSES DANS LE TABLEAU EN MODE AUTO OU MANUEL !!!
14579 bpr 145
slib_reponses=!getopt reply in $slib_option
146
!!!!slib_reponses=!declosing $slib_reponses
147
!!!RETRO COMPATIBILITE ENTRE ANCIENNE ET NOUVELLE SYNTAXE !!!
148
slib_nbbrackets=!text count [ in $slib_reponses
149
!if $slib_nbbrackets=0
150
  slib_reponses=!append item 1 to [$slib_reponses]
151
!endif
152
 
153
!distribute items $slib_reponses into slib_rep,slib_rang
154
slib_rang=!declosing $slib_rang
13917 bpr 155
slib_rep=!declosing $slib_rep
156
!if $slib_rep=$empty
157
  slib_nbrep=0
158
!else
159
  slib_nbrep=!exec pari E=[$slib_rep];matsize(E)[1]
160
  slib_repsort=!exec pari (matsort(mat)=A=[mat];L=listcreate($slib_nbrep);for(i=1,$slib_nbrep,listinsert(L,mat[i,],i));V=Vec(L);N=vecsort(V);N);matsort([$slib_rep])
161
  !for slib_i=1 to $slib_nbrep
162
    slib_pos_rep_$slib_i=$(slib_repsort[$slib_i])
163
    slib_pos_rep_$slib_i=!declosing $(slib_pos_rep_$slib_i)
164
    slib_pos_rep_$slib_i=!replace internal , by ; in $(slib_pos_rep_$slib_i)
165
  !next slib_i
166
!endif
167
 
168
 
169
!!! SI LE PREMIER PARAMETRE CONTIENT 2 ITEMS ALORS MODE AUTO SINON MODE MANUEL  !!!
170
!if $slib_nbparam1=2
171
  !goto matrixcontent
172
!else
173
  slib_content=$slib_param1
174
  !goto matrixcss
175
!endif
176
 
177
 
178
:matrixcontent
179
 
180
!!!!! CREATION DE LA MATRICE CONTENT POUR LE MODE AUTOMATIQUE  !!!!!
181
!distribute items $slib_param1 into slib_fonc,slib_data
182
slib_fonc=!declosing $slib_fonc
183
slib_data=!declosing $slib_data
184
slib_fonc=!lines2rows $slib_fonc
185
slib_data=!lines2rows $slib_data
186
slib_var=!item 1 of $slib_fonc
187
slib_nbfonc=!itemcnt $(slib_fonc)
188
 
189
!for slib_i=1 to $[$slib_nbfonc-1]
190
  slib_fonc$slib_i = !item $[$slib_i+1] of $slib_fonc
191
  slib_fonc$slib_i=!rawmath $(slib_fonc$slib_i)
192
!next
193
 
194
slib_bornes=$(slib_data[1;])
195
slib_bornes=!sort numeric item $slib_bornes
196
slib_borneinf=!item 1 of $slib_bornes
197
slib_bornesup=!item 2 of $slib_bornes
198
slib_racines=$(slib_data[2;])
199
slib_valinterdites=$(slib_data[3;])
200
 
201
slib_datasort=!replace internal ; by , in $slib_data
202
slib_datasort=!sort numeric  item $slib_datasort
203
slib_datasort=!listuniq $slib_datasort
204
 
205
slib_nbdata=!itemcnt $slib_datasort
206
slib_listabsc=$(slib_datasort[1])
207
slib_ligne1=$slib_var,$(slib_datasort[1])
208
 
209
!for slib_k=1 to $[$slib_nbdata-1]
210
  slib_bornea=$(slib_datasort[$slib_k])
211
  slib_borneb=$(slib_datasort[$[$slib_k+1]])
212
  !if $slib_bornea=-Inf
15480 bpr 213
    !if $slib_borneb!=+Inf
214
      slib_milieu=$[$slib_borneb - 1000]
215
    !else
216
      slib_milieu=0
217
    !endif
218
  !else
219
    !if $slib_borneb=+Inf
220
      slib_milieu=$[$slib_bornea + 1000]
221
    !else
222
      slib_milieu=$[($slib_bornea + $slib_borneb)/2]
223
    !endif
13917 bpr 224
  !endif
15480 bpr 225
 
13917 bpr 226
  slib_listabsc=!append item $slib_milieu to $slib_listabsc
227
  slib_listabsc=!append item $slib_borneb to $slib_listabsc
228
  slib_ligne1=!append item $ to $slib_ligne1
229
  slib_ligne1=!append item $slib_borneb to $slib_ligne1
230
!next slib_k
231
 
232
!for slib_m=2 to $slib_nbfonc
233
  slib_ligne$slib_m =!item 1 of $(slib_fonc$[$slib_m -1])
234
!next
235
 
236
!for slib_r=2 to $slib_nbfonc
237
  !for slib_col=1 to $[2*$slib_nbdata -1]
238
    slib_elem=$(slib_listabsc[$slib_col])
239
    !if $[$slib_col%2]!=0
240
      !if Inf isin $slib_elem
241
        slib_temp=$empty
242
      !else
243
        slib_temp=!exec maxima subst($slib_elem,$slib_var,$(slib_fonc$[$slib_r -1]));
244
        slib_temp=!exec maxima radcan(ratsimp($slib_temp));
245
        slib_temp_img=!exec maxima imagpart($slib_temp);
246
        !if ((NaN isin $slib_temp) or ($slib_temp=$empty) or ($slib_temp_img!=0))
247
          !if $slib_elem isitemof $slib_valinterdites
248
            slib_temp=db
249
          !else
250
            slib_temp=ndef
251
          !endif
252
        !else
15744 bpr 253
          !if $slib_allvalues!=yes
254
            !if (($slib_elem isitemof $slib_racines) and $slib_temp!=0)
255
              slib_temp=$empty
256
            !endif
257
            !if (($slib_elem isitemof $slib_valinterdites) and ($slib_temp!=ndef) and ($slib_temp!=db) and $slib_temp!=0)
258
              slib_temp=$empty
259
            !endif
260
            !if (($slib_elem isitemof $slib_bornes) and ($slib_temp!=0))
261
              slib_temp=$empty
262
            !endif
13917 bpr 263
          !endif
264
        !endif
265
      !endif
266
    !else
267
      slib_temp=!exec pari (g(val)=$slib_var=val;f=$(slib_fonc$[$slib_r -1]);eval(f));g($slib_elem)
268
      slib_temp_img=!exec pari imag($slib_temp)
269
      slib_varlist=!varlist nofn $slib_temp
270
      !if ((NaN isin $slib_temp) or ($slib_temp=$empty) or ($slib_varlist!=$empty) or ($slib_temp_img!=0))
271
        slib_temp=ndef
272
      !else
273
        !if $slib_temp<0
274
          slib_temp=-
275
        !else
276
          slib_temp=+
277
        !endif
278
      !endif
279
    !endif
280
    slib_ligne$slib_r=!append item $slib_temp to $(slib_ligne$slib_r)
281
  !next slib_col
282
!next slib_r
283
 
284
slib_nbcol=!itemcnt $(slib_ligne1)
285
 
286
!for slib_z=1 to $slib_nbfonc
287
  slib_content=!append line $(slib_ligne$slib_z) to $slib_content
288
!next
289
 
290
slib_content=!translate internal $\
291
$ to ; in $slib_content
292
 
293
!if $slib_code=1
294
  !goto sortie
295
!else
296
  !goto matrixcss
297
!endif
298
 
299
:matrixcss
300
 
301
!!!! CREATION DE LA MATRICE DES CLASSES CSS DE CHAQUE CELLULE DU TABLEAU   !!!!!
302
 
303
slib_content=!declosing $slib_content
304
slib_content=!lines2rows $slib_content
305
 
306
slib_nblines=!rowcnt $slib_content
307
slib_nbcol=!itemcnt $(slib_content[1;])
308
 
309
slib_class=
310
!for slib_line=1 to $slib_nblines
311
  slib_lignecoef=
312
  !for slib_column=1 to $slib_nbcol
313
    slib_coef=tab_neutre
314
    slib_element=$(slib_content[$slib_line;$slib_column])
315
    slib_element_apres=$(slib_content[$slib_line;$[$slib_column +1]])
316
    slib_element_avant=$(slib_content[$slib_line;$[$slib_column -1]])
317
    !if $[$slib_column%2]!=0
318
      !if $slib_column=1
319
        slib_coef=tab_fonc
320
      !else
321
        !if $slib_element=ndef
322
          slib_coef=tab_ndef
323
        !else
324
          !if $slib_line>1
325
            !if $slib_element=+
326
              slib_coef=tab_sign_plus
327
            !else
328
              slib_coef=tab_sign_moins
329
            !endif
330
          !endif
331
        !endif
332
      !endif
333
    !else
334
      !if $slib_column=2
335
        slib_coef=tab_borneinf
336
        !if ($slib_element=ndef or ((($slib_element=$empty) or ($slib_element=0)) and ($slib_element_apres=ndef)))
337
          slib_coef=tab_ndef
338
        !else
339
          !if $slib_element=db
340
            !if $slib_element_apres=ndef
341
              slib_coef=tab_dbl_ndefr
342
            !else
343
              slib_coef=tab_dbl
344
            !endif
345
          !endif
346
        !endif
347
      !else
348
        !if $slib_column=$slib_nbcol
349
          slib_coef=tab_bornesup
350
          !if ($slib_element=ndef or ((($slib_element=$empty) or ($slib_element=0)) and ($slib_element_avant=ndef)))
351
            slib_coef=tab_ndef
352
          !else
353
            !if $slib_element=db
354
              !if $slib_element_avant=ndef
355
                slib_coef=tab_dbr_ndefl
356
              !else
357
                slib_coef=tab_dbr
358
              !endif
359
            !endif
360
          !endif
361
        !else
362
          !if $slib_line>1
363
            !if $slib_element=db
364
              !if $slib_element_avant=ndef
365
                slib_coef=tab_db_ndefl
366
              !else
367
                !if $slib_element_apres=ndef
368
                  slib_coef=tab_db_ndefr
369
                !else
370
                  slib_coef=tab_db
371
                !endif
372
              !endif
373
            !else
374
              !if ($slib_element_apres=ndef and $slib_element_avant=ndef)
375
                slib_coef=tab_dot_ndeflr
376
              !else
377
                !if $slib_element_apres=ndef
378
                  slib_coef=tab_dot_ndefr
379
                !else
380
                  !if $slib_element_avant=ndef
381
                    slib_coef=tab_dot_ndefl
382
                  !else
383
                    slib_coef=tab_dot
384
                  !endif
385
                !endif
386
              !endif
387
            !endif
388
          !endif
389
        !endif
390
      !endif
391
    !endif
392
    slib_lignecoef=!append item $slib_coef to $(slib_lignecoef)
393
  !next slib_column
394
  slib_class=$slib_class $\
395
  $slib_lignecoef
396
!next slib_line
397
 
398
slib_class= !translate internal $\
399
$ to ; in $slib_class
400
 
401
slib_class=$(slib_class[2..-1;])
402
 
403
!!!! SURCOUCHE CSS POUR LA COULEUR DES SIGNES !!!!
404
slib_style_plus=
405
 
406
!if $(slib_colorplus[2])=all
407
  !for slib_r2=1 to $slib_nblines
15635 obado 408
    slib_style_plus=!append item style="color:$(slib_colorplus[1]);font-weight:bold;" to $slib_style_plus
13917 bpr 409
  !next slib_r2
410
!else
411
  !for slib_r3=1 to $[$slib_nblines-1]
15635 obado 412
    slib_style_plus=!append item style="" to $slib_style_plus
13917 bpr 413
  !next slib_r3
15689 bpr 414
  !if $slib_colorplus_opt=yes
415
    slib_style_plus=!append item style="color:$(slib_colorplus[1]);font-weight:bold;" to $slib_style_plus
416
  !else
417
    slib_style_plus=!append item style="" to $slib_style_plus
418
  !endif
13917 bpr 419
!endif
420
 
421
slib_style_moins=
422
!if $(slib_colormoins[2])=all
423
  !for slib_y2=1 to $slib_nblines
15635 obado 424
    slib_style_moins=!append item style="color:$(slib_colormoins[1]);font-weight:bold;" to $slib_style_moins
13917 bpr 425
  !next slib_y2
426
!else
427
  !for slib_y3=1 to $[$slib_nblines-1]
15635 obado 428
    slib_style_moins=!append item style="" to $slib_style_moins
13917 bpr 429
  !next slib_y3
15689 bpr 430
  !if $slib_colormoins_opt=yes
431
    slib_style_moins=!append item style="color:$(slib_colormoins[1]);font-weight:bold;" to $slib_style_moins
432
  !else
433
    slib_style_moins=!append item style="" to $slib_style_moins
434
  !endif
13917 bpr 435
!endif
436
 
14579 bpr 437
!!!! CREATION DE LA MATRICE DES TEXTES DE RAJOUT OU DE REMPLACEMENT (MODE AUTO)!!!!
438
slib_newtext=,,1
439
slib_text_pos=!positionof item all in $(slib_text[;3])
440
!if $slib_text_pos!=$empty
441
  slib_text_pos=!item -1 of $slib_text_pos
442
  slib_text_aff=$(slib_text[$slib_text_pos;])
443
  !for slib_kk=2 to $slib_nblines
444
    slib_newline=!replace item number 3 by $slib_kk in $slib_text_aff
445
    slib_newtext=$slib_newtext $\
446
    $slib_newline
447
  !next slib_kk
448
!else
449
  !for slib_kkk=2 to $slib_nblines
450
    slib_newline=
451
    slib_tempo=!positionof item $slib_kkk in $(slib_text[;3])
452
    !if $slib_tempo!=$empty
453
      slib_tempo=!item -1 of $slib_tempo
454
      slib_newline=$(slib_text[$slib_tempo;])
455
    !else
456
      slib_newline=,,$slib_kkk
457
    !endif
458
    slib_newtext=$slib_newtext $\
459
    $slib_newline
460
  !next slib_kkk
461
!endif
462
slib_text=!translate internal $\
463
$ to ; in $slib_newtext
13917 bpr 464
 
465
 
466
!!!! CREATION DE LA MATRICE DES CONTENUS DE CHAQUE CELLULE A AFFICHER   !!!!
467
 
468
slib_cel=$slib_content
469
slib_cel=!replace internal db by $empty in $slib_cel
470
slib_cel=!replace internal ndef by $empty in $slib_cel
471
slib_cel=!replace item + by \quad\plus\quad in $slib_cel
472
slib_cel=!replace item - by \quad - \quad in $slib_cel
473
slib_cel=!replace internal +Inf by +\infty  in $slib_cel
474
slib_cel=!replace internal $empty by \qquad \qquad in $slib_cel
475
slib_cel=!replace internal log by ln in $slib_cel
476
slib_cel=!replace internal ln10 by log in $slib_cel
477
 
478
!goto sortie
479
 
480
:sortie
481
!!!! SORTIES  !!!!
482
 
483
!if $slib_code=1
13920 bpr 484
  slib_out=[$slib_content]
13917 bpr 485
!else
14579 bpr 486
  !if $slib_tabsignes_css=$empty
15671 bpr 487
    slib_tabsignes_css=<link rel="stylesheet" href="themes/_css/slib/tabsignes.css">
488
    slib_out=$slib_tabsignes_css
14579 bpr 489
  !else
490
    slib_out=
491
  !endif
15744 bpr 492
  slib_tableau=<div class="table-scroll"><table id="$slib_id" class="tabsignes unstriped $slib_wimscenter">
15635 obado 493
  !for slib_l=1 to $slib_nblines
494
    !if $slib_l=1
495
      slib_tableau=$slib_tableau<thead><tr>
496
    !else
497
      slib_tableau=$slib_tableau<tr>
498
    !endif
499
    !for slib_c=1 to $slib_nbcol
15744 bpr 500
      slib_elemtcss=
501
      !if $slib_l=1
502
        !if $(slib_content[$slib_l;$slib_c])=$empty or [$slib_l,$slib_c] isitemof $slib_repsort
503
          tab_tag=td
504
          tab_tag_attr=
505
        !else
506
          tab_tag=th
507
          tab_tag_attr=scope="col"
508
        !endif
509
      !else
510
        !if $slib_c=1
511
          !if [$slib_l,$slib_c] isitemof $slib_repsort
512
            tab_tag=td
513
            tab_tag_attr=
514
          !else
515
            tab_tag=th
516
            tab_tag_attr=scope="row"
517
          !endif
518
        !else
519
          tab_tag=td
520
          tab_tag_attr=
521
          slib_elemtcss=$(slib_class[$slib_l;$slib_c])
522
          slib_elemtcss_apres=$(slib_class[$slib_l;$[$slib_c+1]])
523
          slib_elemtcss_avant=$(slib_class[$slib_l;$[$slib_c-1]])
524
          !if [$slib_l,$[$slib_c-1]] isitemof $slib_repsort
525
            slib_elemt_avant=reply
526
          !else
527
            slib_elemt_avant=noreply
528
          !endif
529
          !if [$slib_l,$[$slib_c+1]] isitemof $slib_repsort
530
            slib_elemt_apres=reply
531
          !else
532
            slib_elemt_apres=noreply
533
          !endif
534
          !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))
535
            slib_elemtcss=tab_neutre
536
          !endif
537
          !if $slib_elemtcss=tab_dbl_ndefr and $slib_elemt_apres=reply
538
            slib_elemtcss=tab_dbl
539
          !endif
540
          !if $slib_elemtcss=tab_db_ndefr and $slib_elemt_apres=reply
541
            slib_elemtcss=tab_db
542
          !endif
543
          !if $slib_elemtcss=tab_dot_ndefr and $slib_elemt_apres=reply
544
            slib_elemtcss=tab_dot
545
          !endif
546
          !if $slib_elemtcss=tab_dot_ndefl and $slib_elemt_avant=reply
547
            slib_elemtcss=tab_dot
548
          !endif
549
          !if $slib_elemtcss=tab_db_ndefl and $slib_elemt_avant=reply
550
            slib_elemtcss=tab_db
551
          !endif
552
          !if $slib_elemtcss=tab_dbr_ndefl and $slib_elemt_avant=reply
553
            slib_elemtcss=tab_dbr
554
          !endif
555
          !if $slib_elemtcss=tab_dot_ndeflr
556
            !if $slib_elemt_apres=reply
557
              !if $slib_elemt_avant=reply
558
                slib_elemtcss=tab_dot
559
              !else
560
                slib_elemtcss=tab_dot_ndefl
561
              !endif
562
            !else
563
              !if $slib_elemt_avant=reply
564
                slib_elemtcss=tab_dot_ndefr
565
              !endif
566
            !endif
567
          !endif
568
        !endif
569
      !endif
570
      !if $slib_elemtcss=$empty
571
        slib_elemtcss=$(slib_class[$slib_l;$slib_c])
572
      !endif
573
      slib_idcell=id="$(slib_id)_$(slib_l)_$(slib_c)"
15635 obado 574
      !if [$slib_l,$slib_c] isitemof $slib_repsort
575
        slib_position=!positionof item [$slib_l,$slib_c] in $slib_repsort
576
        slib_position=$[$slib_position+$slib_rang-1]
577
        !if $slib_c=1
578
          !if $slib_l>1
579
            !if $(slib_text[$slib_l;2])=before
15744 bpr 580
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_fonc" $slib_idcell>$(slib_text[$slib_l;1]) reply$slib_position</$tab_tag>
15635 obado 581
            !else
15744 bpr 582
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_fonc" $slib_idcell>reply$slib_position</$tab_tag>
15635 obado 583
            !endif
584
          !else
15744 bpr 585
            slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_fonc" $slib_idcell>reply$slib_position</$tab_tag>
15635 obado 586
          !endif
587
        !else
15744 bpr 588
          slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_neutre" $slib_idcell>reply$slib_position</$tab_tag>
15635 obado 589
        !endif
590
      !else
591
        !if (($slib_c=1) and ($slib_l>1))
592
          !if $(slib_text[$slib_l;2])=before
15744 bpr 593
            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>
15635 obado 594
          !else
595
            !if $(slib_text[$slib_l;2])=replace
15744 bpr 596
              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>
15635 obado 597
            !else
15744 bpr 598
              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>
15635 obado 599
            !endif
600
          !endif
601
        !else
602
          !if $(slib_class[$slib_l;$slib_c])=tab_sign_plus
15744 bpr 603
            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>
15635 obado 604
          !else
605
            !if $(slib_class[$slib_l;$slib_c])=tab_sign_moins
15744 bpr 606
              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>
15635 obado 607
            !else
15744 bpr 608
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="$slib_elemtcss" $slib_idcell>\($(slib_cel[$slib_l;$slib_c])\)</$tab_tag>
15635 obado 609
            !endif
610
          !endif
611
        !endif
612
      !endif
613
    !next slib_c
614
    !if $slib_l=1
615
      slib_tableau=$slib_tableau</tr></thead><tbody>
616
    !else
617
      slib_tableau=$slib_tableau</tr>
618
    !endif
619
  !next slib_l
620
  slib_tableau=$slib_tableau</tbody></table></div>
13917 bpr 621
 
622
  !if $slib_nbrep=0
623
    slib_out=$slib_out$slib_tableau
624
  !else
625
    slib_answer=
626
    !for slib_w=1 to $slib_nbrep
627
      slib_answer=!append item $(slib_content[$(slib_pos_rep_$slib_w)]) to $slib_answer
628
    !next slib_w
13920 bpr 629
    slib_out=$slib_out$slib_tableau,[$slib_answer]
13917 bpr 630
  !endif
631
!endif
632
 
633
!goto resetvar
634
 
635
:resetvar
636
!!!!  RESET DES VARIABLES  !!!!
637
 
638
!for slib_g=1 to $slib_nbfonc
639
  !reset slib_fonc$slib_g
640
!next
641
 
15744 bpr 642
!reset slib_fonc slib_data slib_var slib_nbfonc slib_bornes\
643
  slib_racines slib_valinterdites slib_datasort slib_nbdata \
644
  slib_listabsc slib_content slib_rep slib_nbrep slib_answer \
645
  slib_repsort slib_class slib_cel slib_wimscenter slib_code\
646
  slib_style_plus slib_style_moins slib_tableau slib_answer \
15745 bpr 647
  slib_style_temp slib_allvalues
13917 bpr 648
 
13920 bpr 649
!!!! SUPPRIME POUR L INSTANT exec maxima algebraic:false;