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