Commit 13a26d59 authored by Ximin Luo's avatar Ximin Luo

New upstream version 1.2.3.51+dfsg1

parent 9dc5dc72
......@@ -8,18 +8,18 @@ $(PACKAGE)-$(VERSION).tar.gz: dist
## FIXME: installing autoconf-generated config.h is just PLAIN WRONG.
install-exec-hook:
cp config.h $(DESTDIR)/$(includedir)/giac
./mkinstalldirs $(DESTDIR)/$(prefix)/share/
./mkinstalldirs $(DESTDIR)/$(prefix)/share/pixmaps
cp xcas.xpm $(DESTDIR)/$(prefix)/share/pixmaps/xcas.xpm
./mkinstalldirs $(DESTDIR)/$(prefix)/share/applications
cp xcas.desktop $(DESTDIR)/$(prefix)/share/applications/xcas.desktop
./mkinstalldirs $(DESTDIR)/$(prefix)/share/application-registry
cp xcas.applications $(DESTDIR)/$(prefix)/share/application-registry/xcas.applications
./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/
./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/hicolor
for SIZE in 256 128 64 32 16; do ./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE} && ./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/apps && cp icons/xcas_$${SIZE}.png $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/xcas.png; done
for SIZE in 256 128 64 32 16; do ./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/mimetypes && cp icons/x-xcas_$${SIZE}.png $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/mimetypes/application-x-xcas.png; done
cp config.h $(DESTDIR)$(includedir)/giac
./mkinstalldirs $(DESTDIR)$(prefix)/share/
./mkinstalldirs $(DESTDIR)$(prefix)/share/pixmaps
cp xcas.xpm $(DESTDIR)$(prefix)/share/pixmaps/xcas.xpm
./mkinstalldirs $(DESTDIR)$(prefix)/share/applications
cp xcas.desktop $(DESTDIR)$(prefix)/share/applications/xcas.desktop
./mkinstalldirs $(DESTDIR)$(prefix)/share/application-registry
cp xcas.applications $(DESTDIR)$(prefix)/share/application-registry/xcas.applications
./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/
./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/hicolor
for SIZE in 256 128 64 32 16; do ./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE} && ./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/apps && cp icons/xcas_$${SIZE}.png $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/xcas.png; done
for SIZE in 256 128 64 32 16; do ./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/mimetypes && cp icons/x-xcas_$${SIZE}.png $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/mimetypes/application-x-xcas.png; done
ACLOCAL_AMFLAGS = -I m4
......@@ -4,7 +4,7 @@
GF(3,k^6+2*k^5+2,[k,K,a],undef),
(-a^4-a^3-a^2),
1*x^3-1*x+1,
(x+(-a^4-a^3+a^2+a))*(x+(-a^4-a^3+a^2+a+1))*(x+(-a^4-a^3+a^2+a-1)),
((1 % 3)*x+(-a^4-a^3+a^2+a))*(x+(-a^4-a^3+a^2+a+1))*((1 % 3)*x+(-a^4-a^3+a^2+a-1)),
x^3-1 % 3*x+a,
[1*x*(1*x+1)*(1*x-1)*(1*x^5-1*x+1)*(1*x^5-1*x-1)*(1*x^5+1*x^4-1)*(1*x^5-1*x^4+1)*(1*x^5+1*x^2+1*x-1)*(1*x^5-1*x^2+1*x+1)*(1*x^5+1*x^3+1*x+1)*(1*x^5+1*x^3+1*x-1)*(1*x^5+1*x^3+1*x^2-1)*(1*x^5+1*x^3-1*x^2+1)*(1*x^5-1*x^3+1*x^2+1)*(1*x^5-1*x^3-1*x^2-1)*(1*x^5+1*x^4+1*x-1)*(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ity,
2,
4*cos(x)^2-1,
2*cos(2*x)+1,
-1/pi+1/pi^2*(x-pi)+(pi^2-6)/(6*pi^3)*(x-pi)^2+(-pi^2+6)/(6*pi^4)*(x-pi)^3+(-pi^4+20*pi^2-120)/(120*pi^5)*(x-pi)^4+(pi^4-20*pi^2+120)/(120*pi^6)*(x-pi)^5+(x-pi)^6*order_size(x-pi),
-1/pi+1/pi^2*(x-pi)+(pi^2-6)/(6*pi^3)*(x-pi)^2+(x-pi)^3*order_size(x-pi),
-cos(1)+(-cos(1)+1/2*sin(1))*(x-1)+(-5/6*cos(1)+1/2*sin(1))*(x-1)^2+(x-1)^3*order_size(x-1),
......@@ -234,7 +234,7 @@ poly1[1,1.0,-2.0,0.0],
-9856989898997,
-2,
GF(2,a^2+a+1,[a,FF],undef),
(x-1)*(x+FF(a))*(x+FF(a+1)),
((1 % 2)*x+1 % 2)*((1 % 2)*x+FF(a))*(x+FF(a+1)),
GF(2,j^2+j+1,[j,F4],undef),
[0,F4(j)],
[0,0],[F4(j),0],[0,F4(j)],[F4(j),F4(j)],
......@@ -259,8 +259,8 @@ matrix[[-8.1-X,-2.1,6.9,-9.1,2.9],[-5.1,-2.1-X,9.9,9.9,2.9],[-2.1,8.9,7.9-X,-7.1
[[-2.0,1.0],[1.5,-0.5]],
GF(3,u^3+2*u+1,[u,F],undef),
F(u),
(x-1)*(x+F(1))*(x^2+F(1)),
(x+F(u))*(x+F(u+1))*(x+F(u-1)),
((1 % 3)*x-1 % 3)*(x+F(1))*(x^2+F(1)),
((1 % 3)*x+F(u))*(x+F(u+1))*((1 % 3)*x+F(u-1)),
GF(7,a^7+3*a^6+a^5+a^4+3*a^3+5*a^2+4*a+4,[a,G],undef),
G(a),
(x+G(-2*a^6-a^5+3*a^4+3*a^3+3*a^2))*(x+G(-2*a^6-a^5+3*a^4+3*a^3+3*a^2+1))*(x+G(-2*a^6-a^5+3*a^4+3*a^3+3*a^2+2))*(x+G(-2*a^6-a^5+3*a^4+3*a^3+3*a^2+3))*(x+G(-2*a^6-a^5+3*a^4+3*a^3+3*a^2-1))*(x+G(-2*a^6-a^5+3*a^4+3*a^3+3*a^2-2))*(x+G(-2*a^6-a^5+3*a^4+3*a^3+3*a^2-3)),
......
......@@ -37,7 +37,7 @@ pnt(pnt[line[x+i*y,(-x-i*y+1)*sqrt(x*x+y*y)/sqrt((x-1)*(x-1)+y*y)],56,c]),
pnt(pnt[rootof([[2*i*x-2*y-i,(-2*i)*x+i,(-8*i)*x^3+8*x^2*y+12*i*x^2+(-8*i)*x*y^2-8*x*y+(-6*i)*x+8*y^3+4*i*y^2+4*y+i,8*i*x^3+(-12*i)*x^2+8*i*x*y^2+4*x*y+6*i*x+(-4*i)*y^2-2*y-i],[1,0,-4*x^2+4*x-4*y^2-2,0,4*x^2-4*x+1]])/(8*x*y-4*y),56,M]),
pnt(pnt[rootof([[2*i*x-2*y-i,(-2*i)*x+i,(-8*i)*x^3+8*x^2*y+12*i*x^2+(-8*i)*x*y^2-8*x*y+(-6*i)*x+8*y^3+4*i*y^2+4*y+i,8*i*x^3+(-12*i)*x^2+8*i*x*y^2+4*x*y+6*i*x+(-4*i)*y^2-2*y-i],[1,0,-4*x^2+4*x-4*y^2-2,0,4*x^2-4*x+1]])/(8*x*y-4*y),56,N]),
0,
assume[DOM_FLOAT,1.2],assume[DOM_int,-1],
assume[real,1.2],assume[DOM_int,-1],
"Done",
parameter([a,-10.0,10.0,-1,0]),
parameter([b,-10.0,10.0,-1,0]),
......
......@@ -24,7 +24,7 @@ sin(2*x)/2,
2*(-676039/16777216*ln(-sin(x)+1)+676039/16777216*ln(sin(x)+1)+(-334639305*sin(x)^23+3904125225*sin(x)^21-20814564771*sin(x)^19+67013911107*sin(x)^17-144986993866*sin(x)^15+221803567050*sin(x)^13-245588699190*sin(x)^11+197767334710*sin(x)^9-114444262845*sin(x)^7+46038446685*sin(x)^5-12013258455*sin(x)^3+1741541175*sin(x))/(4152360960*(sin(x)^2-1)^12)),
2*(15*tan(x/2)^4-30*tan(x/2)^3+40*tan(x/2)^2-20*tan(x/2)+7)/(15*(tan(x/2)-1)^5),
2*(-15*tan(x/2)^4-30*tan(x/2)^3-40*tan(x/2)^2-20*tan(x/2)-7)/(15*(tan(x/2)+1)^5),
x*ln(x+sqrt(x^2+1))-sqrt(x^2+1),
x*ln(x+sqrt(1+x^2))-sqrt(x^2+1),
x*atan(2*x/(1+x^2))-1/2*(-ln(x^4+6*x^2+1)+2/sqrt(2)*ln((2*x^2+6-4*sqrt(2))/(2*x^2+6+4*sqrt(2)))),
sqrt(x^2+1)*(x^2+1)/3,
1/cos(x),
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -115,6 +115,7 @@ if test "x$CONFIG_DL" = "xyes"; then
AC_CHECK_LIB(dl, dlopen)
fi
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
......
SUBDIRS = en es fr el local pt zh de
DIST_SUBDIRS = en es fr el local pt zh de
XCASHTML = xcasfr.html xcasen.html codemirror.css codemirror.js xcasmode.js giac.js matchbrackets.js FileSaver.js logo.png longhelp.js giac.tex giacfr.tex test.tex testfr.tex test.html testfr.html
XCASHTML = xcasfr.html xcasen.html codemirror.css codemirror.js xcasmode.js giac.js matchbrackets.js FileSaver.js logo.png longhelp.js giac.tex giacfr.tex test.tex testfr.tex test.html testfr.html menufr.js menuen.js show-hint.js show-hint.css w3data.js algoseconde.html
EXTRA_DIST = aide_cas README index.html $(XCASHTML) dxcas/* pari/*
dist_pkgdata_DATA = aide_cas
......
This diff is collapsed.
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian) (format=latex 2015.4.3) 3 JAN 2017 12:42
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian) (format=latex 2015.4.3) 5 MAY 2017 10:33
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
......
......@@ -11,6 +11,23 @@
\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}
}
......@@ -65,7 +82,9 @@
\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"]{}{}
......@@ -172,10 +191,45 @@ var Module = {
UI.render_canvas(f);
}
},
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='';
for (i=0;i<ss-4;i++){
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;
},
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);
if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2);
tmp=UI.rmquote(tmp);
tmp=UI.latexeval(tmp);
Module.print(String.fromCharCode(2));
Module.print("<tt>");
......@@ -215,7 +269,8 @@ var Module = {
if (tmp.length>5 && tmp.substr(0,4)=='<svg') return tmp;
if (UI.usemathjax){
tmp=giaceval('latex(quote('+tmp+'))');
tmp='$$'+tmp.substr(1,tmp.length-2)+'$$';
var dollar=String.fromCharCode(36);
tmp=dollar+dollar+tmp.substr(1,tmp.length-2)+dollar+dollar;
return tmp;
}
tmp=giaceval('mathml(quote('+tmp+',1))');
......@@ -230,7 +285,7 @@ var Module = {
Module.print(tmp);
tmp=UI.caseval(tmp);
if (mode==1){
if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2);
tmp=UI.rmquote(tmp);
}
if (mode==2){
tmp=UI.latexeval(tmp);
......@@ -255,6 +310,29 @@ var Module = {
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"){
field.value=UI.ltgt(field.value);
return;
}
var f=field.firstChild;
while (f){
UI.textarealtgt(f);
f=f.nextSibling;
}
}
};
window.onload = function(e){
......@@ -284,6 +362,8 @@ var Module = {
giaceval('set_language(1);');
giaceval('factor(x^4-1)');
giaceval('sin(x+y)+f(t)');
UI.textarealtgt(document.documentElement);
UI.execonload(document.documentElement);
// if (confirm('Exec commands?')) UI.exec(document.documentElement);
};
</script>
......@@ -294,7 +374,13 @@ var Module = {
\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;t.value=tmp;tmp=UI.caseval(tmp);if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2);nextSibling.innerHTML=tmp; UI.render_canvas(nextSibling.innerHTML); field.parentNode.insertBefore(t,field);field.parentNode.removeChild(field);">ok</button><span></span><br>
\@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;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);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
......@@ -306,6 +392,14 @@ var Module = {
{
\end{Verbatim}
}
\newenvironment{giaconload}
{
\VerbatimEnvironment
\begin{Verbatim}
}
{
\end{Verbatim}
}
\fi
% for example \giaccmd{factor}{x^4-1}
......@@ -315,7 +409,7 @@ var Module = {
\@getprint{#1>#3}
\@print{</textarea><button onclick="var tmp=UI.caseval(}
\@getprint{'#2('}
\@print{+previousSibling.value+')');if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling)">}
\@print{+previousSibling.value+')');tmp=UI.rmquote(tmp); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling)">}
\@getprint{#2}
\@print{</button><span></span><br>}
\else
......@@ -326,7 +420,7 @@ var Module = {
\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);if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">ok</button><span></span><br>}
\@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
......@@ -335,7 +429,7 @@ var Module = {
\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);if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">}
\@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
......@@ -346,7 +440,7 @@ var Module = {
\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);if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">ok</button><span></span><br>}
\@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
......@@ -367,7 +461,7 @@ var Module = {
\newcommand{\giacinputmath}[2][style="width:400px;height:20px;font-size:large"]{\ifhevea
\begin{rawhtml}<br><textarea onkeypress="UI.ckenter(event,this,2)" \end{rawhtml}
\@getprint{#1>#2}
\begin{rawhtml}</textarea><button onclick="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}
\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
......@@ -397,7 +491,7 @@ var Module = {
\newcommand{\giacinputbigmath}[2][style="width:800px;height:20px;font-size:large"]{\ifhevea
\begin{rawhtml}<div><textarea onkeypress="UI.ckenter(event,this,2)" \end{rawhtml}
\@getprint{#1>#2}
\begin{rawhtml}</textarea><button onclick="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}
\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
......
......@@ -10,6 +10,23 @@
\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}
}
......@@ -64,6 +81,7 @@
\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"]{}{}
......@@ -159,10 +177,45 @@ var Module = {
}
}
},
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='';
for (i=0;i<ss-4;i++){
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;
},
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);
if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2);
tmp=UI.rmquote(tmp);
tmp=UI.latexeval(tmp);
Module.print(String.fromCharCode(2));
Module.print("<tt>");
......@@ -214,7 +267,8 @@ var Module = {
if (tmp.length>5 && tmp.substr(0,4)=='<svg') return tmp;
if (UI.usemathjax){
tmp=giaceval('latex(quote('+tmp+'))');
tmp='$$'+tmp.substr(1,tmp.length-2)+'$$';
var dollar=String.fromCharCode(36);
tmp=dollar+dollar+tmp.substr(1,tmp.length-2)+dollar+dollar;
return tmp;
}
tmp=giaceval('mathml(quote('+tmp+',1))');
......@@ -229,7 +283,7 @@ var Module = {
Module.print(tmp);
tmp=UI.caseval(tmp);
if (mode==1){
if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2);
tmp=UI.rmquote(tmp);
}
if (mode==2){
tmp=UI.latexeval(tmp);
......@@ -250,6 +304,29 @@ var Module = {
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"){
field.value=UI.ltgt(field.value);
return;
}
var f=field.firstChild;
while (f){
UI.textarealtgt(f);
f=f.nextSibling;
}
}
};
window.onload = function(e){
......@@ -278,6 +355,8 @@ var Module = {
giaceval('set_language(1);');
giaceval('factor(x^4-1)');
giaceval('sin(x+y)+f(t)');
UI.textarealtgt(document.documentElement);
UI.execonload(document.documentElement);
// if (confirm('Executer les commandes?')) UI.exec(document.documentElement);
};
</script>
......@@ -288,7 +367,13 @@ var Module = {
\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;t.value=tmp;tmp=UI.caseval(tmp);if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2);nextSibling.innerHTML=tmp; UI.render_canvas(nextSibling.innerHTML);field.parentNode.insertBefore(t,field);field.parentNode.removeChild(field);">ok</button><span></span><br>
\@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;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);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
......@@ -300,6 +385,14 @@ var Module = {
{
\end{Verbatim}
}
\newenvironment{giaconload}
{
\VerbatimEnvironment
\begin{Verbatim}
}
{
\end{Verbatim}
}
\fi
% for example \giaccmd{factor}{x^4-1}
......@@ -309,7 +402,7 @@ var Module = {
\@getprint{#1>#3}
\@print{</textarea><button onclick="var tmp=UI.caseval(}
\@getprint{'#2('}
\@print{+previousSibling.value+')');if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">}
\@print{+previousSibling.value+')');tmp=UI.rmquote(tmp); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">}
\@getprint{#2}
\@print{</button><span></span><br>}
\else
......@@ -320,7 +413,7 @@ var Module = {
\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);if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">ok</button><span></span><br>}
\@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
......@@ -329,7 +422,7 @@ var Module = {
\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);if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">}
\@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
......@@ -340,7 +433,7 @@ var Module = {
\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);if (tmp.charCodeAt(0)==34) tmp=tmp.substr(1,tmp.length-2); nextSibling.innerHTML='&nbsp;'+tmp;UI.render_canvas(nextSibling);">ok</button><span></span><br>}
\@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
......
This diff is collapsed.
This diff is collapsed.
......@@ -87,13 +87,15 @@ for this file and check your installation by compiling it\\
\section{Commands}
You must first enter the command \verb|\input{giac.tex}| in the
preamble of your \LaTeX\ source file
and add one of the commands \verb|\begin{giacjs}|\index{giacjs} or
and add one of the commands \verb|\begin{giacjshere}|\index{giacjshere}
\verb|\begin{giacjs}|\index{giacjs} or
\verb|\begin{giacjsonline}|\index{giacjsonline}
just after \verb|\begin{document}|: the difference is that the javascript
kernel \verb|giac.js|
will either be found on the hard disk (assuming that Giac/Xcas is
installed on the target computer) or downloaded from Internet.
You must also add the command \verb|\end{giacjs}| or
will either be found from the same place where the file was downloaded
or on the hard disk (assuming that Giac/Xcas is
installed on the target computer) or downloaded from Giac Internet website.
You must also add the corresponding command \verb|\end{giacjs}| or
\verb|\end{giacjsonline}| just before \verb|\end{document}|.
You should add the command \verb|\tableofcontents|\index{table} then
\verb|\printindex|\index{index} just after
......@@ -139,6 +141,9 @@ with optional style argument\\
\verb|\giaccmd[style="width:200px;height:20px;font-size:large"]{factor}{x^4-1}|\\
\giaccmd[style="width:200px;height:20px;font-size:large"]{factor}{x^4-1}
{\bf Warning}, you must replace \verb|<| by \verb|&lt;| and \verb|>|
by \verb|&gt;|, otherwise they will be interpreted as HTML delimiters.
For a program\index{giacprog} or multi-line commands\\
\verb|\begin{giacprog}...\end{giacprog}|, example homemade absolute value\\
\begin{giacprog}
......@@ -148,7 +153,8 @@ f(x):={
return y;
}
\end{giacprog}
Do not use in another environment (like itemize or enumerate).
Inside this environment, you can keep \verb|<| and \verb|>|.
Do not use this environment in another environment (like itemize or enumerate).
A link\index{giaclink} to Xcas offline with a few commands\\
\verb|\giaclink{http://www-fourier.ujf-grenoble.fr/\%7eparisse/xcasen.html#+factor(x^4-1)&+a:=idn(3)&}|\\
......
% Pour compiler ce fichier, vous devez d'abord installer
% hevea: http://hevea.inria.fr
% giac.tex: http://www-fourier.ujf-grenoble.fr/~parisse/giac/giac.tex
% giacfr.tex: http://www-fourier.ujf-grenoble.fr/~parisse/giac/giacfr.tex
% copier hevea.sty dans le repertoire courant
% ensuite vous pouvez tester avec la commande hevea test
\documentclass[a4paper,11pt]{article}
......@@ -33,6 +33,21 @@
\fi
\input{giacfr.tex}
\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}}
\newtheorem{thm}{Théorème}
......@@ -52,7 +67,7 @@
\makeindex
\title {Exemple de calculs interactifs dans un fichier \LaTeX\ compil\'e
en HTML.}
en HTML et PDF.}
\author{B. Parisse\\Institut Fourier\\UMR 5582 du CNRS
\\Université de Grenoble}
......@@ -60,9 +75,11 @@ en HTML.}
\begin{document}
\begin{giacjsonline}
\begin{giacjshere}
%\loadgiacjs
%\loadgiacjsonline
Un $x$
$$ 1/2 $$
\maketitle
......@@ -73,7 +90,9 @@ en HTML.}
\section{Description}
Ce source \LaTeX\ illustre l'utilisation du moteur de calcul formel Giac
lorsqu'on le compile en HTML avec {\tt hevea} (test\'e avec
\verb|hevea 2.23, 2.25|).
\verb|hevea 2.23, 2.25|). Il est possible de compiler \`a la fois
vers HTML5 et vers PDF en compilant avec {\tt icas} sous linux.
\section{Installation}
Vous devez installer
......@@ -88,11 +107,14 @@ de ce fichier et v\'erifier votre installation en le compilant\\
\verb|hevea testfr|
\section{Utilisation}
La commande \verb|\begin{giacjs}|\index{giacjs} ou \verb|\begin{giacjsonline}|\index{giacjsonline}
doit figurer juste apr\`es \verb|\begin{document}|, selon que l'on va utiliser le moteur
de calcul \verb|giac.js| depuis une installation de Xcas sur le disque dur
ou par t\'el\'echargement sur le serveur de l'Institut Fourier. La
commande correspondante \verb|\end{giacjs}| ou \verb|\end{giacjsonline}|
La commande\verb|\begin{giacjshere}|\index{giacjshere},
\verb|\begin{giacjs}|\index{giacjs} ou \verb|\begin{giacjsonline}|\index{giacjsonline}
doit figurer juste apr\`es \verb|\begin{document}|, selon que l'on va charger le moteur
de calcul \verb|giac.js| de la m\^eme fa\c{c}on que la page HTML,
depuis une installation de Xcas sur le disque dur
ou depuis le serveur de l'Institut Fourier. La
commande correspondante \verb|\end{giacjs}|, \verb|\end{giacjshere}|
ou \verb|\end{giacjsonline}|
doit figurer juste avant \verb|\end{document}|.
Pour que les liens du tableau de bord Table et Index fonctionnent,
vous devez imprimer la table des mati\`eres et l'index au d\'ebut du
......@@ -117,6 +139,13 @@ et ajouter un argument de style\\
\verb|\giaccmdmath[style="width:200px;height:20px;font-size:large"]{factor}{x^4-1}|\\
\giaccmdmath[style="width:200px;height:20px;font-size:large"]{factor}{x^4-1}
Pour cacher le champ de saisie et donner un nom au bouton,
utiliser \verb|\giachidden{}{}|
ou \verb|\giachiddenmath{}{}|
par exemple
\giachidden{factor(x^10-1)}{reponse} ou
\giachiddenmath{factor(x^10-1)}{reponse}
Pour cr\'eer une commande hors-ligne avec r\'eponse en MathML (ou sous forme de graphique 2d)
utilisez \verb|\giacinputbigmath{}| ou
\verb|\giaccmdbigmath{}{}|, ces commandes
......@@ -147,7 +176,12 @@ accepte aussi un argument de style optionnel~:\\
\verb|\giaccmd[style="width:200px;height:20px;font-size:large"]{factor}{x^4-1}|\\
\giaccmd[style="width:200px;height:20px;font-size:large"]{factor}{x^4-1}
La m\^eme chose avec un programme ou tout autre commande de plusieurs lignes
{\bf Attention}, pour toutes ces commandes, il faut remplacer dans le
source latex le signe \verb|<| par
\verb|&lt;| et \verb|>| par \verb|&gt;| sinon ces caract\`eres
sont interpr\'et\'es comme des d\'elimieturs HTML.
La m\^eme chose avec un programme ou une commande de plusieurs lignes
avec \verb|\begin{giacprog}...\end{giacprog}|\index{giacprog}~:
\begin{giacprog}
f(x):={
......@@ -156,19 +190,33 @@ f(x):={
return y;
}
\end{giacprog}
Attention, ne pas utiliser dans un autre environement (itemize, enumerate...).
Ici on peut utiliser les caract\`eres \verb|<| et \verb|>|. Attention, il
ne pas utiliser cet environement dans un autre environement (itemize,
enumerate...).
Si vous souhaitez que le programme soit interpr\'et\'e au chargement
de la page HTML, utilisez \verb|giaconload| au lieu de \verb|giacprog|.
La commande \verb|\giacslider{}{}{}{}{}|
permet de cr\'eer une variable
modifiable par le lecteur \`a la souris et des calculs qui
d\'ependent de cette variable~:\\
\verb|\giacslider{a}{-5}{5}{0.1}{0}{plot(sin(a*x))}|\index{giacslider} \\
\giacslider{a}{-5}{5}{0.1}{0}{plot(sin(a*x))}
\verb|\giacslider{a}{-5}{5}{0.1}{2.3}{plot(x^2+a*x)}|\index{giacslider} \\
\giacslider{a}{-5}{5}{0.1}{2.3}{plot(x^2+a*x)}
Pour cr\'eer un lien utiliser \verb|\giaclink{}|, par
exemple un lien vers Xcas offline~:\\
\verb|\giaclink{http://www-fourier.ujf-grenoble.fr/\%7eparisse/xcasfr.html#+factor(x^4-1)&+a:=idn(3)&}|\index{giaclink}\\
\giaclink{http://www-fourier.ujf-grenoble.fr/\%7eparisse/xcasfr.html#+factor(x^4-1)&+a:=idn(3)&}
\end{giacjsonline}
\section{Postprocessing}
On peut utiliser \verb|hevea --mathjax| du fork
\verb|https://github.com/YannickChevalier/hevea-mathjax|
pour laisser MathJax faire le rendu des formules math\'ematiques.
On peut alors convertir en mathml en utilisant itex2mml
\verb|https://golem.ph.utexas.edu/~distler/blog/itex2MML.html|
Attention, il faut remplacer \verb|\(| et \verb|\)| par \verb|$|,
certains caract\`eres ne sont pas support\'es (par exemple \verb|\ |),
et \verb|\begin{equation}| ou \verb|eqnarray| n'est pas support\'e.
\end{giacjshere}
\end{document}
This diff is collapsed.
This diff is collapsed.