Subversion Repositories wimsdev

Rev

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

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