Subversion Repositories wimsdev

Rev

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

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