Subversion Repositories wimsdev

Rev

Rev 18554 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18595 gmarbeuf 1
!!!! tabsignes v1.22 / 11-06-2025
16616 gmarbeuf 2
!!!! NEWS :
18554 gmarbeuf 3
!! Correction du bug de l'option reply lorsque le nombre de reply est 1
4
!! Modification de l'exemple 10
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\
18554 gmarbeuf 54
[x,-Inf,,x_1,,x_2,,+Inf;a x^2+b x +c,,\begin{matrix}\textrm{signe de}\\a \end{matrix},0,\begin{matrix}\textrm{opposé du}\\ \textrm{signe de}\:a\end{matrix},0,\begin{matrix}\textrm{signe de}\\a \end{matrix}],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]
18554 gmarbeuf 176
  !if $slib_nbrep=1
177
    slib_repsort=[$slib_rep]
178
    slib_pos_rep_1=!replace internal , by ; in $slib_rep
179
  !else
180
    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])
181
    !for slib_i=1 to $slib_nbrep
182
      slib_pos_rep_$slib_i=$(slib_repsort[$slib_i])
183
      slib_pos_rep_$slib_i=!declosing $(slib_pos_rep_$slib_i)
184
      slib_pos_rep_$slib_i=!replace internal , by ; in $(slib_pos_rep_$slib_i)
185
    !next slib_i
186
  !endif
13917 bpr 187
!endif
188
 
189
!!! SI LE PREMIER PARAMETRE CONTIENT 2 ITEMS ALORS MODE AUTO SINON MODE MANUEL  !!!
190
!if $slib_nbparam1=2
191
  !goto matrixcontent
192
!else
193
  slib_content=$slib_param1
194
  !goto matrixcss
195
!endif
196
 
197
 
198
:matrixcontent
199
 
200
!!!!! CREATION DE LA MATRICE CONTENT POUR LE MODE AUTOMATIQUE  !!!!!
201
!distribute items $slib_param1 into slib_fonc,slib_data
202
slib_fonc=!declosing $slib_fonc
203
slib_data=!declosing $slib_data
204
slib_fonc=!lines2rows $slib_fonc
205
slib_data=!lines2rows $slib_data
206
slib_var=!item 1 of $slib_fonc
207
slib_nbfonc=!itemcnt $(slib_fonc)
208
 
209
!for slib_i=1 to $[$slib_nbfonc-1]
210
  slib_fonc$slib_i = !item $[$slib_i+1] of $slib_fonc
211
  slib_fonc$slib_i=!rawmath $(slib_fonc$slib_i)
212
!next
213
 
214
slib_bornes=$(slib_data[1;])
215
slib_bornes=!sort numeric item $slib_bornes
216
slib_borneinf=!item 1 of $slib_bornes
217
slib_bornesup=!item 2 of $slib_bornes
218
slib_racines=$(slib_data[2;])
219
slib_valinterdites=$(slib_data[3;])
220
 
221
slib_datasort=!replace internal ; by , in $slib_data
222
slib_datasort=!sort numeric  item $slib_datasort
223
slib_datasort=!listuniq $slib_datasort
224
 
225
slib_nbdata=!itemcnt $slib_datasort
226
slib_listabsc=$(slib_datasort[1])
227
slib_ligne1=$slib_var,$(slib_datasort[1])
228
 
229
!for slib_k=1 to $[$slib_nbdata-1]
230
  slib_bornea=$(slib_datasort[$slib_k])
231
  slib_borneb=$(slib_datasort[$[$slib_k+1]])
232
  !if $slib_bornea=-Inf
15480 bpr 233
    !if $slib_borneb!=+Inf
234
      slib_milieu=$[$slib_borneb - 1000]
235
    !else
236
      slib_milieu=0
237
    !endif
238
  !else
239
    !if $slib_borneb=+Inf
240
      slib_milieu=$[$slib_bornea + 1000]
241
    !else
242
      slib_milieu=$[($slib_bornea + $slib_borneb)/2]
243
    !endif
13917 bpr 244
  !endif
15480 bpr 245
 
13917 bpr 246
  slib_listabsc=!append item $slib_milieu to $slib_listabsc
247
  slib_listabsc=!append item $slib_borneb to $slib_listabsc
248
  slib_ligne1=!append item $ to $slib_ligne1
249
  slib_ligne1=!append item $slib_borneb to $slib_ligne1
250
!next slib_k
251
 
252
!for slib_m=2 to $slib_nbfonc
253
  slib_ligne$slib_m =!item 1 of $(slib_fonc$[$slib_m -1])
254
!next
255
 
256
!for slib_r=2 to $slib_nbfonc
257
  !for slib_col=1 to $[2*$slib_nbdata -1]
258
    slib_elem=$(slib_listabsc[$slib_col])
259
    !if $[$slib_col%2]!=0
260
      !if Inf isin $slib_elem
261
        slib_temp=$empty
262
      !else
263
        slib_temp=!exec maxima subst($slib_elem,$slib_var,$(slib_fonc$[$slib_r -1]));
264
        slib_temp=!exec maxima radcan(ratsimp($slib_temp));
265
        slib_temp_img=!exec maxima imagpart($slib_temp);
266
        !if ((NaN isin $slib_temp) or ($slib_temp=$empty) or ($slib_temp_img!=0))
267
          !if $slib_elem isitemof $slib_valinterdites
268
            slib_temp=db
269
          !else
270
            slib_temp=ndef
271
          !endif
272
        !else
15744 bpr 273
          !if $slib_allvalues!=yes
274
            !if (($slib_elem isitemof $slib_racines) and $slib_temp!=0)
275
              slib_temp=$empty
276
            !endif
277
            !if (($slib_elem isitemof $slib_valinterdites) and ($slib_temp!=ndef) and ($slib_temp!=db) and $slib_temp!=0)
278
              slib_temp=$empty
279
            !endif
280
            !if (($slib_elem isitemof $slib_bornes) and ($slib_temp!=0))
281
              slib_temp=$empty
282
            !endif
13917 bpr 283
          !endif
284
        !endif
285
      !endif
286
    !else
287
      slib_temp=!exec pari (g(val)=$slib_var=val;f=$(slib_fonc$[$slib_r -1]);eval(f));g($slib_elem)
288
      slib_temp_img=!exec pari imag($slib_temp)
289
      slib_varlist=!varlist nofn $slib_temp
290
      !if ((NaN isin $slib_temp) or ($slib_temp=$empty) or ($slib_varlist!=$empty) or ($slib_temp_img!=0))
291
        slib_temp=ndef
292
      !else
293
        !if $slib_temp<0
294
          slib_temp=-
295
        !else
296
          slib_temp=+
297
        !endif
298
      !endif
299
    !endif
300
    slib_ligne$slib_r=!append item $slib_temp to $(slib_ligne$slib_r)
301
  !next slib_col
302
!next slib_r
303
 
304
slib_nbcol=!itemcnt $(slib_ligne1)
305
 
306
!for slib_z=1 to $slib_nbfonc
307
  slib_content=!append line $(slib_ligne$slib_z) to $slib_content
308
!next
309
 
310
slib_content=!translate internal $\
311
$ to ; in $slib_content
312
 
313
!if $slib_code=1
314
  !goto sortie
315
!else
316
  !goto matrixcss
317
!endif
318
 
319
:matrixcss
320
 
321
!!!! CREATION DE LA MATRICE DES CLASSES CSS DE CHAQUE CELLULE DU TABLEAU   !!!!!
322
 
323
slib_content=!declosing $slib_content
324
slib_content=!lines2rows $slib_content
325
 
326
slib_nblines=!rowcnt $slib_content
327
slib_nbcol=!itemcnt $(slib_content[1;])
328
 
16616 gmarbeuf 329
## MODE MANUEL : COMPLETER PAR ITEM VIDE LIGNES 2 à -1 SI DERNIER ITEM MANQUANT ##
330
!if $slib_nbparam1!=2
331
 slib_content_temp=$(slib_content[1;])
332
 !for slib_kline=2 to $slib_nblines
333
  slib_line_temp=$(slib_content[$slib_kline;])
334
  slib_nbelem=!itemcnt $slib_line_temp
335
  slib_diff=$[$slib_nbcol-$slib_nbelem]
336
  !if $slib_diff>0
337
   slib_comp=!makelist @@ for iiii=1 to $slib_diff
338
   slib_comp=!replace item @@ by $empty in $slib_comp
339
   slib_line_temp=$slib_line_temp,$slib_comp
340
  !endif
341
  slib_content_temp=$slib_content_temp;$slib_line_temp
342
 !next slib_kline
343
 slib_content=!lines2rows $slib_content_temp
344
!endif
345
 
13917 bpr 346
slib_class=
347
!for slib_line=1 to $slib_nblines
348
  slib_lignecoef=
349
  !for slib_column=1 to $slib_nbcol
350
    slib_coef=tab_neutre
351
    slib_element=$(slib_content[$slib_line;$slib_column])
352
    slib_element_apres=$(slib_content[$slib_line;$[$slib_column +1]])
353
    slib_element_avant=$(slib_content[$slib_line;$[$slib_column -1]])
354
    !if $[$slib_column%2]!=0
355
      !if $slib_column=1
356
        slib_coef=tab_fonc
357
      !else
358
        !if $slib_element=ndef
359
          slib_coef=tab_ndef
360
        !else
361
          !if $slib_line>1
362
            !if $slib_element=+
363
              slib_coef=tab_sign_plus
364
            !else
365
              slib_coef=tab_sign_moins
366
            !endif
367
          !endif
368
        !endif
369
      !endif
370
    !else
371
      !if $slib_column=2
372
        slib_coef=tab_borneinf
373
        !if ($slib_element=ndef or ((($slib_element=$empty) or ($slib_element=0)) and ($slib_element_apres=ndef)))
374
          slib_coef=tab_ndef
375
        !else
376
          !if $slib_element=db
377
            !if $slib_element_apres=ndef
378
              slib_coef=tab_dbl_ndefr
379
            !else
380
              slib_coef=tab_dbl
381
            !endif
382
          !endif
383
        !endif
384
      !else
385
        !if $slib_column=$slib_nbcol
386
          slib_coef=tab_bornesup
387
          !if ($slib_element=ndef or ((($slib_element=$empty) or ($slib_element=0)) and ($slib_element_avant=ndef)))
388
            slib_coef=tab_ndef
389
          !else
390
            !if $slib_element=db
391
              !if $slib_element_avant=ndef
392
                slib_coef=tab_dbr_ndefl
393
              !else
394
                slib_coef=tab_dbr
395
              !endif
396
            !endif
397
          !endif
398
        !else
399
          !if $slib_line>1
400
            !if $slib_element=db
401
              !if $slib_element_avant=ndef
402
                slib_coef=tab_db_ndefl
403
              !else
404
                !if $slib_element_apres=ndef
405
                  slib_coef=tab_db_ndefr
406
                !else
407
                  slib_coef=tab_db
408
                !endif
409
              !endif
410
            !else
411
              !if ($slib_element_apres=ndef and $slib_element_avant=ndef)
412
                slib_coef=tab_dot_ndeflr
413
              !else
414
                !if $slib_element_apres=ndef
415
                  slib_coef=tab_dot_ndefr
416
                !else
417
                  !if $slib_element_avant=ndef
418
                    slib_coef=tab_dot_ndefl
419
                  !else
420
                    slib_coef=tab_dot
421
                  !endif
422
                !endif
423
              !endif
424
            !endif
425
          !endif
426
        !endif
427
      !endif
428
    !endif
429
    slib_lignecoef=!append item $slib_coef to $(slib_lignecoef)
430
  !next slib_column
431
  slib_class=$slib_class $\
432
  $slib_lignecoef
433
!next slib_line
434
 
435
slib_class= !translate internal $\
436
$ to ; in $slib_class
437
 
438
slib_class=$(slib_class[2..-1;])
439
 
440
!!!! SURCOUCHE CSS POUR LA COULEUR DES SIGNES !!!!
441
slib_style_plus=
442
 
443
!if $(slib_colorplus[2])=all
444
  !for slib_r2=1 to $slib_nblines
15635 obado 445
    slib_style_plus=!append item style="color:$(slib_colorplus[1]);font-weight:bold;" to $slib_style_plus
13917 bpr 446
  !next slib_r2
447
!else
448
  !for slib_r3=1 to $[$slib_nblines-1]
15635 obado 449
    slib_style_plus=!append item style="" to $slib_style_plus
13917 bpr 450
  !next slib_r3
15689 bpr 451
  !if $slib_colorplus_opt=yes
452
    slib_style_plus=!append item style="color:$(slib_colorplus[1]);font-weight:bold;" to $slib_style_plus
453
  !else
454
    slib_style_plus=!append item style="" to $slib_style_plus
455
  !endif
13917 bpr 456
!endif
457
 
458
slib_style_moins=
459
!if $(slib_colormoins[2])=all
460
  !for slib_y2=1 to $slib_nblines
15635 obado 461
    slib_style_moins=!append item style="color:$(slib_colormoins[1]);font-weight:bold;" to $slib_style_moins
13917 bpr 462
  !next slib_y2
463
!else
464
  !for slib_y3=1 to $[$slib_nblines-1]
15635 obado 465
    slib_style_moins=!append item style="" to $slib_style_moins
13917 bpr 466
  !next slib_y3
15689 bpr 467
  !if $slib_colormoins_opt=yes
468
    slib_style_moins=!append item style="color:$(slib_colormoins[1]);font-weight:bold;" to $slib_style_moins
469
  !else
470
    slib_style_moins=!append item style="" to $slib_style_moins
471
  !endif
13917 bpr 472
!endif
473
 
14579 bpr 474
!!!! CREATION DE LA MATRICE DES TEXTES DE RAJOUT OU DE REMPLACEMENT (MODE AUTO)!!!!
475
slib_newtext=,,1
476
slib_text_pos=!positionof item all in $(slib_text[;3])
477
!if $slib_text_pos!=$empty
478
  slib_text_pos=!item -1 of $slib_text_pos
479
  slib_text_aff=$(slib_text[$slib_text_pos;])
480
  !for slib_kk=2 to $slib_nblines
481
    slib_newline=!replace item number 3 by $slib_kk in $slib_text_aff
482
    slib_newtext=$slib_newtext $\
483
    $slib_newline
484
  !next slib_kk
485
!else
486
  !for slib_kkk=2 to $slib_nblines
487
    slib_newline=
488
    slib_tempo=!positionof item $slib_kkk in $(slib_text[;3])
489
    !if $slib_tempo!=$empty
490
      slib_tempo=!item -1 of $slib_tempo
491
      slib_newline=$(slib_text[$slib_tempo;])
492
    !else
493
      slib_newline=,,$slib_kkk
494
    !endif
495
    slib_newtext=$slib_newtext $\
496
    $slib_newline
497
  !next slib_kkk
498
!endif
499
slib_text=!translate internal $\
500
$ to ; in $slib_newtext
13917 bpr 501
 
502
 
503
!!!! CREATION DE LA MATRICE DES CONTENUS DE CHAQUE CELLULE A AFFICHER   !!!!
504
 
505
slib_cel=$slib_content
506
slib_cel=!replace internal db by $empty in $slib_cel
507
slib_cel=!replace internal ndef by $empty in $slib_cel
508
slib_cel=!replace item + by \quad\plus\quad in $slib_cel
509
slib_cel=!replace item - by \quad - \quad in $slib_cel
510
slib_cel=!replace internal +Inf by +\infty  in $slib_cel
511
slib_cel=!replace internal $empty by \qquad \qquad in $slib_cel
512
slib_cel=!replace internal log by ln in $slib_cel
513
slib_cel=!replace internal ln10 by log in $slib_cel
514
 
515
!goto sortie
516
 
517
:sortie
518
!!!! SORTIES  !!!!
519
 
520
!if $slib_code=1
13920 bpr 521
  slib_out=[$slib_content]
13917 bpr 522
!else
16616 gmarbeuf 523
  !if $slib_nocss=nocss
524
    slib_out=
525
  !else
526
   !if $slib_tabsignes_css=$empty
15671 bpr 527
    slib_tabsignes_css=<link rel="stylesheet" href="themes/_css/slib/tabsignes.css">
528
    slib_out=$slib_tabsignes_css
16616 gmarbeuf 529
   !else
14579 bpr 530
    slib_out=
16616 gmarbeuf 531
   !endif
14579 bpr 532
  !endif
15744 bpr 533
  slib_tableau=<div class="table-scroll"><table id="$slib_id" class="tabsignes unstriped $slib_wimscenter">
15635 obado 534
  !for slib_l=1 to $slib_nblines
535
    !if $slib_l=1
536
      slib_tableau=$slib_tableau<thead><tr>
537
    !else
538
      slib_tableau=$slib_tableau<tr>
539
    !endif
540
    !for slib_c=1 to $slib_nbcol
15744 bpr 541
      slib_elemtcss=
542
      !if $slib_l=1
543
        !if $(slib_content[$slib_l;$slib_c])=$empty or [$slib_l,$slib_c] isitemof $slib_repsort
544
          tab_tag=td
545
          tab_tag_attr=
546
        !else
547
          tab_tag=th
548
          tab_tag_attr=scope="col"
549
        !endif
550
      !else
551
        !if $slib_c=1
552
          !if [$slib_l,$slib_c] isitemof $slib_repsort
553
            tab_tag=td
554
            tab_tag_attr=
555
          !else
556
            tab_tag=th
557
            tab_tag_attr=scope="row"
558
          !endif
559
        !else
560
          tab_tag=td
561
          tab_tag_attr=
562
          slib_elemtcss=$(slib_class[$slib_l;$slib_c])
563
          slib_elemtcss_apres=$(slib_class[$slib_l;$[$slib_c+1]])
564
          slib_elemtcss_avant=$(slib_class[$slib_l;$[$slib_c-1]])
565
          !if [$slib_l,$[$slib_c-1]] isitemof $slib_repsort
566
            slib_elemt_avant=reply
567
          !else
568
            slib_elemt_avant=noreply
569
          !endif
570
          !if [$slib_l,$[$slib_c+1]] isitemof $slib_repsort
571
            slib_elemt_apres=reply
572
          !else
573
            slib_elemt_apres=noreply
574
          !endif
575
          !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))
576
            slib_elemtcss=tab_neutre
577
          !endif
578
          !if $slib_elemtcss=tab_dbl_ndefr and $slib_elemt_apres=reply
579
            slib_elemtcss=tab_dbl
580
          !endif
581
          !if $slib_elemtcss=tab_db_ndefr and $slib_elemt_apres=reply
582
            slib_elemtcss=tab_db
583
          !endif
584
          !if $slib_elemtcss=tab_dot_ndefr and $slib_elemt_apres=reply
585
            slib_elemtcss=tab_dot
586
          !endif
587
          !if $slib_elemtcss=tab_dot_ndefl and $slib_elemt_avant=reply
588
            slib_elemtcss=tab_dot
589
          !endif
590
          !if $slib_elemtcss=tab_db_ndefl and $slib_elemt_avant=reply
591
            slib_elemtcss=tab_db
592
          !endif
593
          !if $slib_elemtcss=tab_dbr_ndefl and $slib_elemt_avant=reply
594
            slib_elemtcss=tab_dbr
595
          !endif
596
          !if $slib_elemtcss=tab_dot_ndeflr
597
            !if $slib_elemt_apres=reply
598
              !if $slib_elemt_avant=reply
599
                slib_elemtcss=tab_dot
600
              !else
601
                slib_elemtcss=tab_dot_ndefl
602
              !endif
603
            !else
604
              !if $slib_elemt_avant=reply
605
                slib_elemtcss=tab_dot_ndefr
606
              !endif
607
            !endif
608
          !endif
609
        !endif
610
      !endif
611
      !if $slib_elemtcss=$empty
612
        slib_elemtcss=$(slib_class[$slib_l;$slib_c])
613
      !endif
614
      slib_idcell=id="$(slib_id)_$(slib_l)_$(slib_c)"
15635 obado 615
      !if [$slib_l,$slib_c] isitemof $slib_repsort
616
        slib_position=!positionof item [$slib_l,$slib_c] in $slib_repsort
617
        slib_position=$[$slib_position+$slib_rang-1]
618
        !if $slib_c=1
619
          !if $slib_l>1
620
            !if $(slib_text[$slib_l;2])=before
15744 bpr 621
              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 622
            !else
15744 bpr 623
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_fonc" $slib_idcell>reply$slib_position</$tab_tag>
15635 obado 624
            !endif
625
          !else
15744 bpr 626
            slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_fonc" $slib_idcell>reply$slib_position</$tab_tag>
15635 obado 627
          !endif
628
        !else
15744 bpr 629
          slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="tab_neutre" $slib_idcell>reply$slib_position</$tab_tag>
15635 obado 630
        !endif
631
      !else
632
        !if (($slib_c=1) and ($slib_l>1))
633
          !if $(slib_text[$slib_l;2])=before
15744 bpr 634
            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 635
          !else
636
            !if $(slib_text[$slib_l;2])=replace
15744 bpr 637
              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 638
            !else
15744 bpr 639
              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 640
            !endif
641
          !endif
642
        !else
643
          !if $(slib_class[$slib_l;$slib_c])=tab_sign_plus
15744 bpr 644
            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 645
          !else
646
            !if $(slib_class[$slib_l;$slib_c])=tab_sign_moins
15744 bpr 647
              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 648
            !else
15744 bpr 649
              slib_tableau=$slib_tableau<$tab_tag $tab_tag_attr class="$slib_elemtcss" $slib_idcell>\($(slib_cel[$slib_l;$slib_c])\)</$tab_tag>
15635 obado 650
            !endif
651
          !endif
652
        !endif
653
      !endif
654
    !next slib_c
655
    !if $slib_l=1
656
      slib_tableau=$slib_tableau</tr></thead><tbody>
657
    !else
658
      slib_tableau=$slib_tableau</tr>
659
    !endif
660
  !next slib_l
661
  slib_tableau=$slib_tableau</tbody></table></div>
13917 bpr 662
 
663
  !if $slib_nbrep=0
664
    slib_out=$slib_out$slib_tableau
665
  !else
666
    slib_answer=
667
    !for slib_w=1 to $slib_nbrep
668
      slib_answer=!append item $(slib_content[$(slib_pos_rep_$slib_w)]) to $slib_answer
669
    !next slib_w
13920 bpr 670
    slib_out=$slib_out$slib_tableau,[$slib_answer]
13917 bpr 671
  !endif
672
!endif
673
 
674
!goto resetvar
675
 
676
:resetvar
677
!!!!  RESET DES VARIABLES  !!!!
678
 
679
!for slib_g=1 to $slib_nbfonc
680
  !reset slib_fonc$slib_g
681
!next
682
 
15744 bpr 683
!reset slib_fonc slib_data slib_var slib_nbfonc slib_bornes\
684
  slib_racines slib_valinterdites slib_datasort slib_nbdata \
685
  slib_listabsc slib_content slib_rep slib_nbrep slib_answer \
686
  slib_repsort slib_class slib_cel slib_wimscenter slib_code\
687
  slib_style_plus slib_style_moins slib_tableau slib_answer \
16616 gmarbeuf 688
  slib_style_temp slib_allvalues slib_nocss
13917 bpr 689
 
13920 bpr 690
!!!! SUPPRIME POUR L INSTANT exec maxima algebraic:false;