giacfr.tex 20.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% giac/hevea interaction code definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Use one of the environment \begin{giacjs}...\end{giacjs} or \begin{giacjsonline}...\end{giacjsonline}
%% to load the javascript code (from hard disk or Internet)
%% Commands \giacinput{} or \giacinputmath{} or \giacinputbigmath{} 
%% \giaccmd{} or \giaccmdmath{} or \giaccmdbigmath{} 
%% or \begin{giacprog}...\end{giacprog}
\usepackage{hevea} 
\usepackage{listings}
\usepackage{fancyvrb}
\ifhevea 
\newcommand\giacmathjax{
\usepackage[auto]{mathjax}
\renewcommand{\jax@meta}{\begin{rawhtml}<script language="javascript"> 
var ua = window.navigator.userAgent;  
var old_ie = ua.indexOf('MSIE ');  
var new_ie = ua.indexOf('Trident/');  
if ((old_ie > -1) || (new_ie > -1) || Boolean(window.chrome)){
 (function () {
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.src  = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML";
  document.getElementsByTagName("head")[0].appendChild(script);
})();
}
</script>
\end{rawhtml}}
}
\newenvironment{giacjs}[1]["max-height: 500px; overflow:auto"]
{\loadgiacmain{#1}
}
{\loadgiaccontrol
\loadgiacscriptstart
\@print{
<script src="file:///usr/share/giac/doc/giac.js" async></script> 
}
\loadgiacscriptend
} 
\newenvironment{giacjshere}[1]["max-height: 500px; overflow:auto"]
{\loadgiacmain{#1}
}
{\loadgiaccontrol
\loadgiacscriptstart
\@print{
<script src="giac.js" async></script> 
}
\loadgiacscriptend
} 
\newenvironment{giacparijs}[1]["max-height: 500px; overflow:auto"]
{\loadgiacmain{#1}
}
{
\loadgiaccontrol
\loadgiacscriptstart
\@print{
<script src="file:///usr/share/giac/doc/giacpari.js" async></script> 
}
\loadgiacscriptend
} 
\newenvironment{giacjsonline}[1]["max-height: 500px; overflow:auto"]
{\loadgiacmain{#1}
}
{
\loadgiaccontrol
\loadgiacscriptstart
\@print{
<script src="https://www-fourier.ujf-grenoble.fr/~parisse/giac.js" async></script> 
}
\loadgiacscriptend
} 
\newenvironment{giacparijsonline}[1]["max-height: 500px; overflow:auto"]
{\loadgiacmain{#1}
}
{
\loadgiaccontrol
\loadgiacscriptstart
\@print{
<script src="https://www-fourier.ujf-grenoble.fr/~parisse/giacpari.js" async></script> 
}
\loadgiacscriptend
} 
\else
\newcommand\giacmathjax{}
\newenvironment{giacjs}[1]["max-height: 500px; overflow:auto"]{}{}
\newenvironment{giacjshere}[1]["max-height: 500px; overflow:auto"]{}{}
\newenvironment{giacparijs}[1]["max-height: 500px; overflow:auto"]{}{}
\newenvironment{giacjsonline}[1]["max-height: 500px; overflow:auto"]{}{}
\newenvironment{giacparijsonline}[1]["max-height: 500px; overflow:auto"]{}{}
\fi
\newcommand{\loadgiacscriptstart}{
\ifhevea
\@print{
<script language="javascript"> 
var Module = { 
        htmlcheck:true,
        htmlbuffer:'',
        preRun: [],
        postRun: [],
        print: (function() {
          var element = document.getElementById('output');
          element.innerHTML='';// element.value = ''; // clear browser cache
          return function(text) {
            //console.log(text.charCodeAt(0));
            if (text.length==1 && text.charCodeAt(0)==12){ element.innerHTML=''; return; }
            if (text.length>=1 && text.charCodeAt(0)==2) {console.log('STX');Module.htmlcheck=false; htmlbuffer='';return;}
            if (text.length>=1 && text.charCodeAt(0)==3) {console.log('ETX');Module.htmlcheck=true; element.style.display='inherit'; element.innerHTML += htmlbuffer;htmlbuffer='';element.scrollTop = 99999; return;}
            if (Module.htmlcheck){
            // These replacements are necessary if you render to raw HTML 
             text = text.replace(/&/g, "&amp;");
             text = text.replace(/</g, "&lt;");
             text = text.replace(/>/g, "&gt;");
             text = text.replace('\n', '<br>', 'g');
             text += '<br>'
             element.style.display='inherit';
             element.innerHTML += text; // element.value += text + "\n";
             element.scrollTop = 99999; // focus on bottom
            } else htmlbuffer += text;
          };
        })(),
     canvas: document.getElementById('canvas'),};
</script>
}
\fi
}
\newcommand{\loadgiacmain}[1]{
\ifhevea
\@print{
<div>
<div id="maindiv" style=}#1\@print{>}
\fi
}
\newcommand{\loadgiaccontrol}{
\ifhevea
\@print{
</div>
<div id="controldiv" style="max-height: 400px; overflow:auto">
<span id="controlindex"></span>
<button title="Clone la derni&egrave;re commande ex&eacute;cut&eacute;ee vers Xcas en ligne" onclick="UI.clone()">Clone</button>
<button title="Efface la console" onclick="document.getElementById('output').innerHTML='';">Efface</button>
<button title="Increase console size" onclick="var field=document.getElementById('output'); var s=field.style.maxHeight; s=s.substr(0,s.length-2);s=eval(s)+20 ;if(s<innerHeight/2){s=s+'px';field.style.maxHeight=s; field=document.getElementById('maindiv'); s=field.style.maxHeight; s=s.substr(0,s.length-2);s=eval(s)-20; s=s+'px';field.style.maxHeight=s;}">+</button>
<button title="Decrease console size" onclick="var field=document.getElementById('output'); var s=field.style.maxHeight; s=s.substr(0,s.length-2);s=eval(s)-20 ; if(s>80){s=s+'px';field.style.maxHeight =s;field=document.getElementById('maindiv'); s=field.style.maxHeight; s=s.substr(0,s.length-2);s=eval(s)+20; s=s+'px';field.style.maxHeight=s;}">-</button>
<textarea title="Ligne de commande pour un calcul rapide" onkeypress="UI.ckenter(event,this,3)" style="width:400px;height:20px;font-size:large"></textarea><button  title="Evalue cellule precedente" onclick="UI.quick(this);">-></button><span></span>
&nbsp;&nbsp;<button onclick="var s=UI.caseval('restart;'); Module.print(s);" title="Reinitialise le moteur de calcul formel">Restart</button>
<button onclick="UI.exec(document.documentElement);" title='Cliquer ici pour executer toutes les commandes (attention cela peut etre long!)'>Exec. tout</button>
<canvas id='canvas' width=0 height=0   onmousedown="UI.canvas_pushed=true;UI.canvas_lastx=event.clientX; UI.canvas_lasty=event.clientY;"  onmouseup="UI.canvas_pushed=false;" onmousemove="UI.canvas_mousemove(event,'')"></canvas>
<div id="output" style="max-height: 80px; overflow:auto"></div>
</div>
</div>}
\fi
}
\ifhevea
\newcommand{\loadgiacscriptend}{
\@print{
<script language="javascript">
 var UI = {
  histcount:0,
  usemathjax:false,
  lastcmd:'',
  clone:function(){
    if (UI.lastcmd.length){
       var tmp=giaceval('VARS(-1)');
       tmp=encodeURIComponent(tmp);
       var url='https://www-fourier.ujf-grenoble.fr/~parisse/xcasfr.html#+'+tmp+':;&+'+UI.lastcmd;
       console.log(url);
       window.open(url,'_blank');
    }
  },
  canvas_pushed:false,
  canvas_lastx:0,
  canvas_lasty:0,
  canvas_mousemove:function(event,no){
    if (UI.canvas_pushed){
      // Module.print(event.clientX);
      if (UI.canvas_lastx!=event.clientX){
        if (event.clientX>UI.canvas_lastx)
          giac3d('r'+no);
        else
          giac3d('l'+no);
        UI.canvas_lastx=event.clientX;
      }
      if (UI.canvas_lasty!=event.clientY){
        if (event.clientY>UI.canvas_lasty)
          giac3d('d'+no);
        else
          giac3d('u'+no);
        UI.canvas_lasty=event.clientY;
      }
    }
  },  
  count_newline:function(s){
    var ss=s.length,i,res=1;
    for (i=0;i<ss;i++){
      if (s[i]=='\n') res++;
    }
    return res;
  },
  ltgt:function(s){
    var ss=s.length,i,res='',c=0;
    for (i=0;i<ss-4;i++){
      if (s[i]=='\n') c++;
      if (s[i]!='&' || s[i+2]!='t' || s[i+3]!=';'){
        res += s[i];
        continue;
      }
      if (s[i+1]=='l'){
        res += '<';
        i +=3;
        continue;
      }
      if (s[i+1]=='g'){
        res += '>';
        i +=3;
        continue;
      }
      res += s[i];
    }
    for (;i<ss;i++) res+=s[i];
    return [res,c];
  },
  rmquote:function(tmp){
    var s=tmp.length;
    if (s>2 && tmp.charCodeAt(0)==34 && tmp.charCodeAt(s-1)==34)
      tmp=tmp.substr(1,s-2);
    return tmp;
  },
  quick:function(field){
    var tmp1=field.previousSibling.value;
    var tmp=UI.caseval(tmp1);
    tmp=UI.rmquote(tmp); 
    tmp=UI.latexeval(tmp);
    Module.print(String.fromCharCode(2));
    Module.print("<tt>");
    Module.print(tmp1);
    Module.print("</tt><br>&nbsp;&nbsp;");
    Module.print(tmp);
    Module.print("<br>");
    Module.print(String.fromCharCode(3));
    field.nextSibling.innerHTML='&nbsp;'+tmp;
   //UI.render_canvas(nextSibling);  
  },
  caseval:function(text){
    UI.lastcmd=text;
    var s="non evalu&eacute;",err;
    try {
       s= giaceval(text);
    } catch (err) { s=err.message;}
    var is_3d=s.length>5 && s.substr(0,5)=='gl3d ';
    if (is_3d){
	var n3d=s.substr(5,s.length-5);
	s = '<canvas id="gl3d_'+n3d+'" onmousedown="UI.canvas_pushed=true;UI.canvas_lastx=event.clientX; UI.canvas_lasty=event.clientY;" onmouseup="UI.canvas_pushed=false;" onmousemove="UI.canvas_mousemove(event,'+n3d+')" width=400 height=250></canvas>';
    }
    return s;
  },
  render_canvas:function(field){
   var n=field.id;
   if (n && n.length>5 && n.substr(0,5)=='gl3d_'){
    Module.print(n);
    var n3d=n.substr(5,n.length-5);
    giac3d(n3d);
    return;
   }
   var f=field.firstChild;
   for (;f;f=f.nextSibling){
     UI.render_canvas(f);
   }
  },
  eval_form: function(field){
    giaceval('assume('+field.name.value+'=round('+field.valname.value+',12))');
    var s=UI.caseval(field.prog.value);
    var is_svg=s.substr(1,4)=='<svg';
    if (is_svg) field.parentNode.lastChild.innerHTML=s.substr(1,s.length-2);
    else field.parentNode.lastChild.innerHTML=s;
    UI.render_canvas(field.parentNode.lastChild);
  },
  latexeval:function(text){
    var tmp=text;
    if (tmp.length>5 && tmp.substr(0,5)=='gl3d_') return tmp;
    if (tmp.length>5 && tmp.substr(1,4)=='<svg') return tmp.substr(1,tmp.length-2);
    if (tmp.length>5 && tmp.substr(0,4)=='<svg') return tmp;
     if (UI.usemathjax){
       tmp=giaceval('latex(quote('+tmp+'))');
       var dollar=String.fromCharCode(36);
       tmp=dollar+dollar+tmp.substr(1,tmp.length-2)+dollar+dollar;
       return tmp;
     }
     tmp=giaceval('mathml(quote('+tmp+',1))');
     tmp=tmp.substr(1,tmp.length-2);
    return tmp;   
  },
  ckenter:function(event,field,mode){
    var key = event.keyCode;
    if (key != 13 || event.shiftKey) return true;
   if (mode==3){ UI.quick(field.nextSibling); event.preventDefault(); field.select(); return true; }
    var tmp=field.value;
   Module.print(tmp);
    tmp=UI.caseval(tmp);
    if (mode==1){
      tmp=UI.rmquote(tmp); 
   }
   if (mode==2){
     tmp=UI.latexeval(tmp);
   }
   field.nextSibling.nextSibling.innerHTML=tmp;
   UI.render_canvas(field.nextSibling.nextSibling);
   if (UI.usemathjax) MathJax.Hub.Queue(["Typeset",MathJax.Hub,field.nextSibling.nextSibling]);
   if (event.preventDefault) event.preventDefault();
    return false;
  },
  exec: function(field){
     if (field.nodeName=="BUTTON" && field.innerHTML!='Clone' && field.innerHTML!='Restart' && field.innerHTML!='Exec. tout' ){
        field.click();
        return;
     }
     var f=field.firstChild;
     while (f){
       UI.exec(f);
       f=f.nextSibling;
     }
   },
  execonload: function(field){
     var f=field.nextSibling;
     if (f && f.innerHTML=="onload" && field.nodeName=="BUTTON"){
        field.click();
        return;
     }
     f=field.firstChild;
     while (f){
       UI.execonload(f);
       f=f.nextSibling;
     }
   },
  textarealtgt: function(field){
     if (field.nodeName=="TEXTAREA"){
        var tmp=UI.ltgt(field.value);
        field.value=tmp[0];
        //field.style.height=20*(tmp[1]+1)+'px';
        field.rows=tmp[1]+1;
        //console.log(tmp,field.rows);
        return;
     }
     var f=field.firstChild;
     while (f){
       UI.textarealtgt(f);
       f=f.nextSibling;
     }
   }
 };
 window.onload = function(e){
   var isFirefox = typeof InstallTrigger !== 'undefined';   // Firefox 1.0+
   var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
  var ua = window.navigator.userAgent;
  var old_ie = ua.indexOf('MSIE ');
  var new_ie = ua.indexOf('Trident/');
  if ((!isFirefox && !isSafari) || (old_ie > -1) || (new_ie > -1) || window.chrome){
     UI.usemathjax=true;
     alert("Votre navigateur ne supporte MathML, on utilise MathJax pour l'affichage 2d.  Les calculs seraient plus rapides et les resultats seraient mieux affiches avec Firefox.");
  }
  if (UI.usemathjax){
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
    document.getElementsByTagName("head")[0].appendChild(script);
  }
  var elem= document.getElementById('controlindex');
  elem.innerHTML='<hr><a href="'+String.fromCharCode(35)+'sec1">Table</a>, <a href="'+String.fromCharCode(35)+'sec2">Index</a>'+elem.innerHTML;
  elem=document.getElementById('maindiv');
  if (elem.style.maxHeight=='500px')
    elem.style.maxHeight=(window.innerHeight-120)+'px';
  elem= document.getElementById('maindiv');
  elem.style.maxHeight=(window.innerHeight-150)+'px';
  giaceval=Module.cwrap('caseval',  'string', ['string']);
  giac3d = Module.cwrap('_ZN4giac13giac_rendererEPKc','number', ['string']);
  giaceval('set_language(1);');
  giaceval('factor(x^4-1)');
  giaceval('sin(x+y)+f(t)');
  UI.textarealtgt(document.documentElement);
  UI.execonload(document.documentElement);
  document.getElementById('output').innerHTML='';
 // if (confirm('Executer les commandes?')) UI.exec(document.documentElement);
 };
</script>
}
}
\else
\newcommand{\loadgiacscriptend}{}
\fi
\ifhevea
\newenvironment{giacprog}{
\verbatim}
{\endverbatim 
\@print{<button onclick="var field=parentNode.previousSibling; var tmp=field.innerHTML;if(tmp.length==0) tmp=field.value;var t=createElement('TEXTAREA');t.style.fontSize=16;t.cols=60;t.rows=10;var tmp1=UI.ltgt(tmp);t.value=tmp1[0];tmp=UI.caseval(tmp);tmp=UI.rmquote(tmp);nextSibling.innerHTML=tmp; UI.render_canvas(nextSibling.innerHTML); field.parentNode.insertBefore(t,field);field.parentNode.removeChild(field);">ok</button><span></span><br>
}
}
\newenvironment{giaconload}{
\verbatim}
{\endverbatim 
\@print{<button onclick="var field=parentNode.previousSibling; var tmp=field.innerHTML;if(tmp.length==0) tmp=field.value;var t=createElement('TEXTAREA');t.style.fontSize=16;t.cols=60;t.rows=UI.count_newline(tmp);var tmp1=UI.ltgt(tmp)[0];t.value=tmp1;tmp=UI.caseval(tmp);tmp=UI.rmquote(tmp);nextSibling.innerHTML=tmp; UI.render_canvas(nextSibling.innerHTML); field.parentNode.insertBefore(t,field);field.parentNode.removeChild(field);">ok</button><span>onload</span><br>
}
}
\else
\newenvironment{giacprog}
{
\VerbatimEnvironment
\begin{Verbatim}
}
{
\end{Verbatim}
}
\newenvironment{giaconload}
{
\VerbatimEnvironment
\begin{Verbatim}
}
{
\end{Verbatim}
}
\fi

% for example \giaccmd{factor}{x^4-1}
\newcommand{\giaccmd}[3][style="width:400px;font-size:large"]{
\ifhevea
\@print{<textarea}
\@getprint{#1>#3}
\@print{</textarea><button onclick="var tmp=UI.caseval(}
\@getprint{'#2('}
\@print{+previousSibling.value+')');tmp=UI.rmquote(tmp); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">}
\@getprint{#2}
\@print{</button><span></span><br>}
\else
\lstinline@#2(#3)@
\fi
}
\newcommand{\giacinput}[2][style="width:400px;font-size:large"]{
\ifhevea
\@print{<textarea onkeypress="UI.ckenter(event,this,1)" }
\@getprint{#1>#2}
\@print{</textarea><button onclick="previousSibling.style.display='inherit';var tmp=UI.caseval(previousSibling.value);tmp=UI.rmquote(tmp); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">ok</button><span></span><br>}
\else
\lstinline@#2@
\fi
}
\newcommand{\giachidden}[3][style="display:none;width:400px;font-size:large"]{
\ifhevea
\@print{<textarea onkeypress="UI.ckenter(event,this,1)" }
\@getprint{#1>#2}
\@print{</textarea><button onclick="previousSibling.style.display='inherit';var tmp=UI.caseval(previousSibling.value);tmp=UI.rmquote(tmp); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">}
\@getprint{#3}
\@print{</button><span></span><br>}
\else
\lstinline@#2@
\fi
}
\newcommand{\giacinputbig}[2][style="width:800px;font-size:large"]{
\ifhevea
\@print{<textarea onkeypress="UI.ckenter(event,this,1)" }
\@getprint{#1>#2}
\@print{</textarea><button onclick="previousSibling.style.display='inherit';var tmp=UI.caseval(previousSibling.value);tmp=UI.rmquote(tmp); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">ok</button><span></span><br>}
\else
\lstinline@#2@
\fi
}
\newcommand{\giaccmdmath}[3][style="width:400px;font-size:large"]{\ifhevea
\begin{rawhtml}<br><textarea \end{rawhtml}
\@getprint{#1>#3}
\begin{rawhtml}</textarea><button onclick="var tmp=UI.caseval(\end{rawhtml} 
\@getprint{'#2('+}
\begin{rawhtml}previousSibling.value+')');  tmp=UI.latexeval(tmp);nextSibling.innerHTML='&nbsp;'+tmp; if (UI.usemathjax) MathJax.Hub.Queue(['Typeset',MathJax.Hub,nextSibling]);
">\end{rawhtml}
\@getprint{#2}
\begin{rawhtml}</button><span></span><br>\end{rawhtml}
\else
\lstinline@#2(#3)@
\fi
}
\newcommand{\giacinputmath}[2][style="width:400px;font-size:large"]{\ifhevea
\begin{rawhtml}<br><textarea onkeypress="UI.ckenter(event,this,2)" \end{rawhtml}
\@getprint{#1>#2} 
\begin{rawhtml}</textarea><button onclick="previousSibling.style.display='inherit';var tmp=UI.caseval(previousSibling.value); tmp=UI.latexeval(tmp);nextSibling.innerHTML='&nbsp;'+tmp; if (UI.usemathjax) MathJax.Hub.Queue(['Typeset',MathJax.Hub,nextSibling])">ok</button><span></span><br>\end{rawhtml}
\else
\lstinline@#2@
\fi
}
\newcommand{\giachiddenmath}[3][style="display:none;width:400px;font-size:large"]{\ifhevea
\begin{rawhtml}<br><textarea onkeypress="UI.ckenter(event,this,2)" \end{rawhtml}
\@getprint{#1>#2} 
\begin{rawhtml}</textarea><button onclick="previousSibling.style.display='inherit';var tmp=UI.caseval(previousSibling.value); tmp=UI.latexeval(tmp);nextSibling.innerHTML='&nbsp;'+tmp; if (UI.usemathjax) MathJax.Hub.Queue(['Typeset',MathJax.Hub,nextSibling])">\end{rawhtml}
\@getprint{#3}
\begin{rawhtml}</button><span></span><br>\end{rawhtml}
\else
\lstinline@#2@
\fi
}
\newcommand{\giaccmdbigmath}[3][style="width:800px;font-size:large"]{\ifhevea
\begin{rawhtml}<br><textarea \end{rawhtml}
\@getprint{#1>#3} 
\begin{rawhtml}</textarea><button onclick="var tmp=UI.caseval(\end{rawhtml} 
\@getprint{'#2('+}
\begin{rawhtml}previousSibling.value+')');  tmp=UI.latexeval(tmp);nextSibling.innerHTML=tmp; if (UI.usemathjax) MathJax.Hub.Queue(['Typeset',MathJax.Hub,nextSibling])">\end{rawhtml}
\@getprint{#2}
\begin{rawhtml}</button><div style="width:800px;max-height:200px;overflow:auto;color:blue;text-align:center"></div><br>\end{rawhtml}
\else
\lstinline@#2(#3)@
\fi
}
\newcommand{\giacinputbigmath}[2][style="width:800px;font-size:large"]{\ifhevea
\begin{rawhtml}<div><textarea onkeypress="UI.ckenter(event,this,2)" \end{rawhtml}
\@getprint{#1>#2} 
\begin{rawhtml}</textarea><button onclick="previousSibling.style.display='inherit';var tmp=UI.caseval(previousSibling.value); tmp=UI.latexeval(tmp);nextSibling.innerHTML=tmp; if (UI.usemathjax) MathJax.Hub.Queue(['Typeset',MathJax.Hub,nextSibling])">ok</button><div style="width:800px;max-height:200px;overflow:auto;color:blue;text-align:center"></div></div>\end{rawhtml}
\else
\lstinline@#2@
\fi
}
\newcommand{\giaclink}[2][Tester en ligne]{\ifhevea
\begin{rawhtml}<a href=\end{rawhtml}\@getprint{"#2"}
\begin{rawhtml} target="_blank">\end{rawhtml}
\@getprint{#1}
\begin{rawhtml}</a>\end{rawhtml}
\else
\fi
}
% \giacslider{name}{mini}{maxi}{step}{value}{prog}
\newcommand{\giacslider}[6]{
\ifhevea
\begin{rawhtml}
<div><form onsubmit="setTimeout(function(){UI.eval_form(form);});return false;">
<input type="text" name="name" size="1" value=
\end{rawhtml}
\@getprint{"#1">}
\begin{rawhtml}
=<input type="number" name="valname" onchange="UI.eval_form(form);" value=
\end{rawhtml}
\@getprint{"#5">}
\begin{rawhtml}
<input type="button" value="-" onclick="valname.value -= stepname.value;UI.eval_form(form);">
<input type="button" value="+" onclick="valname.value -= -stepname.value;UI.eval_form(form);">
<input type="number" name="stepname" value=
\end{rawhtml}
\@getprint{"#4">}
\begin{rawhtml}
<input type="range" name="rangename"
onclick="valname.value=value;UI.eval_form(form);" value=
\end{rawhtml}
\@getprint{"#5" min="#2" max="#3" step="#4">}
\begin{rawhtml}
<textarea name="prog" onchange="UI.eval_form(form)" style="width:400px;vertical-align:bottom;font-size:large">
\end{rawhtml}\@getprint{#6}
\begin{rawhtml}
</textarea>
</form>
<span>Not evaled</span></div>
\end{rawhtml}
\else
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% giac/hevea end code definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%