diff options
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs')
-rw-r--r-- | Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs | 959 |
1 files changed, 622 insertions, 337 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs index 13b4bd28869..db5421162a5 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs @@ -14,17 +14,20 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindybasic2(20180610) loaded"); +println("ketcindybasic2(20181024) loaded"); //help:start(); +////%Dispchoice start//// Dispchoice():=( if(islist(Ch), if(!isreal(ChNum),ChNum=1); drawtext(mouse().xy,"Ch="+text(Ch)+" N="+text(ChNum),size->24,color->[0,0,1]); ); ); +////%Dispchoice end//// +////%Datetime start//// Datetime():=( //help:Datetime(); regional(names,dt,tmp); @@ -37,7 +40,9 @@ Datetime():=( tmp=text(tmp_1); tmp=[dt_6+"/"+tmp+"/"+dt_3,dt_4]; ); +////%Datetime end//// +////%Rotatepoint start//// Rotatepoint(point,Theta,ctr):=( //help:Rotatepoint(A,2*pi/3,B); regional(X1,X2,Y1,Y2,Cx,Cy,tmp); @@ -49,7 +54,9 @@ Rotatepoint(point,Theta,ctr):=( Y2=Cy+(X1-Cx)*sin(Theta)+(Y1-Cy)*cos(Theta); [X2,Y2]; ); +////%Rotatepoint end//// +////%Translatepoint start//// Translatepoint(point,mov):=( //help:Translatepoint(A,[2,3]); regional(X1,X2,Y1,Y2,Cx,Cy,tmp); @@ -61,7 +68,9 @@ Translatepoint(point,mov):=( Y2=Y1+Cy; [X2,Y2]; ); +////%Translatepoint end//// +////%Scalepoint start//// Scalepoint(point,ratio,center):=( //help:Scalepoint(A,[3,2],[0,0]); regional(X1,X2,Y1,Y2,Cx,Cy,tmp); @@ -73,7 +82,9 @@ Scalepoint(point,ratio,center):=( Y2=Cy+ratio_2*(Y1-Cy); [X2,Y2]; ); +////%Scalepoint end//// +////%Reflectpoint start//// Reflectpoint(point,symL):=( //help:Reflectpoint(A,B); //help:Reflectpoint(A,[[2,3]]); @@ -100,7 +111,9 @@ Reflectpoint(point,symL):=( ); [X2,Y2]; ); +////%Reflectpoint end//// +////%Rotatedata start//// Rotatedata(nm,plist,Theta):=Rotatedata(nm,plist,Theta,[]); Rotatedata(nm,plist,angle,options):=( //help:Rotatedata("1",["crAB","pt1"],pi/3,[[1,5],"dr,2"]); @@ -161,17 +174,23 @@ Rotatedata(nm,plist,angle,options):=( ); if(Noflg<2, if(isstring(Ltype), - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); - , + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("}");//180722 + ); + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); ); PdL; ); +////%Rotatedata end//// +////%Translatedata start//// Translatedata(nm,plist,mov):=Translatedata(nm,plist,mov,[]); Translatedata(nm,plist,mov,options):=( //help:Translatedata("1",["gr1","pt1"],[1,2]); @@ -224,17 +243,23 @@ Translatedata(nm,plist,mov,options):=( ); if(Noflg<2, if(isstring(Ltype), - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); - , + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("}");//180722 + ); + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); ); PdL; ); +////%Translatedata end//// +////%Scaledata start//// Scaledata(nm,plist,ratioV):=( regional(tmp); tmp=ratioV; //180603from @@ -311,17 +336,23 @@ Scaledata(nm,plist,rx,ry,options):=( ); if(Noflg<2, if(isstring(Ltype), - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); - , + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("}");//180722 + ); + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); ); PdL; ); +////%Scaledata end//// +////%Reflectdata start//// Reflectdata(nm,plist,symL):=Reflectdata(nm,plist,symL,[]); Reflectdata(nm,plist,symL,options):=( //help:Reflectdata("1",["crAB"],[C]); @@ -390,21 +421,29 @@ Reflectdata(nm,plist,symL,options):=( ); if(Noflg<2, if(isstring(Ltype), - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); - , + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("}");//180722 + ); + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); ); PdL; ); +////%Reflectdata end//// +// 180800 revised +////%Mksegments start//// Mksegments():=Mksegments([]); Mksegments(options):=( //help:Mksegments(); - regional(segstr,p,q,r,tmp1,tmp2,tmp3); + regional(ctr,segstr,p,q,r,tmp1,tmp2,tmp3); + ctr=1;//180809 forall(allsegments(),seg, str=text(inspect(seg,"definition")); tmp1=indexof(str,"("); @@ -412,33 +451,38 @@ Mksegments(options):=( tmp3=indexof(str,")"); p=substring(str,tmp1,tmp2-1); q=substring(str,tmp2,tmp3-1); - Listplot([parse(p),parse(q)]); + Listplot("all"+text(ctr),[parse(p),parse(q)]);//180800 + ctr=ctr+1; ); ); +////%Mksegments end//// +// 180809 revised +////%Mkcircles start//// Mkcircles():=Mkcircles([]); Mkcircles(options):=( //help:Mkcircles(): - regional(seg,cir,str,p,q,r,tmp1,tmp2,tmp3,tmp4); + regional(str,ctr,tmp,tmp1,tmp2); + ctr=1; forall(allcircles(),cir, str=text(inspect(cir,"definition")); tmp1=indexof(str,"("); - tmp2=indexof(str,";"); - tmp3=indexof(str,")"); - tmp4=indexof(str,";",tmp2+1); - if(tmp4==0, - p=substring(str,tmp1,tmp2-1); - q=substring(str,tmp2,tmp3-1); - Circledata([parse(p),parse(q)]); + tmp2=indexof(str,")"); + str=substring(str,tmp1,tmp2-1); + tmp=Strsplit(str,";"); + tmp1=parse(tmp_1); tmp2=parse(tmp_2); + if(ispoint(tmp2), + Circledata("all"+text(ctr),[tmp1,tmp2],options); , - p=substring(str,tmp1,tmp2-1); - q=substring(str,tmp2,tmp4-1); - r=substring(str,tmp4,tmp3-1); - Circledata([parse(p),parse(q),parse(r)]); + tmp=cir.radius; + Circledata("all"+text(ctr),[tmp1,tmp1+[tmp2,0]],options); ); + ctr=ctr+1; ); ); +////%Mkcircles end//// +////%MakeRarg start//// MakeRarg(arglist):=( regional(str,tmpstr); str=""; @@ -453,7 +497,9 @@ MakeRarg(arglist):=( str=substring(str,0,length(str)-1); str; ); +////%MakeRarg end//// +////%Setax start//// Setax(arglist):=( //help:Setax(["l","x","e","y","n","O","sw"]); //help:Setax([7,"nw"]); @@ -461,22 +507,59 @@ Setax(arglist):=( tmp=MakeRarg(arglist); Com1st("Setax("+tmp+")"); ); +////%Setax end//// +////%Htickmark start//// Htickmark(arglist):=( //help:Htickmark([1,"1",2,"sw","2"]); - regional(tmp); - tmp=""; - tmp=MakeRarg(arglist); - Com2nd("Htickmark("+tmp+")"); + regional(nn,tmp,tmp1,tmp2,mark); + mark=MARKLEN/SCALEY; + tmp1=select(1..(length(arglist)),!isstring(arglist_#)); //180710from + forall(tmp1,nn, + Listplot("ht"+text(nn), + [[arglist_nn,mark],[arglist_nn,-mark]],["Msg=n"]);//181017 + if(nn+2<=length(arglist), + tmp=arglist_(nn+2); + if(!isstring(tmp), + Expr([[arglist_nn,0],"s1",arglist_(nn+1)]); + , + Expr([[arglist_nn,0],arglist_(nn+1),arglist_(nn+2)]); + ); + , + Expr([[arglist_nn,0],"s1",arglist_(nn+1)]); + ); + );//180710to +// tmp=""; +// tmp=MakeRarg(arglist); +// Com2nd("Htickmark("+tmp+")"); ); +////%Htickmark end//// +////%Vtickmark start//// Vtickmark(arglist):=( //help:Vtickmark([1,"1",2,"sw","2"]); - regional(tmp); - tmp=MakeRarg(arglist); - Com2nd("Vtickmark("+tmp+")"); + regional(nn,tmp,tmp1,tmp2,mark); + mark=MARKLEN/SCALEX; + tmp1=select(1..(length(arglist)),!isstring(arglist_#)); //180710from + forall(tmp1,nn, + Listplot("vt"+text(nn), + [[mark,arglist_nn],[-mark,arglist_nn]],["Msg=n"]); //181021 + if(nn+2<=length(arglist), + tmp=arglist_(nn+2); + if(!isstring(tmp), + Expr([[0,arglist_nn],"w1",arglist_(nn+1)]); + , + Expr([[0,arglist_nn],arglist_(nn+1),arglist_(nn+2)]); + ); + , + Expr([[0,arglist_nn],"w1",arglist_(nn+1)]); + ); + );//180710to// tmp=MakeRarg(arglist); +// Com2nd("Vtickmark("+tmp+")"); ); +////%Vtickmark end//// +////%Vtick start//// Vtick(py):=Vtick(py,MARKLEN,[]); Vtick(py,len):=Vtick(py,len,[]); Vtick(py,len,options):=( @@ -488,7 +571,9 @@ Vtick(py,len,options):=( tmp2=[0+len/2,py]; Listplot(tmp,[tmp1,tmp2],options); ); +////%Vtick end//// +////%Htick start//// Htick(px):=Htick(px,MARKLEN,[]); Htick(px,len):=Htick(px,len,[]); Htick(px,lenorg,options):=( @@ -502,13 +587,28 @@ Htick(px,lenorg,options):=( tmp2=[px,0+len/2]; Listplot(tmp,[tmp1,tmp2],options); ); +////%Htick end//// -Drwxy():=( +////%Drwxy start//// +Drwxy():=Drwxy([]); //180820from +Drwxy(options):=( //help:Drwxy(); - Com2nd("Drwxy()"); +//help:Drwxy(options=["Origin=[0,0]","Xrng=","Yrng=","Ax=l,x,e,..."]); + regional(tmp); + tmp=""; + forall(options, + if(length(tmp)>0, + tmp=tmp+","+Dqq(#); + , + tmp=Dqq(#); + ); + ); + Com2nd("Drwxy("+tmp+")"); //180820to Addax(0); // 16.01.21 ); +////%Drwxy end//// +////%Drwpt start//// Drwpt(pstr):=Drawpoint(pstr); Drwpt(ptlist,nn):=( // 16.03.05 from //help:Drwpt(A); @@ -546,12 +646,16 @@ Drawpoint(ptlistorg,nn):=( ); Setpen(thick); // 16.04.09 );// 16.03.05 until +////%Drwpt end//// +////%Addax start//// Addax(param):=( //help:Addax(0); ADDAXES=textformat(param,5); ); +////%Addax end//// +////%Expr start//// Expr(Pt,Dr,St):=Expr([Pt,Dr,St]); Expr(list):=Expr(list,[]); Expr(listorg,options):=( //16.10.09 @@ -567,7 +671,9 @@ Expr(listorg,options):=( //16.10.09 ); Letter(list,options); ); +////%Expr end//// +////%Letter start//// Letter(Pt,Dr,St):=Letter([Pt,Dr,St]); Letter(list):=Letter(list,[]); Letter(list,options):=( @@ -616,10 +722,14 @@ Letter(list,options):=( Str=replace(Str,"`","'");//180303 tmp=Dq+","+Dq+Str+Dq+")"; if(Noflg==0, - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Com2nd("Letter("+Lcrd(Pos)+","+Dq+Dir+tmp);//16.10.10 - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); - ); + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Com2nd("Letter("+Lcrd(Pos)+","+Dq+Dir+tmp);//16.10.10 + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("}");//180722 + ); + ); if(Noflg<2, Xmv=0;//16.10.13 Ymv=-4; @@ -652,7 +762,9 @@ Letter(list,options):=( Nj=Nj+3; ); ); +////%Letter end//// +////%Letterrot start//// Letterrot(pt,dir,str):=Letterrot(pt,dir,0,0,str,[]); Letterrot(pt,dir,Arg1,Arg2):=( if(islist(Arg2), @@ -662,9 +774,10 @@ Letterrot(pt,dir,Arg1,Arg2):=( ); ); Letterrot(pt,dir,movstr,str,options):=( -//help:Letterrot(C,B-A,"AB"): -//help:Letterrot(C,B-A,0,5,"AB"): -//help:Letterrot(C,B-A,"t0n5","AB"): +// help:Letterrot(C,B-A,"AB"); +// help:Letterrot(C,B-A,0,5,"AB"); +//help:Letterrot(C,B-A,AB",["Size=20"]); +//help:Letterrot(C,B-A,"t0n5","AB"); regional(tmov,nmov,tmp,tmp1,tmp2,color); tmp1=indexof(movstr,"t"); tmp2=indexof(movstr,"n"); @@ -687,11 +800,17 @@ Letterrot(pt,dir,tmov,nmov,str,options):=( color=tmp_(length(tmp)-2); Letter([pt,"c",str],append(options,"notex")); tmp=replace(str,"\","\\"); //17.10.18 - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Com2nd("Letterrot("+pt+","+dir+","+tmov+","+nmov+",'"+tmp+"')"); - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); + if(color!=KCOLOR, //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Com2nd("Letterrot("+pt+","+dir+","+tmov+","+nmov+","+Dqq(tmp)+")");//180805 + if(color!=KCOLOR, //180904 + Texcom("}");//180722 + ); ); +////%Letterrot end//// +////%Exprrot start//// Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str,[]); Exprrot(pt,dir,Arg1,Arg2):=( if(islist(Arg2), @@ -701,9 +820,10 @@ Exprrot(pt,dir,Arg1,Arg2):=( ); ); Exprrot(pt,dir,movstr,str,options):=( -//help:Exprrot(C,B-A,"d"): -//help:Exprrot(C,B-A,0,5,"d"): -//help:Exprrot(C,B-A,"t0n5","d"): +// help:Exprrot(C,B-A,"d"); +// help:Exprrot(C,B-A,0,5,"d"); +//help:Exprrot(C,B-A,"d",["Color=red"]); +//help:Exprrot(C,B-A,"t0n5","d"); regional(tmov,nmov,tmp,tmp1,tmp2,color); tmp1=indexof(movstr,"t"); tmp2=indexof(movstr,"n"); @@ -726,11 +846,17 @@ Exprrot(pt,dir,tmov,nmov,str,options):=( color=tmp_(length(tmp)-2); Expr([pt,"c",str],append(options,"notex")); tmp=replace(str,"\","\\"); //17.10.18 - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Com2nd("Exprrot("+pt+","+dir+","+tmov+","+nmov+",'"+tmp+"')"); - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); + if(color!=KCOLOR, //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Com2nd("Exprrot("+pt+","+dir+","+tmov+","+nmov+","+Dqq(tmp)+")");//180802 + if(color!=KCOLOR, //180904 + Texcom("}");//180722 + ); ); +////%Exprrot end//// +////%Slider start//// Putslider(ptstr,p1,p2):=Slider(ptstr,p1,p2); Slider(ptstr,p1,p2):=( //17.04.11 //help:Slider("A-C-B",[-3,0],[3,0]); @@ -759,7 +885,9 @@ Slider(ptstr,p1,p2):=( //17.04.11 Putonseg(pC,parse("sg"+pA+pB)); // create([pC],"PointOn",[parse(sname),0.5]); ); +////%Slider end//// +////%Putpoint start//// Putpoint(name,Pt):=Putpoint(name,Pt,Pt); Putpoint(name,Ptinit,Pt):=( //help:Putpoint("A",[1,2],[1,A.y]); @@ -772,7 +900,9 @@ Putpoint(name,Ptinit,Pt):=( parse(ptstr); ); ); +////%Putpoint end//// +////%Bezierpt start//// Bezierpt(t,ptlist,ctrlist):=( regional(flg3,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9); p0=ptlist_1; @@ -799,11 +929,15 @@ Bezierpt(t,ptlist,ctrlist):=( p9=(1-t)*p7+t*p8; if(flg3==0,p7,p9); ); +////%Bezierpt end//// +////%Bezier start//// Bezier(ptctrlist):=BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,[]); Bezier(ptctrlist,options):=BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,options); Bezier(nm,ptlist,ctrlist):=BezierCurve(nm,ptlist,ctrlist,[]); Bezier(nm,ptlist,ctrlist,options):=BezierCurve(nm,ptlist,ctrlist,options); +////%Bezier end//// +////%BezierCurve start//// BezierCurve(nm,ptlist,ctrlist):=BezierCurve(nm,ptlist,ctrlist,[]); BezierCurve(nm,ptlistorg,ctrlistorg,options):=( //help:Bezier("1",[A,D],[B,C]); @@ -867,17 +1001,24 @@ BezierCurve(nm,ptlistorg,ctrlistorg,options):=( ); if(Noflg<2, if(isstring(Ltype), - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); - , + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("}");//180722 + ); + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); ); + BezierCtrL=ctrlist; //181001 list; ); +////%BezierCurve end//// +////%Readcsvsla start//// Readcsvsla(fname):=Readplotdigdata(fname,[]); Readcsvsla(fname,options):=Readplotdigdata(fname,options); Readplotdigdata(fname):=Readplotdigdata(fname,[]); @@ -927,7 +1068,9 @@ Readplotdigdata(fname,options):=( ptdata=tmp1; ptdata; ); +////%Readcsvsla end//// +////%Putbezierdata start//// Putbezierdata(name,ptL):=Putbezierdata(name,ptL,[]); Putbezierdata(name,ptL,options):=( regional(psize,Deg,tmp,tmp1,tmp2,p1,p2,pts,ctrs); @@ -991,11 +1134,15 @@ Putbezierdata(name,ptL,options):=( ); [pts,ctrs,name]; ); +////%Putbezierdata end//// +////%Bezierstart start//// Bezierstart(n):=( // 2016.02.26 BezierNumber=n; ); +////%Bezierstart end//// +////%Mkbezierptcrv start//// Mkbezierptcrv(ptdata):=Mkbezierptcrv(ptdata,[]); Mkbezierptcrv(ptdata,options):=( //help:Mkbezierptcrv([A,B,C,D]); @@ -1023,7 +1170,9 @@ Mkbezierptcrv(ptdata,options):=( ); Out; ); +////%Mkbezierptcrv end//// +////%Mkbeziercrv start//// Mkbeziercrv(nm,ptctrL):=Mkbeziercrv(nm,ptctrL,[]); Mkbeziercrv(nm,ptctrL,options):=( //help:Mkbeziercrv("1",[[A,B,C,D],[[P,Q],[R,S],T]]); @@ -1036,7 +1185,9 @@ Mkbeziercrv(nm,ptctrL,options):=( Bezier(nm,ptlist,ctrlist,options); // 17.01.06 ); ); +////%Mkbeziercrv end//// +////%Writebezier start//// Writebezier():=Writebezier(Fhead,"all"); Writebezier(head):=Writebezier(head,"all"); Writebezier(head,seL):=( @@ -1080,7 +1231,9 @@ Writebezier(head,seL):=( WriteOutData(head+".txt",dt); dt; ); +////%Writebezier end//// +////%Readbezier start//// Readbezier(file):=Readbezier(file,[]); Readbezier(file,optionorg):=( //help:Readbezier("xsr"); @@ -1134,10 +1287,13 @@ Readbezier(file,optionorg):=( ); out; ); +////%Readbezier end//// +////%Ospline start//// Ospline(nm,ptlist):=Ospline(nm,ptlist,[]); Ospline(nm,ptlist,options):=( //help:Ospline("1",ptlist,[options]); +//help:Ospline(options=["Num=10"]); regional(tmp,tmp1,tmp2,list,ptL,ctrL,name,closed,flg, p0,p1,p2,p3,pQ,pR,cc,p01,p02,p11,p12,p21,p22,p31,p32); name="o"+nm; @@ -1192,66 +1348,61 @@ Ospline(nm,ptlist,options):=( pQ=p2+(p2-p1); ctrL_tmp=[pQ]; ); - Bezier("o"+nm,list,ctrL,options); + Bezier("o"+nm,list,ctrL,options); ); - +////%Ospline end//// + +////%CRspline start//// CRspline(nm,ptL):=CRspline(nm,ptL,[]); -CRspline(nm,ptL,options):=( +CRspline(nm,ptL,options):=( //180822 // Catmull-Rom spline //help:CRspline("1",[A,B,C,A]); - regional(name,ptlist,ctrpts,eqL,opcindy,c,v,tmp,tmp1,tmp2,ctrlist,cflg); - name="crsp"+nm; - if(MeasureDepth(ptL)==1,tmp=[ptL],tmp=ptL); - ptlist=tmp_1; - if(length(tmp)==1, +//help:CRspline(options=["Num=10"]); + regional(name,Eps,ptlist,cc,nv,pm,p0,p1,p2,p3, + ctrlist,cflg,qq,rr,tmp); + name="CR"+nm; + ptlist=apply(ptL,Lcrd(#)); + Eps=10^(-5); + cflg=0; + if(dist(ptlist_1,ptlist_(length(ptlist)))<Eps, cflg=1; - , - cflg=0; - ctrpts=tmp_2; - ); - c=1/6; - tmp=Divoptions(options); - eqL=tmp_5; - opcindy=tmp_(length(tmp)); // 15.03.05 - forall(eqL, - if(substring(#,0,1)=="R", - tmp2=indexof(#,"="); - c=parse(substring(#,tmp2,length(#))); - ); ); - ptlist=apply(ptlist,Lcrd(#)); // 16.08.16 + cc=1/6; ctrlist=[]; forall(1..(length(ptlist)-1), + p1=ptlist_#; + p2=ptlist_(#+1); + tmp=p2-p1; + nv=[-tmp_2,tmp_1]; + pm=(p1+p2)/2; if(#==1, - if(cflg==0, - tmp1=ctrpts_1; + p3=ptlist_(#+2); + if(cflg==0, + p0=Reflectpoint(p3,[pm,pm+nv]); , - v=ptlist_2-ptlist_(length(ptlist)-1); - tmp1=ptlist_#+c*v; + p0=ptlist_(length(ptlist)-1); ); , - v=ptlist_(#+1)-ptlist_(#-1); - tmp1=ptlist_#+c*v; - ); - if(#==length(ptlist)-1, - if(cflg==0, - tmp2=ctrpts_2; + p0=ptlist_(#-1); + if(#==length(ptlist)-1, + if(cflg==0, + p3=Reflectpoint(p0,[pm,pm+nv]); + , + p3=ptlist_2; + ); , - v=ptlist_2-ptlist_#; - tmp2=ptlist_(#+1)-c*v; + p3=ptlist_(#+2); ); - , - v=ptlist_(#+2)-ptlist_#; - tmp2=ptlist_(#+1)-c*v; ); - tmp=select(options,indexof(text(#),"->")>0); - tmp=append(tmp,"notex"); //15.03.05 - Pointdata(name+text(#),[tmp1,tmp2],tmp); - ctrlist=append(ctrlist,[tmp1,tmp2]); + qq=p1+cc*(p2-p0); + rr=p2+cc*(p1-p3); + ctrlist=append(ctrlist,[qq,rr]); ); - Bezier(nm,ptlist,ctrlist,options); + Bezier(name,ptlist,ctrlist,options); ); +////%CRspline end//// +////%Beziersmooth start//// Beziersmooth(nm,ptL):=Bzspline(nm,ptL,[]); //help:Beziersmooth("1",[A,B,C,A]); Beziersmooth(nm,ptL,options):=Bzspline(nm,ptL,options); @@ -1314,7 +1465,9 @@ Bzspline(nm,ptLorg,options):=( Bezier(nm,ptL,ctrlist,options); [ptL,ctrlist]; ); +////%Beziersmooth end//// +////%Beziersym start//// Beziersym(nm,ptL):=Bzsspline(nm,ptL,[]); Beziersym(nm,ptL,options):=Bzsspline(nm,ptL,options); Bzsspline(nm,ptL):=Bzsspline(nm,ptL,[]); @@ -1365,7 +1518,9 @@ Bzsspline(nm,ptLorg,options):=( Bezier(nm,ptL,ctrlist,options); [ptL,ctrlist]; ); +////%Beziersym end//// +////%Listbspline2bz start//// Listbspline2bz(listorg):=( regional(Eps,list,pcl,ptl,ctrl,k); Eps=10^(-3); @@ -1382,16 +1537,21 @@ Listbspline2bz(listorg):=( ptl=apply(1..(length(pcl)-1),(pcl_#+pcl_(#+1))/2); [ptl,ctrl]; ); +////%Listbspline2bz end//// +////%Bspline start//// Bspline(nm,ctrL):=Bspline(nm,ctrL,[]); Bspline(nm,ctrL,options):=( //help:Bspline("",[A,B,C]); +//help:Bspline(options=["Num=10"]); regional(list,tmp); list=Listbspline2bz(ctrL); tmp=BezierCurve("b"+nm,list_1,list_2,options); tmp; ); +////%Bspline end//// +////%MeetCurve start//// MeetCurve(Crv,Xorg,Yorg):=( regional(Cv,tmp,tmp1,tmp2,X0,Y0,x1,x2,y1,y2,Ylist,Ban,Tate); if(isstring(Crv),Cv=parse(Crv),Cv=Crv); @@ -1453,7 +1613,9 @@ MeetCurve(Crv,Xorg,Yorg):=( tmp=sort(Ylist,abs(#_1-Y0)); [X0,tmp_1]; ); +////%MeetCurve end//// +////%PutonLine start//// PutonLine(name,p1,p2):=PutonLine(name,p1,p2,[]); PutonLine(name,p1org,p2org,options):=( //help:PutonLine("C","sgAB"); @@ -1484,7 +1646,9 @@ PutonLine(name,p1org,p2org,options):=( ); ); ); +////%PutonLine end//// +////%PutonSeg start//// PutonSeg(name,sgstr):=( regional(seg,p1,p2); if(isstring(sgstr),seg=parse(sgstr),seg=sgstr); @@ -1522,10 +1686,13 @@ PutonSeg(name,p1org,p2org,options):=( ); ); ); +////%PutonSeg end//// +////%PutonCurve start//// PutonCurve(pn,crv):=PutonCurve(pn,crv,[]); PutonCurve(pn,crv,options):=( -//help:PutonCurve("A","gr1"); +//help:Putoncurve("A","gr1"); +//help:Putoncurve("A","gr1",[0,XMAX]); regional(Pmt,pstr,optionL,leftlim,rightlim,tmp,tmp1,Flg,Msg); if(!islist(options),optionL=[options],optionL=options); leftlim=XMIN; @@ -1565,7 +1732,9 @@ PutonCurve(pn,crv,options):=( println("Put "+pn+" on Curve "+text(crv)); ); ); +////%PutonCurve end//// +////%CrossPoint start//// CrossPoint(name,Crv1,Crv2,range):=( regional(Mx1,Mx2,Mx3,tmp,Crs1,Crs2,Crs3,Crs4,df1,df2); Mx1=range_1; Mx2=range_2; @@ -1585,32 +1754,36 @@ CrossPoint(name,Crv1,Crv2,range):=( ); Putpoint(name,Crs1); ); +////%CrossPoint end//// -Setscaling(sc):=( -//help:Setscaling(3); - SCALEX=1; - SCALEY=sc; - Com0th("Setscaling("+sc+")"); - Setwindow("Msg=no"); -); - +////%Periodfun start//// Periodfun(defL,rep):=Periodfun(defL,rep,[]); -Periodfun(defL,rep,optionorg):=( // 16.11.24 -//help:Periodfun(["0",[-1,0],"1",1,[0,1],1],2(num of repetition),options); -//help:Periodfun(options=["Con=y"]); +Periodfun(defL,reporg,optionorg):=( // 16.11.24 +//help:Periodfun(["0",[-1,0],1(Num=),"1",[0,1],1(Num)],2(repeat count),options); +//help:Periodfun(repeat count=n or [repeatL,repeatR]); +//help:Periodfun(options=["Con(nect)=da,Color=red"]);//180725 //help:Periodfun(defL=[function string, range, devision number,...]); - regional(nn,fun,range,num,options,nr,maxfun, + regional(nn,fun,range,num,options,nr,maxfun,rep,np, tmp,tmp1,tmp2,eqL,connect,minx,maxx,pdata,Eps,prept); + rep=reporg; + if(length(rep)==1,rep=[rep,rep]);//180724 options=optionorg; - tmp=Divoptions(options); - eqL=tmp_5; - connect="Y"; +// tmp=Divoptions(options); + eqL=options; + connect=["da"];//180725 forall(eqL, - tmp=indexof(#,"="); - tmp2=substring(#,tmp,tmp+1); - tmp=substring(#,0,3); - if(Toupper(tmp)=="CON", - connect=Toupper(tmp2); + tmp=indexof(#,"=");//180725from + tmp=[substring(#,0,tmp-1),substring(#,tmp,length(#))]; + if(Toupper(substring(tmp_1,0,3))=="CON", + println([1658,tmp_2]); + tmp1=Toupper(Op(1,tmp_2)); + if(tmp1=="N", + connect=[]; + , + if(tmp1!="Y", + connect=tokenize(tmp_2,","); + ); + );//180725to options=remove(options,[#]); ); ); @@ -1638,16 +1811,24 @@ Periodfun(defL,rep,optionorg):=( // 16.11.24 "<=x and x<"+tmp2+") then "+fun+" "; ); per=maxx-minx; - forall(1..rep,nr, - tmp1=[]; - forall(pdata, - Translatedata("p"+#+text(nr),#,[per*nr,0],options); - Translatedata("m"+#+text(nr),#,[-per*nr,0],options); - tmp1=concat(tmp1,["trp"+#+text(nr),"trm"+#+text(nr)]); - ); - ); - pdata=concat(pdata,tmp1); - if(connect=="Y", + tmp1=[]; + forall(1..(rep_1),nr, //180724from + forall(reverse(1..(length(pdata))),np, + Translatedata("m"+np+text(nr),pdata_np,[-per*nr,0],options); + tmp1=concat(["trm"+np+text(nr)],tmp1); + ); + ); + tmp2=[]; + forall(1..(rep_2),nr, + forall(1..(length(pdata)),np, + Translatedata("p"+np+text(nr),pdata_np,[per*nr,0],options); + tmp2=concat(tmp2,["trp"+np+text(nr)]); + ); + );//180724to + pdata=concat(tmp1,pdata); + pdata=concat(pdata,tmp2); + if(length(connect)>0, //180725 + connect=append(connect,"Msg=n"); //180725 Eps=10^(-5); pdata=sort(pdata,[parse(#)_1_1]); prept=parse(pdata_1)_1; @@ -1656,7 +1837,7 @@ Periodfun(defL,rep,optionorg):=( // 16.11.24 tmp1=tmp_1; tmp2=tmp_(length(tmp)); if(|prept-tmp1|>Eps, - Listplot("con"+text(#),[prept,tmp1],append(options,"da")); + Listplot("con"+text(#),[prept,tmp1],concat([],connect));//180725 ); prept=tmp_(length(tmp)); ); @@ -1664,7 +1845,9 @@ Periodfun(defL,rep,optionorg):=( // 16.11.24 mxfun=substring(mxfun,4,length(mxfun)-1); [mxfun,per]; ); +////%Periodfun end//// +////%Fourierseries start//// Fourierseries(nm,coeff,per,nterm):= Fourierseries(nm,coeff,per,nterm,[]); // 16.11.24 Fourierseries(nm,coeff,per,nterm,options):=( @@ -1691,7 +1874,9 @@ Fourierseries(nm,coeff,per,nterm,options):=( ); Plotdata("four"+nm,fs,"x",options); ); +////%Fourierseries end//// +////%Tabledatalight start//// Tabledatalight(nm,xLst,yLst,rmvL):=Tabledatalight(nm,xLst,yLst,rmvL,[]); Tabledatalight(nm,xLst,yLst,rmvL,optionorg):=( //help:Tabledatalight("",xLst,yLst,rmvL,[2,"Rng=y"]); @@ -1774,7 +1959,9 @@ Tabledatalight(nm,xLst,yLst,rmvL,optionorg):=( ); Tb; ); +////%Tabledatalight end//// +////%Tabledata start//// Tabledata(nm,n,m,xsize,ysize,rmvL):= Tabledata(nm,n,m,xsize,ysize,rmvL,[]); Tabledata(nm,n,m,xsize,ysize,rmvL,options):=( @@ -1906,7 +2093,9 @@ Tabledata(nm,xLst,yLst,rmvL,optionorg):=( ); Tb; ); +////%Tabledata end//// +////%Tseginfo start//// Tseginfo(seg):=( regional(cr,tp,tpc,n1,n2,n3,tmp,tmp1,tmp2); if(substring(seg,0,2)=="sg", @@ -1928,7 +2117,9 @@ Tseginfo(seg):=( n3=substring(cr,tmp2,length(cr)); [tp+n1,tpc,parse(n2),parse(n3)]; ); +////%Tseginfo end//// +////%Tsegrmv start//// Tsegrmv(rmvL):=Tsegrmv(rmvL,[]); Tsegrmv(rmvL,options):=( regional(cr,gcL,flg,gc,hd,tail,tpc,m1,m2,n1,n2,tmp,tmp1,tmp2); @@ -1972,7 +2163,9 @@ Tsegrmv(rmvL,options):=( ); ); ); +////%Tsegrmv end//// +////%Tgrid start//// Tgrid(ptstr):=( //help:Tgrid("c2r5"); regional(tmp,tmp1,tmp2); @@ -1988,7 +2181,9 @@ Tgrid(ptstr):=( [tb_1_(tmp1+1)_1,tb_2_(tmp2+1)_2]; ); ); +////%Tgrid end//// +////%Tlistplot start//// Tlistplot(ptL):=Tlistplot(ptL,[]); Tlistplot(Ag1,Ag2):=( regional(nm,ptL,options); @@ -2019,7 +2214,9 @@ Tlistplot(nm,ptL,options):=( tmp=apply(ptL,Tgrid(#)); // 15.06.03 Listplot(nm,tmp,tmp1); ); +////%Tlistplot end//// +////%ChangeTablestyle start//// ChangeTablestyle(nameL,style):=( ////help:ChangeTablestyle(["r0c0c3"],["da"]); regional(nmL,grid,head,sb,tmp,tmp1,tmp2, @@ -2074,7 +2271,9 @@ ChangeTablestyle(nameL,style):=( ); ); ); +////%ChangeTablestyle end//// +////%Findcell start//// Findcell(pos1,pos2):=Findcell("",pos1,pos2); Findcell(Tbdata,pos1,pos2):=( //help:Findcell("c0r0","c2r1"); @@ -2102,7 +2301,9 @@ Findcell(Tbdata,pos1,pos2):=( dy=abs(posnw_2-ctr_2); [ctr,dx,dy]; ); +////%Findcell end//// +////%Putcell start//// Putcell(pos1,pos2,dir,lttr):=Putcell("",pos1,pos2,dir,lttr); Putcell(Tbdata,pos1,pos2,dir,lttr):=( //help:Putcell("c0r0","c2r1","lt","abc"); @@ -2138,7 +2339,9 @@ Putcellexpr(Tbdata,pos1,pos2,dir,ex):=( //help:Putcellexpr(2,3,"c","\sin x"); Putcell(Tbdata,pos1,pos2,dir,"$"+text(ex)+"$"); ); +////%Putcell end//// +////%Putrow start//// Putrow(nrow,dir,lttrL):=Putrow("",nrow,dir,lttrL); Putrow(Tbdata,nrow,dir,lttrL):=( //help:Putrow(1,"c",["x","y","z"]); @@ -2148,7 +2351,9 @@ Putrow(Tbdata,nrow,dir,lttrL):=( Putcell(Tbdata,#,nrow,dir,lttrL_#); ); ); +////%Putrow end//// +////%Putrowexpr start//// Putrowexpr(nrow,dir,exL):=Putrowexpr("",nrow,dir,exL); Putrowexpr(Tbdata,nrow,dir,exL):=( //help:Putrowexpr(2,"r",["x","y","z"]); @@ -2156,7 +2361,9 @@ Putrowexpr(Tbdata,nrow,dir,exL):=( lttrL=apply(exL,"$"+#+"$"); Putrow(Tbdata,nrow,dir,lttrL); ); +////%Putrowexpr end//// +////%PutcoL start//// PutcoL(mcol,dir,lttrL):=PutcoL("",mcol,dir,lttrL); PutcoL(Tbdata,mcol,dir,lttrL):=( //help:PutcoL(1,"c",["x","y","z"]); @@ -2166,6 +2373,9 @@ PutcoL(Tbdata,mcol,dir,lttrL):=( Putcell(Tbdata,mcol,#,dir,lttrL_#); ); ); +////%PutcoL end//// + +////%PutcoLexpr start//// PutcoLexpr(mcol,dir,exL):=PutcoLexpr("",mcol,dir,exL); PutcoLexpr(Tbdata,mcol,dir,exL):=( //help:PutcoLexpr(2,"r",["x","y","z"]); @@ -2173,7 +2383,9 @@ PutcoLexpr(Tbdata,mcol,dir,exL):=( lttrL=apply(exL,"$"+#+"$"); PutcoL(Tbdata,mcol,dir,lttrL); ); +////%PutcoLexpr end//// +////%Setrange start//// Setrange():=( //help:Setrange(); SW.xy=Pcrd([XMIN,YMIN]); @@ -2181,146 +2393,9 @@ Setrange():=( drawpoly([Pcrd([XMIN,YMIN]), Pcrd([XMAX,YMIN]), Pcrd([XMAX,YMAX]),Pcrd([XMIN,YMAX])],color->[1,1,1]); ); +////%Setrange end//// -Sciform(list):=( - regional(plotlist,comp,pos,out,out2,nn,strL,flg, - tmp,tmp1,tmp2,tmp3,Nj); - plotlist=Flatten([list]); - out=replace(plotlist_1,".xy",""); - out=replace(out,".x","(1)"); - out=replace(out,".y","(2)"); - if(length(plotlist)==1, - comp=[]; - forall(1..length(out), - comp=append(comp,substring(out,#-1,#)); - ); - out=""; - pos=0; - forall(comp, - if(#!="'", - out=out+#; - , - if(pos==0, - tmp=indexof(out,"Assign("); - if(substring(out,length(out)-7,length(out))=="Assign(", - out=out+"'"; - pos=1; - , - out=out+"Assign('"; - pos=2; - ); - , - if(pos==2, - out=out+"')"; - , - out=out+"'"; - ); - pos=0; - ); - ); - ); - , - forall(2..length(plotlist), - comp=plotlist_#; - if(isstring(comp), - pos=indexof(comp,"Assign("); - if(pos>0, - comp=substring(comp,6,length(comp)); - ); - out=out+"Assign("; - comp=replace(comp,".xy",""); - comp=replace(comp,".x","(1)"); - comp=replace(comp,".y","(2)"); - out=out+"'"+comp+"'"; - out=out+"),"; - ); - if(islist(comp), - forall(comp, - out=out+"'"+#+"',"; - ); - ); - ); - if(length(plotlist)>1, - out=substring(out,0,length(out)-1); - out=out+");"; - ); - ); - pos=[]; - forall(1..length(out), - tmp=indexof(substring(out,#-1,length(out)),"Assign"); - if(tmp>0, - tmp1=#-1+tmp; - if(length(pos)==0, - pos=[tmp1]; - , - if(pos_(length(pos))<tmp1, - pos=append(pos,tmp1); - ); - ); - ); - ); - if(length(pos)>0, - strL=[]; - Nj=0; - forall(pos, - tmp=substring(out,Nj,#-1); - strL=append(strL,tmp); - Nj=#-1; - ); - strL=append(strL,substring(out,Nj,length(out))); - out=""; - forall(strL, - if(indexof(#,"Assign")==0, - out=out+#; - , - tmp=indexof(#,"('"); - tmp1=indexof(#,"')"); - tmp2=substring(#,tmp+1,tmp1-2); - tmp3=substring(#,tmp1-2,length(#)); - if(indexof(tmp2,"=")==0, - out=out+#; - , - tmp=substring(tmp2,0,indexof(tmp2,"=")); - out=out+"'"+tmp+"'+"+"Assign('"; - tmp=substring(tmp2,indexof(tmp2,"="),length(tmp2)); - out=out+tmp+tmp3; - ); - ); - ); - ); - out2=""; // patched 16.01.21 from - nn=length(out); - flg=0; - forall(1..nn, - if(flg==0, - tmp=indexof(out,"='+Assign('"); - if(tmp==0, - out2=out2+out; - flg=1; - , - out2=out2+substring(out,0,tmp); - out=substring(out,tmp+10,length(out)); - tmp=indexof(out,"'"); // 16.04.19 from - tmp1=substring(out,0,tmp-1); - tmp2="1234567890"; - tmp=apply(1..length(tmp1), - indexof(tmp2,substring(tmp1,#-1,#))); - tmp=min(tmp); - if(tmp==0, // 16.04.19 until - out2=out2+"'+Assign('"; - , - tmp=indexof(out,"'"); - out=substring(out,0,tmp)+substring(out,tmp+1,length(out)); - // 16.04.18 until - ); - ); - ); - ); - out2=replace(out2,"Dist=","D="); - out2=replace(out2,"Dis=","D="); - out2; -); - +////%RSform start//// RSform(str):=RSform(str,3); RSform(str,listfrom):=( //help:RSform(string,listfrom); @@ -2356,14 +2431,18 @@ RSform(str,listfrom):=( out=replace(out,"c(2)","[2]"); out; ); +////%RSform end//// +////%RSslash start//// RSslash(str):=( //17.09.24 regional(tmp); tmp=replace(str,"\","\\"); // tmp=replace(tmp,"\\\\","\\"); tmp; ); +////%RSslash end//// +////%Rform start//// Rform(list):=( regional(plotlist,comp,pos,out,strL,tmp,tmp1,tmp2,tmp3,Nj); out=list; @@ -2375,7 +2454,9 @@ Rform(list):=( out=replace(out,".y","[2]"); out; ); +////%Rform end//// +////%Defvar start//// Defvar(varstr):=( regional(name,value,tmp,tmp1); if(isstring(varstr), @@ -2399,7 +2480,6 @@ Defvar(varstr):=( ); // 16.11.16until ); ); - Defvar(name,value):=( //help:Defvar("a",0.3); //help:Defvar(["a",0.3,"b",2]); @@ -2422,32 +2502,52 @@ Defvar(name,value):=( VLIST=select(VLIST,#_1!=name); // 15.02.08 VLIST=prepend([name,value],VLIST); ); +////%Defvar end//// -IftoR(strorg):=( - regional(str,pre,post,sub,ppL,ifstr,out,tmp,tmp1,tmp2); - str=strorg; - ifstr=indexof(str,"if("); - if(ifstr==0, - out=replace(str,",","}else{"); - , - pre=substring(str,0,ifstr-1)+"if("; - ppL=Bracket(str,"()"); - tmp1=ifstr+2; - tmp=select(ppL,#_1==tmp1); - tmp=select(ppL,#_2==-tmp_1_2); - tmp2=tmp_1_1; - sub=substring(str,tmp1,tmp2-1); - post="}"+substring(str,tmp2,length(str)); - tmp=indexof(sub,","); - tmp1=substring(sub,0,tmp-1); - tmp2=substring(sub,tmp,length(sub)); - sub=tmp1+"){"+tmp2; - tmp=IftoR(sub); - out=pre+tmp+"}"; - ); +////%IftoR start//// +IftoR(strorg):=( //180802 + regional(str,ifL,ppL,cpL,kk,sL,out, + tmp,tmp1,tmp2,tmp3,tmp4); + str=replace(strorg,LFmark,""); + ifL=Indexall(str,"if("); + ppL=Bracket(str,"()"); + cpL=Indexall(str,","); + tmp1=Bracket(str,"[]"); + forall(1..(length(tmp1)/2),kk, + cpL=select(cpL,#<tmp1_(2*kk-1)_1%#_1>tmp1_(2*kk)_1); + ); + forall(1..length(ifL),kk, + tmp=select(ppL,#_1>ifL_kk); + tmp1=tmp_1; + tmp2=select(tmp,#_2==-tmp1_2); + tmp2=tmp2_1; + tmp3=select(cpL,#>tmp1_1 & #<tmp2_1); + ifL_kk=[tmp1_1,tmp2_1,tmp1_2,tmp3]; + ); + forall(1..length(cpL),kk, + tmp=select(1..length(ifL),contains(ifL_#_4,cpL_kk)); + tmp1=tmp_(length(tmp)); + cpL_kk=[cpL_kk,tmp1]; + ); + sL=apply(1..length(str),substring(str,#-1,#)); + forall(1..length(ifL),kk, + tmp1=ifL_kk_1; + tmp2=ifL_kk_2; + tmp=select(cpL,#_2==kk); + tmp3=apply(tmp,#_1); + sL_tmp1="("; + sL_tmp2="}"; + sL_(tmp3_1)="){"; + if(length(tmp3)>1, + sL_(tmp3_2)="}else{"; + ); + ); + out=sum(sL); out; ); +////%IftoR end//// +////%FortoR start//// FortoR(strorg):=( regional(str,pre,post,sub,ppL,forstr,out,tmp,tmp1,tmp2); str=strorg; @@ -2478,7 +2578,9 @@ FortoR(strorg):=( out=replace(out,"..",":"); out; ); +////%FortoR end//// +////%Deffun start//// Deffun(name,bodylist):=( //help:Deffun("f(x)",["regional(y)","y=x^2*(x-3)","y"]); regional(funstr,str,Pos,nbody,bdy,ppL,bpL,excma,tmp,tmp1,tmp2); @@ -2527,7 +2629,25 @@ Deffun(name,bodylist):=( str=str+"return("+bodylist_(length(bodylist))+")}"; FUNLIST=append(FUNLIST,str); ); +////%Deffun end//// +////%Inwindow start//// +Inwindow(point):=Inwindow(point,[XMIN,XMAX],[YMIN,YMAX]); +Inwindow(point,xrng,yrng):=( +//help:Inwindow(point); +//help:Inwindow(point,xrange,yrange); + regional(Eps,pt,x,y,xmin,xmax,ymin,ymax,tmp); + Eps=10.0^(-6); + if(ispoint(point),pt=point.xy,pt=point); + x=pt_1; y=pt_2; + xmin=xrng_1; xmax=xrng_2; + ymin=yrng_1; ymax=yrng_2; + tmp=(x>xmin-Eps)&(x<xmax+Eps)&(y>ymin-Eps)&(y<ymax+Eps); + if(tmp,true,false); +); +////%Inwindow end//// + +////%Windispg start//// Windispg():=( regional(Nj,Nk,Dt,Vj,tmp,tmp1,tmp2,opcindy); gsave(); @@ -2541,8 +2661,6 @@ Windispg():=( if(Nj_2<0,tmp1=0,tmp1=Nj_2); if(tmp1<10, forall(Dt,Nk, -// tmp2=apply(Nk,if(ispoint(#),Lcrd(#),#)); -// tmp2=apply(tmp2,Pcrd(#)); tmp2=Nk; // 14.12.04 if(length(Nk)>1, tmp="connect("+textformat(tmp2,5)+ @@ -2558,16 +2676,9 @@ Windispg():=( ); ); ); -// if(ADDAXES=="1", // 16.10.08from -// draw([XMIN,0],[XMAX,0],color->[0,0.2,0]); -// draw([0,YMIIN],[0,YMAX],color->[0,0.2,0]); -// Letter([[XMAX,0],"e","x",[0,YMAX],"n","y"]); -// Letter([[0,0],"sw","O"]); -// ); // 16.10.08until grestore(); layer(0); ); - Windispg(pltdata):=( regional(pdata,Nj,Nk,Dt,tmp,tmp1,tmp2,opcindy); gsave(); @@ -2602,8 +2713,11 @@ Windispg(pltdata):=( grestore(); layer(0); ); +////%Windispg end//// +////%WritetoRS start//// WritetoSci():=WritetoRS(); //17.12.19 +WritetoSci(Arg):=WritetoRS(Arg);//180619 WritetoRS():=WritetoRS(FnameR);// 17.09.17from WritetoRS(Arg):=( regional(string,filename,shch,tmp1,tmp2); @@ -2623,7 +2737,7 @@ WritetoRS(Arg):=( ); ); WritetoRS(filename,shchoice):=( - regional(Plist,Pos,GrL,str,tmp,tmp1,tmp2,cmd); + regional(Plist,Pos,GrL,str,tmp,tmp1,tmp2,cmd,ns,spos,epos); //help:WritetoRS(2); println("Write to R "+filename); Plist=[]; @@ -2670,8 +2784,8 @@ WritetoRS(filename,shchoice):=( );//180409to tmp=replace(Libname,"\","/"); //17.09.24from println(SCEOUTPUT,"source('"+tmp+".r')");//temporary - if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0), - // 17.10.07added + if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0) + %(GPACK=="pict2e"), // 180817 tmp=replace(tmp+"_rep2e","\","/"); println(SCEOUTPUT,"source('"+tmp+".r')"); ); @@ -2763,12 +2877,27 @@ WritetoRS(filename,shchoice):=( println(SCEOUTPUT,#); ); );//180613to - forall(COM2ndlist, - if(indexof(#,"Texcom")==0, //17.09.22 - println(SCEOUTPUT,RSform(#)); + forall(COM2ndlist,cmd, + tmp=substring(cmd,0,4); + if(contains(["Lett","Expr"],tmp), //180721from + tmp1=Indexall(cmd,Dq); + tmp2=length(tmp1)/4; + str=""; ns=0; + forall(tmp2, + spos=tmp1_(4*#-1); epos=tmp1_(4*#); + str=str+RSform(substring(cmd,ns,spos-1)); + str=str+substring(cmd,spos-1,epos); + ns=epos; + ); + str=str+substring(cmd,ns,length(cmd)); + println(SCEOUTPUT,str); , - println(SCEOUTPUT,#); - ); + if(indexof(cmd,"Texcom")==0, + println(SCEOUTPUT,RSform(cmd)); + , + println(SCEOUTPUT,cmd); + ); + ); //180721to ); if(length(GrL)>0, println(SCEOUTPUT," Drwline(GrL)"); @@ -2803,7 +2932,9 @@ WritetoRS(filename,shchoice):=( closefile(SCEOUTPUT); ); //180513to ); +////%WritetoRS end//// +////%Extractdata start//// Extractdata(name):=Extractdata(1,name,[]); Extractdata(Arg1,Arg2):=( if(isstring(Arg1), @@ -2814,7 +2945,7 @@ Extractdata(Arg1,Arg2):=( ); Extractdata(number,name,options):=( //help:ExtractData("ha1"); -//help:ExtractData(1,"ha1"); +// help:ExtractData(1,"ha1"); regional(dlist,tmp,tmp1,tmp2,tmp3,File,Ltype,Noflg,opstr,opcindy,color); tmp=Divoptions(options); Ltype=tmp_1; @@ -2847,17 +2978,23 @@ Extractdata(number,name,options):=( ); if(Noflg<2, if(isstring(Ltype), - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); - , + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("{");Com2nd("Setcolor("+color+")");//180722 + ); + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 + Texcom("}");//180722 + ); + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); ); tmp2; ); +////%Extractdata end//// +////%RemoveOut start//// RemoveOut(pltlist):=( regional(name,tmp,tmp1,tmp2); forall(pltlist,name, @@ -2869,18 +3006,30 @@ RemoveOut(pltlist):=( GOUTLIST=tmp1; ); ); +////%RemoveOut end//// +////%ReadOutData start//// ReadOutData():=ReadOutData(Fnameout); ReadOutData(filename):=ReadOutData("",filename); //16.03.07 -ReadOutData(pathorg,filenameorg):=( +ReadOutData(path,filename):=ReadOutData(path,filename,[]);//181024(2lines) +ReadOutData(pathorg,filenameorg,options):=( //help:ReadOutData(); -//help:Readoutdata(); //help:ReadOutData("file.txt"); -//help:Readoutdata("file.txt"); //help:ReadOutData("/datafolder","file.txt"); -//help:Readoutdata("/datafolder","file.txt"); +//help:ReadOutdata(options=["Disp=n(/y)]"); regional(path,filename,varname,varL,ptL,pts,tmp,tmp1,tmp2,tmp3,tmp4, - nmbr,cmdall,cmd,cmdorg,outdt,goutdt); + nmbr,cmdall,cmd,cmdorg,outdt,goutdt,eqL,dispflg); + dispflg=1; + tmp=Divoptions(options); //181024from + eqL=tmp_5; + forall(eqL, + tmp=Strsplit(#,"="); + tmp1=substring(tmp_1,0,1); tmp1=Toupper(tmp1); + tmp2=substring(tmp_2,0,1); tmp2=Toupper(tmp2); + if(tmp1=="D", + if(tmp2=="N",dispflg=0); + ); + ); //181024to path=pathorg; //16.03.07 from if(length(path)>0, setdirectory(path); @@ -2959,10 +3108,14 @@ ReadOutData(pathorg,filenameorg):=( setdirectory(Dirwork); // 16.03.07 ); print("readoutdata from "+tmp+" : "); - println(varL); + if(dispflg==1, //181024from + println(varL); + ); //181024to varL; ); +////%ReadOutData end//// +////%WriteOutData start//// WriteOutData(filename,ptlist):=( //help:WriteOutData("file.txt",["g1",gr1,"sg",sgAB]); //help:Writeoutdata("file.txt",["g1",gr1,"sg",sgAB]); @@ -3026,7 +3179,9 @@ WriteOutData(filename,ptlist):=( Gstr=substring(Gstr,0,length(Gstr)-1)+"]"; println("writeoutdata "+filename+":"+Gstr); ); +////%WriteOutData end//// +////%Makeshell start//// Makeshell():=( if(length(Texmain)>0, Texparent=Texmain; @@ -3131,7 +3286,9 @@ Makeshell(texmainfile,flow):=( closefile(SCEOUTPUT); setdirectory(Dirwork); ); +////%Makeshell end//// +////%Convsjiswin start//// Convsjiswin(dir,fname,ext):=( //180401 regional(ctr,flg,mx,tmp); mx=200; @@ -3157,7 +3314,9 @@ Convsjiswin(dir,fname,ext):=( //180401 println(tmp+" not converted "+text(flg)); ); ); +////%Convsjiswin end//// +////%Makebat start//// Makebat():=( if(length(Texmain)>0, Texparent=Texmain; @@ -3247,8 +3406,11 @@ Makebat(texmainfile,flow):=( path=""; ); if(indexof(flow,"r")>0, - tmp=Dq+PathR+"\R"+Dq+" --vanilla --slave < execsrc.r";//180514 - // 17.09.14 + if(indexof(Dirwork,"Users")>0, //180917from + tmp=Dq+PathR+"\R"+Dq+" --vanilla --slave < execsrc.r";//180514 + , + tmp=Dq+PathR+"\R"+Dq+" --vanilla --slave < "+Fhead+".r"; + ); //180917to println(SCEOUTPUT,tmp); ); if(tex=="latex" % tex=="platex" % tex=="uplatex", //17.08.13 @@ -3296,7 +3458,9 @@ Makebat(texmainfile,flow):=( ); setdirectory(drive+Dirwork); ); +////%Makebat end//// +////%Addpackage start//// Addpackage(packorg):=( //help:Addpackage("bm"); //help:Addpackage(["bm","enumerate"]); @@ -3316,7 +3480,19 @@ Addpackage(packorg):=( ); ADDPACK=concat(ADDPACK,packL); //17.06.25to ); +////%Addpackage end//// + +////%Usegraphics start//// +Usegraphics(gpack):=( //180817 +//help:Usegrapchics("pict2e"); + if(!contains(ADDPACK,gpack), + Addpackage([gpack]); + ); + GPACK=gpack; +); +////%Usegraphics end//// +////%Viewtex start//// Viewtex():=( regional(texfile,tmp,tmp1,sep); texfile=Fhead+"main"; @@ -3331,13 +3507,15 @@ Viewtex():=( );//17.08.13until ); // 16.06.09until println(SCEOUTPUT,tmp); - if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0) , - //16.11.23,12.16 + if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0) + %(GPACK=="pict2e"), //16.11.23,12.16,180817 if(indexof(PathT,"pdflatex")>0, println(SCEOUTPUT,"\usepackage[pdftex]{pict2e}");//16.11.24 , println(SCEOUTPUT,"\usepackage{pict2e}");//16.12.16 - println(SCEOUTPUT,"\usepackage{luatexja}");//16.12.18 + if(indexof(PathT,"lualatex")>0, //180817 + println(SCEOUTPUT,"\usepackage{luatexja}"); + ); ); tmp=replace(Dirhead,"\","/"); //17.10.30from tmp=replace(tmp,"scripts","tex/latex"); @@ -3394,7 +3572,9 @@ Viewtex():=( ); WritetoRS(2); //17.09.19 ); +////%Viewtex end//// +////%Viewparent start//// Viewparent():=( //17.04.13 if(!isexists(Dirwork,Texparent+".tex"), if(isstring(Texparent), @@ -3414,7 +3594,9 @@ Viewparent():=( //17.04.13 kc(); ); ); +////%Viewparent end//// +////%Makecmdlist start//// Makecmdlist(libname):=( //help:Makecmdlist("ketcindylib"); regional(cmdall,cmd,flg,tmp,tmp1,tmp2,out); @@ -3446,7 +3628,9 @@ Makecmdlist(libname):=( out=out_(2..tmp); out=sort(out); ); +////%Makecmdlist end//// +////%Savecmdlist start//// Savecmdlist(cmdlist,cmdfile):=( SCEOUTPUT=openfile(cmdfile+".cs"); forall(cmdlist, @@ -3454,7 +3638,9 @@ Savecmdlist(cmdlist,cmdfile):=( ); closefile(SCEOUTPUT); ); +////%Savecmdlist end//// +////%Quicksort start//// Quicksort(seq):=( regional(pivot,left,right,out); if(length(seq)<2, @@ -3476,7 +3662,9 @@ Quicksort(seq):=( ); out; ); +////%Quicksort end//// +////%Lessstr start//// Lessstr(st1,st2):=( regional(tmp,tmp1,tmp2,out); tmp=min(length(st1),length(st2)); @@ -3505,7 +3693,9 @@ Lessstr(st1,st2):=( ); out; ); +////%Lessstr end//// +////%Figpdf start//// Figpdf():=Figpdf(Texparent,[]); Figpdf(Arg1):=( if(isstring(Arg1), @@ -3624,7 +3814,9 @@ Figpdf(fnameorg,optionorg):=( ); FigPdfList; ); +////%Figpdf end//// +////%Makehelplist start//// Makehelplist(libname):=( regional(cmdall,cmd,flg,lev,tmp,tmp1,out); tmp=load(libname); @@ -3670,7 +3862,9 @@ Makehelplist(libname):=( ); sort(out); ); +////%Makehelplist end//// +////%Helplist start//// Helplist():=Helplist(Dirlib,["+","+3d"],"helpJ"); // 15.05.22 Helplist(Arg):=( @@ -3726,8 +3920,9 @@ Helplist(dir,files,help):=( ); // 16.12.31until setdirectory(Dirwork); ); +////%Helplist end//// - +////%Help start//// Help():=( forall(HLIST, println(#); @@ -3780,7 +3975,9 @@ Help(strorg):=( if(flg==-1,println(" Help not read in")); if(flg==0,println(" no example")); ); +////%Help end//// +////%Helpkey start//// Helpkey(str):=( regional(tmp,tmp1,tmp2); tmp1=select(HLIST,indexof(#,str)>0); @@ -3800,7 +3997,9 @@ Helpkey(str1,str2):=( Help(tmp); ); ); +////%Helpkey end//// +////%Slidework start//// Slidework():=Slidework(Dirwork); // 16.06.10 Slidework(dirorg):=( //help:Slidework(directory); @@ -3821,7 +4020,16 @@ Slidework(dirorg):=( println(dir+ " not exists"); ); ); +////%Slidework end//// +////%Setslidemargin start//// +Setslidemargin(marginlist):=( // 180908 +//help:Setslidemargin([+5,-10]); + SlideMargin=marginlist; +); +////%Setslidemargin end//// + +////%Setslidepage start//// Setslidepage():=( // 17.03.05 regional(tmp1,tmp2,tmp3); tmp1=["letterc","boxc","framec","shadowc","xpos","size"]; @@ -3848,7 +4056,9 @@ Setslidepage(list):=( // 16.12.22 SlideColorList_3=SlideColorList_2; SlideColorList_6=SlideColorList_5; ); +////%Setslidepage end//// +////%Setslidemain start//// Setslidemain():=( // 17.03.05 regional(tmp1,tmp2,tmp3); tmp1=["letterc","boxc","framec","xpos","size"]; @@ -3874,7 +4084,9 @@ Setslidemain(list):=( // 16.12.22 ); SlideColorList_11=SlideColorList_10; ); +////%Setslidemain end//// +////%Setslidebody start//// Setslidebody():=( // 17.03.05 regional(tmp1,tmp2,tmp3); tmp1=["letterc","style","thindense"]; @@ -3913,7 +4125,9 @@ Setslidebody(str,style,density):=( // 16.12.22,17.01.06,01.08 if(length(style)>0,BodyStyle=style); ThinDense=density;//17.01.08 ); +////%Setslidebody end//// +////%Setslidehyper start//// Setslidehyper():=( 17.12.16from Setslidehyper(["cl=true,lc=blue,fc=blue",125,70,1]); ); @@ -3938,6 +4152,9 @@ Setslidehyper(driverorg,options):=( eqL=tmp_5; reL=tmp_6; stL=tmp_7; + tmp1=select(eqL,length(Indexall(#,"="))>1); //180813from + eqL=remove(eqL,tmp1); + stL=concat(stL,tmp1); //180813to if(length(stL)>0, str=stL_1; , @@ -3957,6 +4174,15 @@ Setslidehyper(driverorg,options):=( tmp1=replace(tmp1,"uc=","urlcolor="); ADDPACK=select(ADDPACK,indexof(#,"hyperref")==0); Addpackage(tmp1+"{hyperref}"); + tmp=indexof(tmp1,"linkcolor=");//180813from + tmp1=substring(tmp1,tmp-1,length(tmp1)); + tmp=indexof(tmp1,"="); + tmp1=substring(tmp1,tmp,length(tmp1)); + tmp=indexof(tmp1,","); + if(length(tmp)>0, + tmp1=substring(tmp1,0,tmp-1); + );//180813to + LinkColor=tmp1; LinkPosH=125; LinkPosV=73;//180524 LinkSize=1; @@ -3981,7 +4207,9 @@ Setslidehyper(driverorg,options):=( );//180524to ); ); //17.12.16to +////%Setslidehyper end//// +////%Settitle start//// Settitle(cmdL):=Settitle("",cmdL,[]); // 180608from Settitle(Arg1,Arg2):=( if(isstring(Arg1), @@ -4054,7 +4282,9 @@ Settitle(titleold,cmdL,options):=( ); TitleCmdL=concat(TitleCmdL,["\end{layer}","","}"]); ); +////%Settitle end//// +////%Maketitle start//// Maketitle():=( if(!isstring(TitleName), //17.04.13from drawtext(mouse().xy,"Settitle not defined", @@ -4065,7 +4295,7 @@ Maketitle():=( ); Maketitle(name):=( //help:Maketitle(); - regional(texfile,texmain,tmp,tmp1,sep); + regional(texfile,texmain,tmp,tmp1,sep,txtfile); texfile=name; texmain=name+"main"; SCEOUTPUT=openfile(texfile+".tex"); @@ -4125,8 +4355,35 @@ Maketitle(name):=( Makeshell(texmain,"tv"); ); kc(); + txtfile=Cindyname()+".txt"; //180815from + if(!isexists(Dircdy,txtfile), + setdirectory(Dircdy); + SCEOUTPUT=openfile(txtfile); + println(SCEOUTPUT,"title::"+name+"//"); + println(SCEOUTPUT,""); + println(SCEOUTPUT,"%%%%%%%%%%%%%%%%//"); + println(SCEOUTPUT,"main::(title)//"); + println(SCEOUTPUT,"\slidepage[m]//"); + println(SCEOUTPUT,""); + println(SCEOUTPUT,"%%%%%%%%%%%%%%%%//"); + println(SCEOUTPUT,"new::(title)//"); + println(SCEOUTPUT,"%repeat=1,para//"); + println(SCEOUTPUT,"\slidepage//"); + println(SCEOUTPUT,""); + println(SCEOUTPUT,"layer::{120}{0}//"); + println(SCEOUTPUT,"%%putnote::s{65}{5}:://"); + println(SCEOUTPUT,"end//"); + println(SCEOUTPUT,""); + println(SCEOUTPUT,"itemize//"); + println(SCEOUTPUT,"item//"); + println(SCEOUTPUT,"end//"); + closefile(SCEOUTPUT); + setdirectory(Dirwork); //180815to + ); ); +////%Maketitle end//// +////%Repeatsameslide start//// Repeatsameslide(repeatflg,sestr,addedL):=( regional(seL,flg1,ss,nn,nrep,tmp,tmp1,tmp2,tmp3,str,j,k); // global RepeatList, SCEOUTPUT, NonThinFlg @@ -4187,7 +4444,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( if(NonThinFlg==0, if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15 if(MiniFlg==0, //180526from - println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}");//17.08.23 + println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}%");//180701 println(SCEOUTPUT,str); println(SCEOUTPUT,"}%"); , @@ -4206,7 +4463,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( ); if(NonThinFlg==1, if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15 - println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}");//17.08.23 + println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}%");//180701 println(SCEOUTPUT,str); , println(SCEOUTPUT,str); @@ -4237,7 +4494,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( if(NonThinFlg==0, if(!contains(["\begi","\end{"],substring(str,0,5)),//180526from if(MiniFlg==0, - tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23 + tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}%";//180701 tmp1=[tmp1,str,"}%"]; , tmp1=[str]; @@ -4255,7 +4512,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( ); if(NonThinFlg==1, if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15 - tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23 + tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}%";//180701 tmp1=[tmp1,str]; , tmp1=[str]; @@ -4283,7 +4540,9 @@ Repeatsameslide(repeatflg,sestr,addedL):=( ); );//16.12.05to ); +////%Repeatsameslide end//// +////%Presentation start//// Presentation(texfile):=Presentation(texfile,texfile); Presentation(texfile,txtfile):=( //help:Presentation(texfile,txtfile); @@ -4429,9 +4688,12 @@ Presentation(texfile,txtfile):=( println(SCEOUTPUT,"\setcounter{ketpicctra}{18}%"); println(SCEOUTPUT,"\if#1m \setcounter{ketpicctra}{1}\fi"); println(SCEOUTPUT,"\hypersetup{linkcolor=black}%"); + println(SCEOUTPUT,"");//180908 println(SCEOUTPUT,"\begin{layer}{118}{0}"); println(SCEOUTPUT,"\putnotee{122}{-\theketpicctra.05}{\small\thepage/\pageref{pageend}}"); - println(SCEOUTPUT,"\end{layer}\hypersetup{linkcolor=blue}}");//189524to + println(SCEOUTPUT,"\end{layer}\hypersetup{linkcolor="+LinkColor+"}"); + println(SCEOUTPUT,"");//180908 + println(SCEOUTPUT,"}");//189524to forall(ADDPACK,// 16.06.09from println(SCEOUTPUT,"\usepackage"+#); );// 16.06.09to @@ -4444,8 +4706,20 @@ Presentation(texfile,txtfile):=( forall(tmp3, println(SCEOUTPUT,#); ); - if(indexof(PathT,"platex")>0,tmp="\ketmarginJ",tmp="\ketmarginE"); // 16.06.09 + if(indexof(PathT,"platex")>0, //180903,180908from + tmp="\setmargin{"+text(25+SlideMargin_1)+"}{"; + tmp=tmp+text(145-SlideMargin_1)+"}{"; + tmp=tmp+text(15+SlideMargin_2)+"}{"; + tmp=tmp+text(100-SlideMargin_2)+"}"; + , + tmp="\setmargin{"+text(20+SlideMargin_1)+"}{"; + tmp=tmp+text(135-SlideMargin_1)+"}{"; + tmp=tmp+text(15+SlideMargin_2)+"}{"; + tmp=tmp+text(100-SlideMargin_2)+"}"; + ); // 180903,180908to + println(SCEOUTPUT,""); println(SCEOUTPUT,tmp); + println(SCEOUTPUT,""); println(SCEOUTPUT,"\ketslideinit"); println(SCEOUTPUT,""); forall(tmp, // 15.07.21 @@ -4571,10 +4845,12 @@ Presentation(texfile,txtfile):=( paradt_4=substring(paradt_4,0,tmp0-1); );//17.01.29until parafiles=select(parafiles,indexof(#,".tex")>0); + parafiles=sort(parafiles); //180627 if(indexof(paradt_4,"\input")==0,paradt_4="\"+paradt_4);//16.12.17 ); if(indexof(paradt_4,"include")>0, parafiles=select(parafiles,indexof(#,".pdf")>0); + parafiles=sort(parafiles); //180627 ); npara=length(parafiles); , @@ -4930,7 +5206,9 @@ Presentation(texfile,txtfile):=( println(SCEOUTPUT,"\end{document}"); closefile(SCEOUTPUT); ); +////%Presentation end//// +////%Mkslides start//// Mkslides():=( regional(sep,parent,texparentorg,tmp,tmp1,tmp2,tmp3,tmp4,flg); tmp4=Fhead; @@ -4994,7 +5272,9 @@ Mkslides():=( Fhead=tmp4; Texparent=texparentorg;//17.04.10 ); +////%Mkslides end//// +////%Mkslidesummary start//// Mkslidesummary():=( // 17.10.26 for R regional(texparentorg); texparentorg=Texparent; @@ -5059,7 +5339,9 @@ Mkslidesummary(inputfile,outputfile,options):=( kc(); Changework(dirworkorg);//17.04.10 ); +////%Mkslidesummary end//// +////%Example start//// Example(exorg):=Example(exorg,""); Example(exorg,suborg):=( //help:Example("Mxfun","diff"); @@ -5085,7 +5367,9 @@ Example(exorg,suborg):=( ); ); ); +////%Example end//// +////%BBdata start//// BBdata():=Bbdata(BBTarget,0); BBdata(fname):=Bbdata(fname,0); // 16.04.09 BBdata(fname,optionorg):=( @@ -5226,6 +5510,7 @@ BBdata(fname,optionorg):=( // setdirectory(Dirwork); tmp2; // 16.04.25 ); +////%BBdata end//// //help:end(); |