From 2dcfe2f07af05124d5ebee4672d67d7eeae7af60 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 3 Feb 2019 22:44:58 +0000 Subject: ketcindy (3feb19) git-svn-id: svn://tug.org/texlive/trunk@49922 c570f23f-e606-0410-a88d-b1316a301751 --- .../scripts/ketcindy/ketlib/ketcindylib3dlogr.txt | 4 + .../scripts/ketcindy/ketlib/ketcindylib3dr.cs | 26 +- .../ketcindy/ketlib/ketcindylibbasic1logr.txt | 31 +- .../scripts/ketcindy/ketlib/ketcindylibbasic1r.cs | 886 ++++++++------ .../ketcindy/ketlib/ketcindylibbasic2logr.txt | 58 + .../scripts/ketcindy/ketlib/ketcindylibbasic2r.cs | 1291 +++++++++++++++----- .../scripts/ketcindy/ketlib/ketcindyliboutlogr.txt | 16 + .../scripts/ketcindy/ketlib/ketcindyliboutr.cs | 228 ++-- .../scripts/ketcindy/ketlib/ketpiccurrent.r | 115 +- .../scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r | 97 +- .../scripts/ketcindy/ketlibC/ketlibClog.txt | 4 + .../texmf-dist/scripts/ketcindy/ketlibC/surflib.h | 90 +- .../scripts/ketcindy/template2allbuttons.cdy | Bin 0 -> 5213 bytes .../texmf-dist/scripts/ketcindy/template2slide.cdy | Bin 5830 -> 0 bytes 14 files changed, 1869 insertions(+), 977 deletions(-) create mode 100644 Master/texmf-dist/scripts/ketcindy/template2allbuttons.cdy delete mode 100644 Master/texmf-dist/scripts/ketcindy/template2slide.cdy (limited to 'Master/texmf-dist/scripts/ketcindy') diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt index 9b60514ba5d..de1caada09d 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt @@ -1,3 +1,7 @@ +// 20190128 +// Vertexedgeface changed ( size of point name, drawpoint ) +// 20190127 +// Nohiddenseg debugged ( for changing Ltype ) // 20181218 // Letter3d,Expr3d added // 20181212 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs index 7f378e9cd87..e4e59151022 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs @@ -14,7 +14,7 @@ // along with this program. If not, see // -println("ketcindylib3d(20181218) loaded"); +println("ketcindylib3d(20190128) loaded"); //help:start(); @@ -625,7 +625,7 @@ Subgraph(name3,opcindy):=( //181029 ); tmp=name+"="+Textformat(sub2d,5); parse(tmp); - GCLIST=append(GCLIST,[name,0,opcindy]); + GCLIST=append(GCLIST,[name,[0,1],opcindy]); //190127 sub2d; ); ////%Subgraph end//// @@ -1189,6 +1189,7 @@ Xyzaxparaname(Xrange,Yrange,Zrange,options):=( ); ////%Xyzax3paraname end//// +////%Datalist3d start//// Datalist3d():=( //help:Datalist3d(); regional(out,tmp,tmp2,tmp3); @@ -1198,7 +1199,9 @@ Datalist3d():=( tmp3=apply(tmp2,replace(#,"2d","3d")); out=tmp3; ); +////%Datalist3d end//// +////%Datalist2d start//// Datalist2d():=( //help:Datalist2d(); regional(out,tmp,tmp2,tmp3); @@ -1208,7 +1211,9 @@ Datalist2d():=( // tmp3=apply(tmp2,replace(#,"2d","3d")); out=tmp2; ); +////%Datalist2d end//// +////%Embed start//// Embed(nm,Pd2str,funstr,varstr):= Embed(nm,Pd2str,funstr,varstr,[]); Embed(nm,Pd2str,funstr,varstr,options):=( @@ -1298,6 +1303,7 @@ Embed(nm,Pd2str,funstr,varstr,options):=( ); Out; ); +////%Embed end//// ////%Rotatepoint3d start//// Rotate3pt(point,w1,w2):=Rotatepoint3d(point,w1,w2,[0,0,0]); @@ -2422,18 +2428,15 @@ IntersectsgpL(name,sgstr,pLstr,optionsorg):=( tmp2=(ss>-Eps)&(ss<1+Eps)&(tt>-Eps)&(tt<1+Eps)&(ss+tt<1+Eps);//181029 out=[pR,tmp1,tmp2,tseg,ss,tt]; //181027to tmp=ptflg_2; - tmp1=(tmp1)%(substring(tmp,0,1)=="e"); //181025from + tmp1=(tmp1)%(substring(tmp,0,1)=="i"); //190114 tmp2=(tmp2)%(substring(tmp,1,2)=="e"); if(tmp1&tmp2&(scrflg=="Y"), //181031 if(ptflg_1=="P", //181025 - Putpoint3d([name,pR]); - Fixpoint3d([name,pR]); + Putpoint3d([name,pR],"fix"); +// Fixpoint3d([name,pR]); //190114 , Drawpoint3d(pR,options); ); -// println(" pt"+name+" data:"+format(out,5)); - , -// println("pt"+name+" data:"+format(out,5)); ); , println(" "+sgstr+" and "+pLstr+" may be parallel");//181025to @@ -2933,7 +2936,8 @@ VertexEdgeFace(nm,vfnLorg,optionorg):=( parse(tmp); Defvar(vname+"2d",parse(vname+"2d")); if(dispflg==1, //181106 - drawtext(parse(vname+"2d"),vname); + drawtext(parse(vname+"2d"),vname,size->8); //190128 + draw(parse(vname+"2d"),pointsize->3,color->[0,1,0]); //190128 ); ); //180905to ); @@ -3385,7 +3389,7 @@ Nohiddenbyfaces(nm,segstr,faceL,vtxL,optionorg,optionsh):=( tmp=replace(seg,"3d","2d"); tmp1=select(GCLIST,#_1==tmp); tmp1=tmp1_1; - if(tmp1_2==0, + if(tmp1_2_1==0, //190127 tmp2=append(tmp2,seg); ); ); @@ -3564,6 +3568,7 @@ Faceremovaldata(nm,vfdata,crvdata,options):=( ); ////%Faceremovaldata end//// +////%Fullformfunc start//// Fullformfunc(FdL):=( regional(Out,nn,ii,Jrg,flg,Urg,Vrg,kk,Uname, Zf,Xname,Xf,Yname,Yf,tmp,tmp1,tmp2); @@ -3647,6 +3652,7 @@ Fullformfunc(FdL):=( tmp=[DrwS,BdyL]; Out=concat(Out,tmp); ); +////%Fullformfunc end//// Surffun(nm,Fd):=( regional(name,coord,var1,var2,rng1,rng2,bdy,tmp,tmp1,tmp2); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt index 813140039fd..ab492956087 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt @@ -1,5 +1,32 @@ -// 20181217 -// Drwxy debugged +/ 20190128 +// Ketinit changed (Userhome added) +// Changesetting majorly changed +// 20190127 +// Mvprod added +// 20190126 +// Pointdata changed ( list of list removed, Ltype) +// 20190125 +// Assign debugged ( for 1 argument) +// Getlinestyle changed ( Ltype) +// 20190122 +// no ketjs added (Ketinit) +// 20190119 +// Getlinestyle changed/debugged (Ltype changed ) +// 20190118 +// Divoptions changed ("dr,thickness" ) +// 20190116 +// Ketinit() debuggded ( Mackc for Linux) +// 20190115 +// Plotdata debugged( ( => [ ) +// Pointdata change( colorcode => colorcmyk2rgb) +// 20190103 +// Paramplot debugged ( "pt" localized ) +// 20181231 +// Pointdata changed ( "Inside=(cmyk list)" option added ) +// Setorigin debugged (GENTEN used) +// 20181230 +// Pointdata changed ( "Inside" option added ) +// Integrate debugged (case of funstr) // 20181216 // Ketinit changed (AXSTYLE changed) // 20181215 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs index a3376741a8d..e473027def3 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs @@ -9,14 +9,14 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// f +// // You should have received a copy of the GNU General Public License // along with this program. If not, see // -println("KeTCindy V.3.2.3(20181216)"); +println("KeTCindy V.3.2.5"); println(ketjavaversion()); -println("ketcindylibbasic1(20181125) loaded"); +println("ketcindylibbasic1[20190131] loaded"); //help:start(); @@ -71,7 +71,7 @@ Ketinit(work,sy,rangex,rangey):=(//181001to KCOLOR=[0,0,0]; GLIST=[]; GCLIST=[]; -// GDATALIST=[]; +// GDATALIST=[]; //no ketjs GOUTLIST=[]; POUTLIST=[]; VLIST=[]; @@ -97,6 +97,8 @@ Ketinit(work,sy,rangex,rangey):=(//181001to ADDPACK=[]; // 16.05.16 GPACK="tpic"; //180817 ErrFlag=0; + KETJSOP=[]; //190129 + // no ketjs on 190122 setdirectory(Dirwork); if(!isstring(Fhead), // 17.10.13from, 17.11.12 Fhead=text(curkernel()); @@ -122,8 +124,8 @@ Ketinit(work,sy,rangex,rangey):=(//181001to Dircdy=substring(Dircdy,1,length(Dircdy)); ); ); - Changesetting(Homehead+pathsep()+getname()); //180913 - Changesetting(Dircdy); //181017 + Userhome=Homehead+pathsep()+getname(); //190128 + Changesetting(); //190128 Changework(Dircdy+pathsep()+work); //180329to,181001 Fnametex=Fhead+".tex"; FnameR=Fhead+".r"; @@ -139,6 +141,7 @@ Ketinit(work,sy,rangex,rangey):=(//181001to Shellparent="/kc.command"; , Shellparent="/kc.sh"; + Mackc="sh"; //190116 ); //181125to if(!isexists(Dirwork,""), println(Dirwork+" not exists"); @@ -152,6 +155,7 @@ Ketinit(work,sy,rangex,rangey):=(//181001to println(setexec(Dirwork,Shellparent)); ); ); +// no ketjs off 190122 ArrowlineNumber=1; // 15.01.05 ArrowheadNumber=1; BezierNumber=1; //15.01.03 @@ -163,6 +167,7 @@ Ketinit(work,sy,rangex,rangey):=(//181001to YMIN=rangey_1/SCALEY; YMAX=rangey_2/SCALEY; Setwindow("Msg=n"); // 16.05.31 +// no ketjs on 190122 // for Presentation letterc=[0.98,0.13,0,0.43]; boxc=[0,0.32,0.52,0]; shadowc=[0,0,0,0.5]; mboxc="yellow"; //17.03.02 regional debugged @@ -173,6 +178,7 @@ Ketinit(work,sy,rangex,rangey):=(//181001to if(indexof(PathT,"pdflatex")+indexof(PathT,"lualatex")>0, LibnameS=replace(LibnameS,"ketpic","ketpic2e"); );//17.12.03until +// no ketjs off 190122 ); ////%Ketinit end//// @@ -250,7 +256,7 @@ Readlines(path,file):=( //help:Readlines(path,file); regional(tmp,out); out=readfile2str(path,file); - out=tokenize(out,"/LF/"); + out=tokenize(out,"/L"+"F/"); //190129 tmp=out_(length(out)); if(length(tmp)==0, out=out_(1..(length(out)-1)); @@ -260,22 +266,22 @@ Readlines(path,file):=( ////%Readlines end//// ////%Changesetting start//// -Changesetting(dir):=( //181017 - regional(fname); - fname="ketcindychange.txt"; - if(!isexists(dir,fname), - if(dir==Dircdy, - fname="ketcindy.conf"; - , - fname=".ketcindy.conf"; - ); +Changesetting():=( //190128 + regional(dir,fname); + dir=Homehead+pathsep()+getname(); + fname=".ketcindy.conf"; + if(isexists(dir,fname), + println("read "+fname+" in "+dir); + setdirectory(dir); + import(fname); ); + dir=Dircdy; fname="ketcindy.conf"; if(isexists(dir,fname), println("read "+fname+" in "+dir); setdirectory(dir); import(fname); ); -); //181017to +); ////%Changesetting end//// ////%Cindyname start//// @@ -308,7 +314,7 @@ Setwindow(str):=( // createpoint("SW",Pcrd([XMIN,YMIN])); // createpoint("NE", Pcrd([XMAX,YMAX])); Putpoint("SW",Pcrd([XMIN,YMIN])); - Putpoint("NE", Pcrd([XMAX,YMAX])); + Putpoint("NE", Pcrd([XMAX,YMAX])); ); if(msg=="y", println("Setwindow(["+XMIN+","+XMAX+"],["+YMIN+","+YMAX+"])"); @@ -373,6 +379,47 @@ DqDq(str):=( ); ////%DqDq end//// +////%PPa start//// 190111 +PPa():=PPa(""); +PPa(str):="("+str+")"; +////%PPa end//// + +////%PaO start//// 190111 +PaO():=PaO(""); +PaO(Arg):=( + regional(out); + if(isstring(Arg), + out="("+Arg; + , + out=""; + repeat(Arg, + out=out+"("; + ); + ); + out; +); +////%PaO end//// + +////%PaC start//// 190111 +PaC():=PaC(""); +PaC(Arg):=( + regional(out); + if(isstring(Arg), + out=Arg+")"; + , + out=""; + repeat(Arg, + out=out+")"; + ); + ); + out; +); +////%PaC end//// + +////%PPa start//// 190111 +PPa(str):="("+str+")"; +////%PPa end//// + ////%Tab2list start//// Tab2list(dtstr):=Tab2list(dtstr,[]); Tab2list(dtstrorg,options):=( @@ -787,7 +834,7 @@ Changework(dirorg,options):=( //16.10.21 , println("Directory "+dir+" not exist, so "+Dqq(Dirwork)+" not changed"); ); //180618to -// println("Directory "+dir+" not exist, so set to "+Dircdy);//180604(2lines) +// println("Directory "+dir+" not exist, so set to "+Dircdy);//180604[2lines] // Dirwork=Dircdy; // ErrFlag=-1; , @@ -826,17 +873,17 @@ Changestyle(nameL,style):=( if(length(tmp)>0, Ltype=Ltypeorg; GCLIST=select(GCLIST,#_1!=name); - COM2ndlist=select(COM2ndlist, - (indexof(#,"("+name)==0)%(indexof(#,"Shade")>0)); // 15.05.23,16.12.13 + COM2ndlist=select(COM2ndlist, //no ketjs + (indexof(#,"("+name)==0)%(indexof(#,"Shade")>0)); // 15.05.23,16.12.13 //no ketjs if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); + ); //no ketjs off Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); + ); //no ketjs off , if(Noflg==1,Ltype=0); ); @@ -864,7 +911,7 @@ Op(n,object):=( // 16.05.25 ////%Op end//// ////%Ptselected start//// -Ptselected():=Isptselected(allpoints());//180711(2lines) +Ptselected():=Isptselected(allpoints());//180711[2lines] Ptselected(ptlist):=Isptselected(ptlist); Isptselected():=Isptselected(allpoints()); //180706 Isptselected(ptlist):=( @@ -1117,19 +1164,15 @@ Sprintf(value,dig):=( ); ////%Sprintf end//// -Assign(str):=( // old - regional(out); - out=str; - forall(VLIST, - tmp=substring(#_1,0,length(#_1)-1); - out=replace(out,tmp,"("+#_2+")"); - ); - out; -); - ////%Assign start//// +Assign(str):=( //190125from + regional(tmp); + tmp=[]; + forall(VLIST,tmp=concat(tmp,[#_1,#_2])); + Assign(str,tmp); +); //190125to Assign(funstr,vrL):=( - regional(nn,out,tmp,tmp1); + regional(nn,out); nn=length(vrL)/2; out=funstr; forall(1..nn, @@ -1137,7 +1180,6 @@ Assign(funstr,vrL):=( ); out; ); - Assign(funstr,varname,rep):=( //help:Assign("x^2+a*x","a",1.3); //help:Assign("a*x^2+b*x",["a",1,"b",2]); @@ -1154,7 +1196,7 @@ Assign(funstr,varname,rep):=( ii=indexof(funstr,varname); if(ii>0, Flg=0; - if(ii>1, + if(ii>1, tmp=substring(funstr,ii-2,ii-1); if(contains(Notvar,tmp), tmp2=tmp2+substring(funstr,0,ii); @@ -1270,7 +1312,7 @@ Divoptions(options):=( tmp1=parse(tmp2); color=tmp1; if(length(tmp1)==4, - tmp1=colorCmyk2Rgb(tmp1); + tmp1=Colorcmyk2rgb(tmp1); ); , tmp1=Colorname2rgb(tmp2); color=tmp1; //181212 @@ -1369,6 +1411,28 @@ Crossprod(a,b):=( ); ////%Crossprod end//// +////%Mvprod start//// +Mvprod(mat,vec):=( //190127 + regional(vecL); + if(MeasureDepth(vec)==0,vecL=[vec],vecL=vec); + Mvprod(mat,vecL,length(vecL)); +); +Mvprod(mat,vecL,nn):=( +//help:Mvprod(mat,vec(list)); + regional(tmp,out); + if(nn==1, + out=mat*vecL_1; + , + out=[]; + forall(1..nn, + tmp=mat*vecL_#; + out=append(out,tmp); + ); + ); + out; +); +////%Mvprod end//// + ////%Ptstart start//// Ptstart(Fig):=( //help:Ptstart("gr1"); @@ -1427,7 +1491,7 @@ Paramoncrv(pP,Gdata):=Paramoncurve(pP,Gdata);//180723 ////%Paramoncrv end//// ////%ParamonCurve start//// ParamonCurve(point,Gdata):=( -//help:ParamonCurve(A,"gr1");//180723(3lines) +//help:ParamonCurve(A,"gr1");//180723[3lines] regional(Tmp,PtL,pP); if(ispoint(point),pP=point.xy,pP=point); // Eps=10^(-8); @@ -1631,7 +1695,7 @@ IntersectcrvsPp(Gr1,Gr2,options):=( Data1=apply(Data1,LLcrd(#)); Data2=apply(Data2,LLcrd(#)); if(length(Data1)==length(Data2), - Tmp1=Reverse(Data2); + Tmp1=reverse(Data2); Eps0=10^(-6); Tmp2=0; forall(1..(length(Data1)), @@ -2046,7 +2110,7 @@ Collectsameseg(ptdL):=( ); gL=[]; tmp=apply(tmp1md,#_4); - dst=min(tmp); + dst=min(tmp); forall(tmp1md, if(#_4value & va2>value) % (va10, ULEN=UI; - GLIST=append(GLIST,"Setunitlen("+Dq+UI+Dq+")");//180513 + GLIST=append(GLIST,"Setunitlen("+Dq+UI+Dq+")");//180513 //no ketjs ); Is=1; VL=""; @@ -2881,14 +2960,15 @@ Setunitlen(UI):=( Setmarklen(ratio):=( //help:Setmarklen(0.2); MARKLEN=ratio*0.2;//16.11.01 - Com2nd("Setmarklen("+textformat(ratio,5)+")"); + Com2nd("Setmarklen("+Textformat(ratio,5)+")"); ); ////%Setmarklen end//// ////%Setorigin start//// Setorigin(point):=( //help:Setorigin([1,2]); - Com2nd("Setorigin("+textformat(point,5)+")"); + GENTEN=point; //181231 + Com2nd("Setorigin("+Textformat(point,5)+")"); ); ////%Setorigin end//// @@ -3065,20 +3145,20 @@ Setcolor(parorg):=( //180603renew cstr=text(par); cstr=substring(cstr,1,length(cstr)-1); if(length(par)==3, - cstr="Texcom('\\color[rgb]{"+cstr+"}')"; + cstr="Texcom('\\color[rgb]{"+cstr+"}')"; //no ketjs KCOLOR=par; ); if(length(par)==4, - cstr="Texcom('\\color[cmyk]{"+cstr+"}')"; - tmp=ColorCmyk2Rgb(par); + cstr="Texcom('\\color[cmyk]{"+cstr+"}')"; //no ketjs + tmp=Colorcmyk2rgb(par); KCOLOR=tmp; ); - Com2nd(cstr); + Com2nd(cstr); //no ketjs ); ////%Setcolor end//// -////%ColorRgb2Cmyk start//// -ColorRgb2Cmyk(clr):=( +////%Colorrgb2cmyk start//// +Colorrgb2cmyk(clr):=( // help:ColorRgb([0.2,0.5,0.1]); regional(clrnew,tmp,black); tmp=apply(clr,1-#); @@ -3091,10 +3171,10 @@ ColorRgb2Cmyk(clr):=( ); //181112to clrnew; ); -////%ColorRgb2Cmyk end//// +////%Colorrgb2cmyk end//// -////%ColorCmyk2Rgb start//// -ColorCmyk2Rgb(clr):=( +////%Colorcmyk2rgb start//// +Colorcmyk2rgb(clr):=( // help:ColorRgb([0.2,0.5,0.1,0.2]); regional(clrnew,tmp,black); black=clr_4; @@ -3102,7 +3182,7 @@ ColorCmyk2Rgb(clr):=( clrnew=tmp_(1..3); clrnew; ); -////%ColorCmyk2Rgb end//// +////%Colorcmyk2rgb end//// ////%Colorrgbhsv start//// Colorrgbhsv(rgb):=( @@ -3215,16 +3295,16 @@ Colorhslrgb(hsl):=( var2 = ( ll + ss ) - ( ss * ll ); ); var1 = 2.0 * ll - var2; - rr = hue2rgb( var1, var2, hh + ( 1.0 / 3.0 ) ); - gg = hue2rgb( var1, var2, hh ); - bb = hue2rgb( var1, var2, hh - ( 1.0 / 3.0 ) ); + rr = Hue2rgb( var1, var2, hh + ( 1.0 / 3.0 ) ); + gg = Hue2rgb( var1, var2, hh ); + bb = Hue2rgb( var1, var2, hh - ( 1.0 / 3.0 ) ); ); [rr,gg,bb]; ); ////%Colorhslrgb end//// -////%Colorhue2rgb start//// -hue2rgb(vv1,vv2,vh):=( +////%Hue2rgb start//// +Hue2rgb(vv1,vv2,vh):=( regional(out); if ( vh < 0.0 ,vh =vh+1); if ( vh > 1.0 ,vh =vh-1); @@ -3243,7 +3323,7 @@ hue2rgb(vv1,vv2,vh):=( ); out; ); -////%Colorhue2rgb end//// +////%Hue2rgb end//// ////%Colorrgbhwb start//// Colorrgbhwb(sL):=( @@ -3365,36 +3445,51 @@ GetLinestyle(str,name):=( noflg=parse(substring(str,0,1)); if(substring(name,0,3)=="sub",subflg=1,subflg=0); // 16.02.29 tmp1=substring(str,1,3); + tmp2=""; //190119from + tmp=indexof(str,","); + if(tmp>0, + tmp2=substring(str,tmp,length(str)); + ); //190119to if(tmp1=="dr" % tmp1=="Dr", - Ltype=0; +// Ltype=0; + if(length(tmp2)==0,tmp2="1"); //190125 + Ltype=[0,tmp2]; //190119 if(noflg==0 & subflg==0, // 16.02.29 Drwline(name+Dop); ); ); if(tmp1=="da" % tmp1=="Da", - Ltype=1; +// Ltype=1; + if(length(tmp2)==0,tmp2="1,1"); //190125 + Ltype=[1,tmp2]; //190119 if(noflg==0 & subflg==0, // 16.02.29 Dashline(name+Dop); ); ); if(tmp1=="id" % tmp1=="Id", - Ltype=2; // 15.11.09 +// Ltype=2; // 15.11.09 + if(length(tmp2)==0,tmp2="1,1"); //190125 + Ltype=[2,tmp2]; //190119 if(noflg==0 & subflg==0, // 16.02.29 Invdashline(name+Dop); ); ); if(tmp1=="do" % tmp1=="Do", - Ltype=3; +// Ltype=3; + if(length(tmp2)==0,tmp2="1,1"); //190125 + Ltype=[3,tmp2]; //190119 if(noflg==0 & subflg==0, // 16.02.29 Dottedline(name+Dop); ); ); if(tmp1=="dp" % tmp1=="Dp", - Ltype=0; +// Ltype=0; + if(length(tmp2)==0,tmp2="1"); //190125 + Ltype=[0,tmp2]; //190119 tmp1=parse(name); tmp2=""; forall(tmp1, - tmp2=tmp2+textformat(#_1,5)+","; + tmp2=tmp2+Textformat(#_1,5)+","; ); tmp2=substring(tmp2,0,length(tmp2)-1); if(noflg==0, @@ -3439,7 +3534,7 @@ Chunderscore(str):=( ); if(indexof(str,"]")>0, tmp1=replace(tmp1,",]",")"); - tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"[","list"+PaO()); , tmp1=substring(tmp1,0,length(tmp1)-1); ); @@ -3480,11 +3575,11 @@ AddGraph(nm,pltdata,options):=( pdata=tmp1; if(Noflg<3, println("generate addgraph "+name); - tmp=name+"="+textformat(pdata,5); + tmp=name+"="+Textformat(pdata,5); parse(tmp); if(isstring(pltdata), // 16.04.04 from if(indexof(pltdata,"]")>0, - tmp1="list(Listplot("+substring(pltdata,1,length(pltdata)); + tmp1="list"+PaO()+"Listplot"+PaO()+substring(pltdata,1,length(pltdata)); tmp1=replace(tmp1,"]",",]"); , tmp1="Listplot("+substring(pltdata,0,length(pltdata))+",]"; @@ -3513,37 +3608,37 @@ AddGraph(nm,pltdata,options):=( if(indexof(pltdata,"[")>0, tmp1=tmp1+")"; ); - GLIST=append(GLIST,name+"="+tmp1); + GLIST=append(GLIST,name+"="+tmp1); //no ketjs , if(MeasureDepth(pdata)==1, - tmp1=name+"=Listplot("+textformat(pdata,5)+")"; + tmp1=name+"=Listplot("+Textformat(pdata,5)+")"; , - tmp1="list("; + tmp1="list"+PaO(); forall(1..(length(pdata)), - tmp=name+"p"+textformat(#,5)+"="; + tmp=name+"p"+Textformat(#,5)+"="; if(length(pdata_#)>1, // 15.01.22 - tmp=tmp+"Listplot("+textformat(pdata_#,5)+")"; + tmp=tmp+"Listplot("+Textformat(pdata_#,5)+")"; , - tmp=tmp+"Pointdata("+textformat(pdata_#_1,5)+")"; + tmp=tmp+"Pointdata("+Textformat(pdata_#_1,5)+")"; ); - GLIST=append(GLIST,tmp); - tmp1=tmp1+name+"p"+textformat(#,5)+","; + GLIST=append(GLIST,tmp); //no ketjs + tmp1=tmp1+name+"p"+Textformat(#,5)+","; ); tmp1=name+"="+substring(tmp1,0,length(tmp1)-1)+")"; ); - GLIST=append(GLIST,tmp1); + GLIST=append(GLIST,tmp1); //no ketjs ); ); // 16.04.04 until if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); + ); //no ketjs off Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -3600,7 +3695,7 @@ Joincrvs(nm,plotstrL,options):=( pS=Ptstart(PtL); pQ=Ptstart(Qd); pR=Ptend(Qd); - rMN=min([|pP-pQ|,|pP-pR|,|pS-pQ|,|pS-pR|]); + rMN=min([|pP-pQ|,|pP-pR|,|pS-pQ|,|pS-pR|]); if(rMN==|pP-pR|, Qd=reverse(Qd); , @@ -3624,25 +3719,25 @@ Joincrvs(nm,plotstrL,options):=( if(Noflg<3, println("generate joincurve "+name); tmp1=apply(PtL,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); tmp1=""; forall(plotstrL, tmp1=tmp1+#+","; ); tmp1=substring(tmp1,0,length(tmp1)-1); - GLIST=append(GLIST,name+"=Joincrvs("+tmp1+")"); + GLIST=append(GLIST,name+"=Joincrvs("+tmp1+")"); //no ketjs ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //181020 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -3680,7 +3775,7 @@ Partcrv(nm,pA,pB,PkLstr,options):=( Out2=Partcrv("",1,pB,PkLstr,["nodata"]); tmp=Ptstart(PkL)-Ptend(PkL); if(|tmp|0, - forall(eqL, - tmp=Strsplit(#,"="); - tmp1=Toupper(substring(tmp_1,0,1)); - tmp2=Toupper(substring(tmp_2,0,1)); - if(tmp1=="S", - size=tmp2; - opcindy=opcindy+",size->"+text(size); //181013 - ); - if(tmp1=="D", //181030from - dispflg=tmp2; - ); + inside=color; + forall(eqL, + tmp=Strsplit(#,"="); + tmp1=Toupper(substring(tmp_1,0,1)); + if(tmp1=="S", + size=Toupper(substring(tmp_2,0,1));; + opcindy=opcindy+",size->"+text(size); //181013 + ); + if(tmp1=="D", //181030from + dispflg=Toupper(substring(tmp_2,0,1)); ); + if(tmp1=="I", //181229from + if(contains(["","no"],tmp_2), + if(tmp_2=="no",inside=append(inside,-1)); + , + tmp2=substring(tmp_2,0,1); + if(contains(["-","0","1",".","["],tmp2), + tmp=parse(tmp_2); + if(length(tmp)==4,tmp=Colorcmyk2rgb(tmp)); //190115 + if(!isstring(tmp),tmp=[tmp]); + , + tmp=Colorname2rgb(tmp_2); + ); + inside=concat(inside,tmp); + ); + ); //181229to ); if(dispflg=="Y", println("generate pointdata "+name); ); //181030to - if(isstring(listorg),list=parse(listorg),list=listorg); //17.10.23 + if(isstring(listorg), + list=parse(listorg) + , + list=listorg + ); //17.10.23 if(MeasureDepth(list)==0,list=[list]);//180530 tmp=MeasureDepth(list); - if(tmp>0, // 2015.02.21 - if(tmp==1,ptlist=list,ptlist=list_1); - tmp=apply(ptlist,[textformat(Pcrd(#),5)]); - tmp1=text(tmp); - tmp2=substring(tmp1,1,length(tmp1)-1); - tmp3=tmp1; - , - ptlist=list; - tmp1=textformat(Pcrd(ptlist),5); - tmp2=tmp1; - tmp3="["+tmp1+"]"; - ); + if(tmp==1,ptlist=list,ptlist=list_1); //190126from + tmp=apply(ptlist,[Textformat(Pcrd(#),5)]); + tmp1=text(tmp); + tmp2=substring(tmp1,1,length(tmp1)-1); + tmp3=tmp1; tmp=name+"="+tmp1; parse(tmp); tmp=nameL+"="+tmp3; - parse(tmp); + parse(tmp); //190126to if(Noflg<3, if(isstring(listorg), //17.10.23 tmp2=listorg; , - tmp2="list("; //17.10.10from + tmp2="list"+PaO(); //17.10.10from forall(list, if(isstring(#), tmp=#; , - if(ispoint(#),tmp=text(#),tmp=textformat(#,6)); + if(ispoint(#), + tmp=text(#); + , + tmp=Textformat(#,6); + ); ); tmp2=tmp2+tmp+","; ); - tmp2=substring(tmp2,0,length(tmp2)-1)+")"; //17.10.10until + tmp2=substring(tmp2,0,length(tmp2)-1)+")"; + //17.10.10until ); - GLIST=append(GLIST,name+"=Pointdata("+tmp2+")"); + GLIST=append(GLIST,name+"=Pointdata("+tmp2+")"); //no ketjs ); if(Noflg<2, - tmp=[nameL,0,opcindy]; + tmp=[nameL,[0,1],opcindy]; //190126 GCLIST=append(GCLIST,tmp); if(Noflg==0, if(length(size)>0, @@ -3838,17 +3951,20 @@ Pointdata(nm,listorg,options):=( if(length(size)>0,tmp1=parse(size),tmp1=1); tmp1=max(tmp1,1)/8; Setpen(tmp1); // 16.04.09 until - if((Noflg==0)&(color!=KCOLOR), //181020 - Texcom("{");Com2nd("Setcolor("+color+")");//180711 - ); - Com2nd("Drwpt(list("+name+")"+opstr+")"); - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on + Texcom("{"); + Com2nd("Setcolor("+color+")");//180711 + ); //no ketjs off + opstr=","+Textformat(inside,2); + Com2nd("Drwpt"+PaO()+"list"+PaO()+name+")"+opstr+")"); + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("}");//180711 - ); + ); //no ketjs off Setpen(thick); // 16.04.09 - if(length(size)>0, - Com2nd("Setpt("+textformat(TenSize/TenSizeInit,1)+")"); - ); + if(length(size)>0, //no ketjs on + tmp=Textformat(TenSize/TenSizeInit,1); + Com2nd("Setpt("+tmp+")"); + ); //no ketjs off ); ); ptlist; @@ -3856,6 +3972,23 @@ Pointdata(nm,listorg,options):=( ////%Pointdata end//// ////%Listplot start//// +Listplot(list):=Listplot(list,[]); +Listplot(Arg1,Arg2):=( + regional(name,list,options,str); + if(isstring(Arg1), + name=Arg1; + list=Arg2; + Listplot(name,list,[]); + , + list=Arg1; + options=Arg2; + name=""; + forall(list, // 16.10.07from + name=name+#.name; + );// 16.10.07until + Listplot(name,list,options); + ); +); Listplot(nm,list,options):=( //help:Listplot([A,B]); // help:Listplot(["A","B"]); @@ -3866,7 +3999,7 @@ Listplot(nm,list,options):=( name=substring(nm,1,length(nm)); , name="sg"+nm; - ); // until + ); // upto tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; @@ -3877,7 +4010,7 @@ Listplot(nm,list,options):=( cutend=[0,0];//180719 forall(eqL, tmp=Strsplit(#,"="); - tmp1=Toupper(substring(tmp_1,0,1)); + tmp1=Toupper(substring(tmp_1,0,1)); tmp2=tmp_2; if(tmp1=="M", tmp=Toupper(substring(tmp2,0,1)); @@ -3904,19 +4037,19 @@ Listplot(nm,list,options):=( ptlist_1=ptlist_1+tmp*cutend_1; ptlist_(length(ptlist))=ptlist_(length(ptlist))-tmp*cutend_2; );//180719to - tmp=name+"="+textformat(ptlist,5); + tmp=name+"="+Textformat(ptlist,5); parse(tmp); - GLIST=append(GLIST,name+"=Listplot("+textformat(ptlist,5)+")"); // 180719 + GLIST=append(GLIST,name+"=Listplot("+Textformat(ptlist,5)+")"); // 180719 //no ketjs ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180711 - ); + ); //no ketjs off Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("}");//180711 - ); + ); //no ketjs off , if(Noflg==1,Ltype=0); ); @@ -3925,23 +4058,6 @@ Listplot(nm,list,options):=( tmp1=apply(list,Lcrd(#)); tmp1; ); -Listplot(Arg1,Arg2):=( - regional(name,list,options,str); - if(isstring(Arg1), - name=Arg1; - list=Arg2; - Listplot(name,list,[]); - , - list=Arg1; - options=Arg2; - name=""; - forall(list, // 16.10.07from - name=name+#.name; - );// 16.10.07until - Listplot(name,list,options); - ); -); -Listplot(list):=Listplot(list,[]); ////%Listplot end//// ////%Lineplot start//// @@ -3977,20 +4093,20 @@ Lineplot(nm,list,options):=( if(Noflg<3, println("generate Lineplot "+name); tmp1=apply(Out,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - GLIST=append(GLIST,name+"=Lineplot("+textformat(list,5)+opstr+")"); + GLIST=append(GLIST,name+"=Lineplot("+Textformat(list,5)+opstr+")"); //no ketjs ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); + ); //no ketjs off Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -4049,7 +4165,7 @@ Plotdata(name1,func,variable,options):=( if(substring(#,0,1)=="E", if(substring(tmp1,0,1)=="[", //180817from Ec=parse(tmp1); - tmp1=replace(tmp1,"[","c("); + tmp1=replace(tmp1,"[","c"+PaO()); tmp1=replace(tmp1,",",".0,"); tmp1=replace(tmp1,"]",".0)"); opstr=opstr+","+Dqq("Exc="+tmp1); //180817to @@ -4084,7 +4200,7 @@ Plotdata(name1,func,variable,options):=( PdL=[]; Ke=1; forall(0..Num, - xx=x1+#*(x2-x1)/Num; // differs from Scilab ( / Num-1) + xx=x1+#*(x2-x1)/Num; // differs from Scilab [ / Num-1] if(length(Exfun)>0, tmp=parse(Exfun); if(abs(tmp)0)&(ctr<1000), ctr=ctr+1; - qd=PlotL_(length(PlotL)); + qd=PlotL_(length(PlotL)); ah=qd_1; ao=qd_(length(qd)); flg=0; forall(1..(length(vL)),jj, @@ -4416,7 +4532,7 @@ Connectseg(Pdata):=( tmp1=Pdata_(vL_jj); pp=tmp1_1; qq=tmp1_(length(tmp1)); if(Norm(pp-ao)0, qd=concat(qd,tmp); ); @@ -4560,7 +4676,7 @@ Implicitplot(name1,func,xrng,yrng,optionsorg):=( xval1=xval2; eval11=eval21; eval12=eval22; - if(length(qL)==2, + if(length(qL)==2, out=append(out,qL); ); ); @@ -4583,21 +4699,21 @@ Implicitplot(name1,func,xrng,yrng,optionsorg):=( tmp1=append(tmp1,apply(tmp2,Pcrd(#))); ); ); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp=name+"=Implicitplot('"+func+"','"+xrng+"','"+yrng+"'"+opstr+")"; - GLIST=append(GLIST,tmp); + tmp=name+"=Implicitplot('"+func+"','"+xrng+"','"+yrng+"'"+opstr+")"; //no ketjs + GLIST=append(GLIST,tmp); //no ketjs ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //181020 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -4688,9 +4804,9 @@ Circledata(nm,cenrad,options):=( if(Noflg<3, println("generate Circledata "+name); tmp1=apply(Out,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - if(length(cenrad)==2, + if(length(cenrad)==2, //no ketjs on tmp=name+"=Circledata("+cenrad+opstr+")"; , if(ra>0, @@ -4699,18 +4815,18 @@ Circledata(nm,cenrad,options):=( tmp=name+"=Lineplot("+cenrad_1+","+cenrad_2+")"; ); ); - GLIST=append(GLIST,tmp); + GLIST=append(GLIST,tmp); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //181020 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -4790,20 +4906,20 @@ Framedata(nm,list,optionsorg):=( if(Noflg<3, println("generate Framedata "+name); tmp1=apply(Out,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - GLIST=append(GLIST,name+"=Framedata("+pA+","+dx+","+dy+")"); + GLIST=append(GLIST,name+"=Framedata("+pA+","+dx+","+dy+")"); //no ketjs ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //181020 + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //181020 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -4826,20 +4942,20 @@ Framedata(nm,cent,dx,dy,options):=( if(Noflg<3, println("generate Framedata "+name); tmp1=apply(Out,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - GLIST=append(GLIST,name+"=Framedata("+cent.xy+","+dx+","+dy+")"); + GLIST=append(GLIST,name+"=Framedata("+cent.xy+","+dx+","+dy+")"); //no ketjs ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -4906,28 +5022,28 @@ Ovaldata(nm,Pdata,options):=( if(Noflg<3, println("generate Ovaldata "+name); tmp1=apply(Graph,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - GLIST=append(GLIST, - name+"=Ovaldata("+Ctr+","+Dx+","+Dy+opstr+")");//16.01.30 + GLIST=append(GLIST, //no ketjs + name+"=Ovaldata("+Ctr+","+Dx+","+Dy+opstr+")");//16.01.30 //no ketjs ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); tmp1=apply(Graph,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp=textformat(Ctr,5)+","+textformat(Dx,5)+","+textformat(Dy,5); + tmp=Textformat(Ctr,5)+","+Textformat(Dx,5)+","+Textformat(Dy,5); ); Graph; ); @@ -5035,7 +5151,7 @@ Parabolaplot(nm,ptlist,rng,options):=( tmp=tmp+"+("+format(tmp2,5)+")"; tmp1=parse(rng); tmp1=[pA_1-(tmp1_2-tmp1_1)/2,pA_1+(tmp1_2-tmp1_1)/2]; - tmp2="x="+textformat(tmp1,5); + tmp2="x="+Textformat(tmp1,5); Plotdata(nm+"para",tmp,tmp2,append(options,"nodisp")); Rotatedata(nm+"para","gr"+nm+"para",angle,append(options,pB)); ); @@ -5194,7 +5310,7 @@ println([4573,ptlist]); tmp=angle+#*2*pi/number; tmp1=pA+rr*[cos(tmp),sin(tmp)]; if(#>0 & #0, parse(Bname); ); if(Noflg<3, println("generate anglemark "+name+" and "+Bpos); tmp1=apply(Out,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp=textformat(plist,5); + tmp=Textformat(plist,5); //no ketjs on tmp1=substring(tmp,1,length(tmp)-1); tmp=name+"=Anglemark("+tmp1+opstr+")"; - GLIST=append(GLIST,tmp); + GLIST=append(GLIST,tmp); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -5690,7 +5806,7 @@ Paramark(Arg1,Arg2):=( // 17.03.27 from , plist=Arg1; options=Arg2; - tmp=textformat(plist,5); + tmp=Textformat(plist,5); tmp=replace(tmp,",",""); nm=substring(tmp,1,length(tmp)-1); Paramark(nm,plist,options); @@ -5738,29 +5854,29 @@ Paramark(nm,plist,options):=( Out=append(Out,pA+ra*(pC-pA)/|pC-pA|); if(length(Bname)>0, tmp1=pA+Brat*ra*(pB-pA)/|pB-pA|+Brat*ra*(pC-pA)/|pC-pA|; - tmp="Defvar("+Dq+Bpos+"="+textformat(tmp1,5)+Dq+");"; + tmp="Defvar("+Dq+Bpos+"="+Textformat(tmp1,5)+Dq+");"; parse(tmp); - parse(Bname); + parse(Bname); ); if(Noflg<3, println("generate paramark "+name); tmp1=apply(Out,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp1=substring(textformat(plist,5),1,length(textformat(plist,5))-1); + tmp1=substring(Textformat(plist,5),1,length(Textformat(plist,5))-1); //no ketjs on tmp=name+"=Paramark("+tmp1+opstr+")"; - GLIST=append(GLIST,tmp); + GLIST=append(GLIST,tmp); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -5791,7 +5907,7 @@ Bowdata(plist):=Bowdata(plist,[]); Bowdata(plist,options):=( regional(nm,tmp); if(islist(plist), // 16.12.04from - tmp=textformat(plist,5); + tmp=Textformat(plist,5); tmp=replace(tmp,",",""); nm=substring(tmp,1,length(tmp)-1); Bowdata(nm,plist,options); @@ -5854,9 +5970,9 @@ Bowdata(nm,plist,options):=( ra=Ydata_2; Th=(Ydata_3+Ydata_4)*0.5; BOWMIDDLE=[pC_1+ra*cos(Th),pC_2+ra*sin(Th)]; - Bpos="md"+name; // 16.10.31from(moved) - tmp="Defvar("+Dq+Bpos+"="+textformat(BOWMIDDLE,5)+Dq+");"; - parse(tmp);// 16.10.31until(moved) + Bpos="md"+name; // 16.10.31from[moved] + tmp="Defvar("+Dq+Bpos+"="+Textformat(BOWMIDDLE,5)+Dq+");"; + parse(tmp);// 16.10.31to[moved] if(length(Bname)>0, //16.11.01from tmp=indexof(Bops,","); if(tmp>0, @@ -5892,7 +6008,7 @@ Bowdata(nm,plist,options):=( Bname=Bname+","; if(indexof(Bname,"rot")>0, if(rev==1,tmp=pB-pA,tmp=pA-pB); - Bname=Bname+textformat(tmp,5)+","; + Bname=Bname+Textformat(tmp,5)+","; , Bname=Bname+Dq+"c"+Dq+","; ); @@ -5927,27 +6043,27 @@ Bowdata(nm,plist,options):=( if(Noflg<3, println("generate bowdata "+name+" and "+Bpos);//16.10.31 if(MeasureDepth(Out)==1,Out=[Out]); - tmp1=[]; + tmp1=[]; forall(Out,tmp2, tmp=apply(tmp2,Pcrd(#)); tmp1=append(tmp1,tmp); ); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp1=substring(textformat(plist,5),1,length(textformat(plist,5))-1); + tmp1=substring(Textformat(plist,5),1,length(Textformat(plist,5))-1); //no ketjs on tmp=name+"=Bowdata("+tmp1+opstr+")"; - GLIST=append(GLIST,tmp); + GLIST=append(GLIST,tmp); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 - Texcom("}");//180722 - ); - , + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on + Texcom("}");//180722 + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -6082,7 +6198,7 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06 ); rng=rngorg; if(indexof(rng,"=")==0, - rng=rng+"="+textformat([XMIN,XMAX],6); + rng=rng+"="+Textformat([XMIN,XMAX],6); ); deq=deqorg; deq=replace(deq,"'","`"); //180527 @@ -6137,33 +6253,33 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06 deq=deq+"]"; ); if(Noflg<3, - pdL=deqdata(deq,rng,initt,initf,Num); + pdL=Deqdata(deq,rng,initt,initf,Num); if(phase==1, pdL=apply(pdL,#_(2..3)); ); tmp1=apply(pdL,Pcrd(#)); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); ); - if(Noflg<1, + if(Noflg<1, //no ketjs on tmp=Assign(deq); tmp=replace(deq,"'","`"); tmp=name+"=Deqplot('"+tmp+"','"+rng+"',"; - tmp=tmp+format(initt,6)+","+textformat(initf,6); + tmp=tmp+format(initt,6)+","+Textformat(initf,6); tmp=tmp+","+text(sel)+",'Num="+text(Num)+"')"; tmp=RSform(tmp); GLIST=append(GLIST,tmp); - ); + ); //no ketjs off if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -6194,7 +6310,7 @@ EnclosingS(nm,plist,options):=( Start=[]; Flg=0; forall(realL, - if(isList(#) % ispoint(#), + if(islist(#) % ispoint(#), Start=Lcrd(#); // 15.09.12 , Flg=Flg+1; @@ -6305,26 +6421,26 @@ EnclosingS(nm,plist,options):=( AnsL_(length(AnsL))=AnsL_1;//16.10.20 if(Noflg<3, println("generate Enclosing "+name); - tmp=name+"="+textformat(AnsL,5); + tmp=name+"="+Textformat(AnsL,5); parse(tmp); - tmp=name+"=Enclosing(";//16.11.07from - tmp1="list("; + tmp=name+"=Enclosing(";//16.11.07from //no ketjs on + tmp1="list"+PaO(); forall(plist, tmp1=tmp1+#+","; ); tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")"; - GLIST=append(GLIST,tmp);//16.11.07until + GLIST=append(GLIST,tmp);//16.11.07to //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -6336,7 +6452,7 @@ EnclosingS(nm,plist,options):=( /////////// new enclosing /////////// ////%Enclosing start//// -Enclosing(nm,plist):=Enclosing2(nm,plist,[]);//180706(2lines) +Enclosing(nm,plist):=Enclosing2(nm,plist,[]);//180706[2lines] Enclosing(nm,plistorg,options):=Enclosing2(nm,plistorg,options); Enclosing2(nm,plist):=Enclosing2(nm,plist,[]); Enclosing2(nm,plistorg,options):=( @@ -6433,7 +6549,7 @@ Enclosing2(nm,plistorg,options):=( tmp2=Prepend(Op(length(tmp1),tmp),tmp2); Gdata=replace(Gdata,"(",""); Gdata=replace(Gdata,")",""); - tmp=Gdata+"="+textformat(tmp2,6); + tmp=Gdata+"="+Textformat(tmp2,6); parse(tmp); plist_nxtno=Gdata; t2=Length(tmp1); @@ -6474,28 +6590,28 @@ Enclosing2(nm,plistorg,options):=( ); if(Noflg<3, println("generate Enclosing "+name); - tmp=name+"="+textformat(AnsL,5); + tmp=name+"="+Textformat(AnsL,5); parse(tmp); tmp=name+"=Enclosing2(";//16.11.07from - tmp1="list("; + tmp1="list"+PaO(); forall(plistorg, //18.02.02 tmp1=tmp1+#+","; ); - tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")";//18.0706from + tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")";//18.0706from //no ketjs on if(length(Start)>0,tmp=tmp+","+Textformat(Start,6)); tmp=tmp+","+text(epspara)+")";//18.0706to,180707 - GLIST=append(GLIST,tmp);//16.11.07until + GLIST=append(GLIST,tmp);//16.11.07to //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -6524,7 +6640,7 @@ Makehatch(iolistorg,pt,vec,bdylist):=( tmp="["+substring(tmp,0,length(tmp)-1)+"]"; iolist_#=parse(tmp); ); - Scalebkup=[SCALEX,SCALEY];//181020(2lines) + Scalebkup=[SCALEX,SCALEY];//181020[2lines] SCALEX=1; SCALEY=1; sg=Lineplot("",[pt,pt+vec],["nodata"]); @@ -6697,14 +6813,14 @@ Hatchdatacindy(nm,iostr,bdylistorg,optionsorg):=( ); );//180717to if(tmp=="s", - Listplot(name,[LLcrd(tmp2_1),[tmp2_1_1,2*YMIN-YMAX], //180717(2lines) + Listplot(name,[LLcrd(tmp2_1),[tmp2_1_1,2*YMIN-YMAX], //180717[2lines] [tmp2_(length(tmp2))_1,2*YMIN-YMAX],LLcrd(tmp2_(length(tmp2)))], ["nodisp"]); Joincrvs(text(kk)+name,[namep,"sg"+name],["nodisp"]);//180717 bname="join"+text(kk)+name; ); if(tmp=="n", - Listplot(name,[LLcrd(tmp2_1),[tmp2_1_1,2*YMAX-YMIN], //180717(2lines) + Listplot(name,[LLcrd(tmp2_1),[tmp2_1_1,2*YMAX-YMIN], //180717[2lines] [tmp2_(length(tmp2))_1,2*YMAX-YMIN],LLcrd(tmp2_(length(tmp2)))], ["nodisp"]); Joincrvs(text(kk)+name,[namep,"sg"+name],["nodisp"]); @@ -6722,8 +6838,8 @@ Hatchdatacindy(nm,iostr,bdylistorg,optionsorg):=( Joincrvs(text(kk)+name,[namep,"sg"+name],["nodisp"]);//180717 bname="join"+text(kk)+name; ); - , - Enclosing2(text(kk)+name,tmp,["nodisp"]);//180619(2lines); + , + Enclosing2(text(kk)+name,tmp,["nodisp"]);//180619[2lines] bname="en"+text(kk)+name; ); ); @@ -6851,7 +6967,7 @@ Hatchdatacindy(nm,iostr,bdylistorg,optionsorg):=( vec=[cos(angle),sin(angle)]; nvec=[-sin(angle),cos(angle)]; AnsL=[]; - ctr=0;//181005(2lines) + ctr=0;//181005[2lines] forall(0..(maxnum_1), kk, pt=startP+kk*interval*nvec; sha=Makehatch(iostr,pt,vec,bdylist); @@ -6868,41 +6984,41 @@ Hatchdatacindy(nm,iostr,bdylistorg,optionsorg):=( AnsL=concat(AnsL,sha); ); ); - tmp1=apply(AnsL,textformat(#,5)); + tmp1=apply(AnsL,Textformat(#,5)); tmp=name+"="+tmp1; parse(tmp); ); if((Noflg<3)&(mkflg>-1), if(fileflg!="Y", //181102 println("generate Hatchdata "+name); - tmp=name+"="+textformat(AnsL,5); + tmp=name+"="+Textformat(AnsL,5); parse(tmp); - if(!islist(iostr),tmp1=[iostr],tmp1=iostr); - tmp="c("; + if(!islist(iostr),tmp1=[iostr],tmp1=iostr); //no ketjs on + tmp="c"+PaO(); forall(tmp1, tmp=tmp+Dq+#+Dq+","; ); tmp=substring(tmp,0,length(tmp)-1)+")"; tmp2=name+"=Hatchdata("+tmp; forall(bdynameL, - tmp2=tmp2+",list("+#+")"; + tmp2=tmp2+",list"+PaO()+#+")"; ); tmp2=tmp2+opstr+")"; - GLIST=append(GLIST,tmp2); + GLIST=append(GLIST,tmp2); //no ketjs off , - GLIST=append(GLIST,"ReadOutData("+Dq+fname+Dq+")");//181102 + GLIST=append(GLIST,"ReadOutData("+Dq+fname+Dq+")");//181102 //no ketjs ); ); if((Noflg<2)&(mkflg>-1), if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -6980,7 +7096,7 @@ Shade(nm,plistorg,options):=( //180613to ); ); //180929to if(length(color)==4, //180602from - tmp=colorCmyk2rgb(color); + tmp=Colorcmyk2rgb(color); ); flg=0; ctr=1; if(encflg==1, //180929from @@ -7004,7 +7120,7 @@ Shade(nm,plistorg,options):=( //180613to tmp2=append(tmp2,tmp); ); tmp1=Dqq("-"+name+text(ctr)); - tmp2=textformat(tmp2,6)+",["+Dqq("nodisp")+"]"; + tmp2=Textformat(tmp2,6)+",["+Dqq("nodisp")+"]"; tmp=name+text(ctr)+"=Listplot("+tmp1+","+tmp2+")"; parse(tmp); plist_jj=name+text(ctr); @@ -7018,11 +7134,11 @@ Shade(nm,plistorg,options):=( //180613to , G2=Joincrvs("1",plist,["nodata"]); G2=apply(G2,Pcrd(#)); - tmp1="fillpoly("+textformat(G2,5)+opcindy+");"; + tmp1="fillpoly("+Textformat(G2,5)+opcindy+");"; parse(tmp1); ); Str="Shade("; - tmp1="list("; + tmp1="list"+PaO(); forall(plist, if(isstring(#), // from 16.01.24 if(length(#)>1, @@ -7031,13 +7147,13 @@ Shade(nm,plistorg,options):=( //180613to tmp1=tmp1+Dq+#+Dq+","; ); , - tmp1=tmp1+"Listplot("+textformat(#,5)+"),"; + tmp1=tmp1+"Listplot("+Textformat(#,5)+"),"; ); //16.01.24to ); Str=Str+substring(tmp1,0,length(tmp1)-1)+")"+")"; //180929 - Com2nd("Texcom("+Dqq("{")+")",["before"]);Com2nd("Setcolor("+color+")",["before"]);//180722 + Com2nd("Texcom("+Dqq("{")+")",["before"]);Com2nd("Setcolor("+color+")",["before"]);//180722 //no ketjs on Com2nd(Str,["before"]); - Com2nd("Texcom("+Dqq("}")+")",["before"]);//180722 + Com2nd("Texcom("+Dqq("}")+")",["before"]);//180722 //no ketjs off ); ////%Shade end//// diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt index 849afc3c4b7..64a995c970e 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt @@ -1,9 +1,67 @@ +// 20190203 +// Mkketcindyjs debugged ( in case of local=y ) +// 20190202 +// Bezier changed ( (nm, ptlist(2)) supported) +// Htickmark,Vtickmark changed ( option added) +// 20190201 +// Mkketcindyjs debugged ( for removing button case the last is not "," ) +// Ketjsoption renamed to Setketcindyjs +// Mkketcindyjs changed ( "grid" option added ) +// 20190131 +// Mkketcindyjs changed (removespace of ignoretun,buttons to be removed) +// 20190130 +// Mkketcindyjs changed (USEDFUN (global) added) +// Ketjsoption changed (color) +// 20190129 +// "/LF/" => "/L"+"F/" +// Ketjsoption added +// Mkketcindyjs changed ( option "Web","Local","Scale","Nolabel") +// Copyketcindyjs debugged ( for Windows ) +// Mkketcindyjs changed ( option "Color" added) +// 20190128 +// Mkketcindyjs changed ( texflg removed , katex is OK ) +// Copyketcindyjs added +// 20190126 +// Windispg debugged (for Pointdata) +// Mkketcindyjs change ( point size ) +// 20190125 +// Windispg redebugged ("size") +// 20190123 +// Windispg debugged ("size") +// 20190123 +// Dashlinedata debugged/changed (ptn ) +// Windispg changed (ptn=0) +// 20190122 +// Windispg changed ("connect"=>"drawall" for do,da ) +// no ketjs added (Windispg,Mkketcindyjs) +// Dashlinedata added +// 20190120 +// Slider changed (color,size options ) +// 20190119 +// Mkketcindyjs debugge ( ketlib slot addede to csinit ) +// Windispg changed ( size of "dr" supported); +// 20190118 +// Mkketcindyjs changed ( position of "katex", ketlib slot addede to csinit ) +// Windispg debugged ( dashtype,linecolor v.s. opcindy ) +// 20190116 +// Findfun, Extractfun, Extractall, Mkketcindyjs added (for new ketcindyjs) +// 20190103 +// Drwxy changed (Addax(0) added in the case of add=0 ) +// Drwxy changed ( "O=" option added ) +// 20190101 +// Viewtex changed ( for tikz ) +// // 20181231 +// Drwxy debugged (GENTEN used, xrng/yrng changed ) +// Drwpt debugged ( Pointdata used ) +// Viewtex debugged ( tikz ) // 20181224 // WritetoRS changed (Closefile("0")) // 20181219 // BBdata debugged (macosx => ismacosx ) // 20181218 // Letter, Expr changed (pt,dir,str,options added ) +// 20181217 +// Drwxy debugged // 20181216 // Drwxy changed ( linestyle,colorax,colorla ) // 20181215 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs index c904a1d0fae..a9611b0f98d 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs @@ -14,7 +14,7 @@ // along with this program. If not, see // -println("ketcindybasic2(20181224) loaded"); +println("ketcindybasic2[20190203] loaded"); //help:start(); @@ -164,24 +164,24 @@ Rotatedata(nm,plist,angle,options):=( tmp1=append(tmp1,tmp); ); if(length(tmp1)==1,tmp1=tmp1_1); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp1=text(plist); + tmp1=text(plist); //no ketjs on tmp1=RSform(tmp1,1);// 180602 tmp=name+"=Rotatedata("+tmp1+"," - +textformat(angle,5)+","+RSform(textformat(Pt,5))+")"; //17.12.23 - GLIST=append(GLIST,tmp); + +Textformat(angle,5)+","+RSform(Textformat(Pt,5))+")"; //17.12.23 + GLIST=append(GLIST,tmp); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -234,23 +234,23 @@ Translatedata(nm,plist,mov,options):=( tmp1=append(tmp1,tmp); ); if(length(tmp1)==1,tmp1=tmp1_1); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp1=text(plist); + tmp1=text(plist); //no ketjs on tmp1=RSform(tmp1,1);// 180602 - tmp=name+"=Translatedata("+tmp1+","+RSform(textformat(mov,5))+")"; - GLIST=append(GLIST,tmp); + tmp=name+"=Translatedata("+tmp1+","+RSform(Textformat(mov,5))+")"; + GLIST=append(GLIST,tmp); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -272,10 +272,10 @@ Scaledata(nm,plist,Arg1,Arg2):=( //help:Scaledata("1",["crAB","pt1"],2,[[0,0]]); regional(tmp,options); if(islist(Arg2), - tmp=Arg1;//180603(2lines) + tmp=Arg1;//180603[2lines] if(!islist(tmp),tmp=[tmp,tmp]); tmp=Lcrd(tmp); - options=Arg2; + options=Arg2; Scaledata(nm,plist,tmp_1,tmp_2,options); , Scaledata(nm,plist,Arg1,Arg2,[]); @@ -326,24 +326,24 @@ Scaledata(nm,plist,rx,ry,options):=( tmp1=append(tmp1,tmp); ); if(length(tmp1)==1,tmp1=tmp1_1); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp1=text(plist); + tmp1=text(plist); //no ketjs on tmp1=RSform(tmp1,1); // 180602 tmp=name+"=Scaledata("+tmp1+"," - +textformat(rx,5)+","+textformat(ry,5)+","+RSform(textformat(Pt,5))+")"; - GLIST=append(GLIST,tmp); + +Textformat(rx,5)+","+Textformat(ry,5)+","+RSform(Textformat(Pt,5))+")"; + GLIST=append(GLIST,tmp); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -412,23 +412,23 @@ Reflectdata(nm,plist,symL,options):=( tmp1=append(tmp1,tmp); ); if(length(tmp1)==1,tmp1=tmp1_1); - tmp=name+"="+textformat(tmp1,5); + tmp=name+"="+Textformat(tmp1,5); parse(tmp); - tmp1=text(plist); + tmp1=text(plist); //no ketjs on tmp1=RSform(tmp1,1);// 180602 - tmp=name+"=Reflectdata("+tmp1+","+RSform(textformat(symL,5))+")";//17.12.23 - GLIST=append(GLIST,tmp); + tmp=name+"=Reflectdata("+tmp1+","+RSform(Textformat(symL,5))+")";//17.12.23 + GLIST=append(GLIST,tmp); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -490,7 +490,7 @@ MakeRarg(arglist):=( if(isstring(#), tmpstr=Dq+RSslash(#)+Dq; , - tmpstr=textformat(#,6); + tmpstr=Textformat(#,6); ); str=str+tmpstr+","; ); @@ -500,23 +500,24 @@ MakeRarg(arglist):=( ////%MakeRarg end//// ////%Htickmark start//// -Htickmark(arglist):=( +Htickmark(arglist):=Htickmark(arglist,[]); //190203 +Htickmark(arglist,options):=( //190203 //help:Htickmark([1,"1",2,"sw","2"]); 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 + [[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],"s1",arglist_(nn+1)],options); //190203 , - Expr([[arglist_nn,0],arglist_(nn+1),arglist_(nn+2)]); + Expr([[arglist_nn,0],arglist_(nn+1),arglist_(nn+2)],options); //190203 ); , - Expr([[arglist_nn,0],"s1",arglist_(nn+1)]); + Expr([[arglist_nn,0],"s1",arglist_(nn+1)],options); //190203 ); );//180710to // tmp=""; @@ -526,23 +527,24 @@ Htickmark(arglist):=( ////%Htickmark end//// ////%Vtickmark start//// -Vtickmark(arglist):=( +Vtickmark(arglist):=Vtickmark(arglist,[]); //190203 +Vtickmark(arglist,options):=( //190203 //help:Vtickmark([1,"1",2,"sw","2"]); 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 + [[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],"w1",arglist_(nn+1)],options); //190203 , - Expr([[0,arglist_nn],arglist_(nn+1),arglist_(nn+2)]); + Expr([[0,arglist_nn],arglist_(nn+1),arglist_(nn+2)],options); //190203 ); , - Expr([[0,arglist_nn],"w1",arglist_(nn+1)]); + Expr([[0,arglist_nn],"w1",arglist_(nn+1)],options); //190203 ); );//180710to// tmp=MakeRarg(arglist); // Com2nd("Vtickmark("+tmp+")"); @@ -581,7 +583,7 @@ Htick(px,lenorg,options):=( ////%Setax start//// Setax(arglist):=( -//help:Setax(["l","x","e","y","n","O","sw",]); +//help:Setax(["l","x","e","y","n","O","sw"]); //help:Setax([7,"nw"]); //help:Setax([8,linestyle,colorax,colorlabel]); regional(st,nn,tmp); //181215from @@ -601,19 +603,29 @@ Setax(arglist):=( ////%Setax end//// ////%Drwxy start//// -Drwxy():=Drwxy([]); -Drwxy(optionsorg):=( +Drwxy():=Drwxy(0,[]); //190103from +Drwxy(Arg):=( + if(islist(Arg),Drwxy(0,Arg); Drwxy(Arg,[])); +); +Drwxy(add):=Drwxy(add,[]); +Drwxy(add,optionsorg):=( //190103to //help:Drwxy(); -//help:Drwxy(options=["Origin=[0,0]","Xrng=","Yrng=","Ax=l,x,e,..."]); +//help:Drwxy(1[the last axis will be drawn],oprions); +//help:Drwxy(options); +//help:Drwxy(options=["Xrng=","Yrng=","Ax=l,x,e,..."]); regional(options,color,eqL,strL,org,xrng,yrng,ax,st,nn,size, linesty,colorax,colorla,tmp,tmp1,tmp2); options=optionsorg; tmp=Divoptions(options); color=tmp_(length(tmp)-2); eqL=tmp_5; - org=[0,0]; - xrng=[XMIN,XMAX]; - yrng=[YMIN,YMAX]; + org=GENTEN; + //tmp1=max([org_1+XMIN,XMIN]); + //tmp2=min([org_1+XMAX,XMAX]); + xrng=[XMIN,XMAX]; //190103 + //tmp1=max([org_2+YMIN,YMIN]); + //tmp2=min([org_2+YMAX,YMAX]); + yrng=[YMIN,YMAX]; //190103 ax=AXSTYLE; linesty=ax_8; if(isstring(ax_9),colorax=ax_9,colorax=text(ax_9)); @@ -631,10 +643,10 @@ Drwxy(optionsorg):=( forall(eqL, tmp=Strsplit(#,"="); tmp1=Toupper(substring(tmp_1,0,1)); - if(tmp1=="O", + if(tmp1=="O", //190103from org=parse(tmp_2); options=remove(options,[#]); - ); + ); //190103to if(tmp1=="X", xrng=parse(tmp_2); options=remove(options,[#]); @@ -663,7 +675,7 @@ Drwxy(optionsorg):=( strL=select(options,isstring(#)); //181216 tmp=select(strL,contains(["dr","da","do","id"],substring(#,0,2))); if(length(tmp)==0,options=append(options,YasenStyle)); - tmp=substring(ax_1,1,length(ax_1)); //181216(2lines) + tmp=substring(ax_1,1,length(ax_1)); //181216[2lines] if(length(tmp)>0,size=parse(tmp),size=YaSize); tmp1=concat(options,[size,YaAngle,YaPosition,YaCut,colorax]);//181216 tmp=[[xrng_1,org_2],[xrng_2,org_2]]; @@ -678,22 +690,28 @@ Drwxy(optionsorg):=( Listplot("axy"+text(AXCOUNT),tmp,tmp1); ); AXCOUNT=AXCOUNT+1; - Expr([[xrng_2,org_2],ax_3,ax_2],[colorla]);//181216(3lines) + Expr([[xrng_2,org_2],ax_3,ax_2],[colorla]);//181216[3lines] Expr([[org_1,yrng_2],ax_5,ax_4],[colorla]); Letter([org,ax_7,ax_6],[colorla]); - // Addax(0); // 16.01.21 + if(add==0, //190103 + Addax(0); + ); ); ////%Drwxy end//// ////%Drwpt start//// -Drwpt(pstr):=Drawpoint(pstr); +Drwpt(pstr):=Drwpt(pstr,1); //181231 Drwpt(ptlist,nn):=( // 16.03.05 from //help:Drwpt(A); -//help:Drwpt("[1,1],0"); -//help:Drwpt(A,0); //help:Drwpt([1,2],0); - Drawpoint(ptlist,nn); + if(!isreal(DrwPtCtr), //181231from + DrwPtCtr=1; + ); + Pointdata(text(DrwPtCtr),ptlist,["Inside="+text(nn)]); + DrwPtCtr=DrwPtCtr+1; //181231to ); +////%Drwpt end//// +////%Drawpoint start//// Drawpoint(pstr):=( if(isstring(pstr), println("Drwpt : "+pstr); @@ -718,12 +736,12 @@ Drawpoint(ptlistorg,nn):=( tmp1=max(TenSize/TenSizeInit,1)/8; Setpen(tmp1); // 16.04.09 until forall(ptlist, - tmp=textformat(#,5)+","+text(nn); + tmp=Textformat(#,5)+","+text(nn); Com2nd("Drwpt("+tmp+")"); // 16.04.09 ); Setpen(thick); // 16.04.09 );// 16.03.05 until -////%Drwpt end//// +////%Drawpoint end//// ////%Addax start//// Addax(param):=( @@ -770,7 +788,7 @@ Letter(list,options):=( aln="left"; forall(opL, tmp=indexof(#,"->"); - tmp1=removespace(substring(#,0,tmp-1)); + tmp1=Removespace(substring(#,0,tmp-1)); tmp2=substring(#,tmp+1,length(#)); if(tmp1=="size",sz=parse(tmp2)); if(tmp1=="color",clr=parse(tmp2)); @@ -781,7 +799,7 @@ Letter(list,options):=( Dmv=8; Nj=1; while(Nj+2<=length(list), -// Pos=textformat(list_Nj,5); +// Pos=Textformat(list_Nj,5); Pos=list_Nj; Dir=list_(Nj+1); tmp=indexof(Dir,"s")+indexof(Dir,"n");//16.10.19from @@ -799,15 +817,15 @@ Letter(list,options):=( Str=RSslash(Str); // 17.09.24 Str=replace(Str,"`","'");//180303 tmp=Dq+","+Dq+Str+Dq+")"; - if(Noflg==0, + if(Noflg==0, //no ketjs on 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 + Com2nd("Letter("+Lcrd(Pos)+","+Dq+Dir+tmp);//16.10.10 + if((Noflg==0)&(color!=KCOLOR), //180904 Texcom("}");//180722 ); - ); + ); //no ketjs off if(Noflg<2, Xmv=0;//16.10.13 Ymv=-4; @@ -936,11 +954,24 @@ Exprrot(pt,dir,tmov,nmov,str,options):=( ////%Exprrot end//// ////%Slider start//// -Putslider(ptstr,p1,p2):=Slider(ptstr,p1,p2); -Slider(ptstr,p1,p2):=( //17.04.11 +Slider(ptstr,p1,p2):=Slider(ptstr,p1,p2,[]); +Slider(ptstr,p1,p2,options):=(//190120 //help:Slider("A-C-B",[-3,0],[3,0]); - regional(pA,pB,pC,seg,sname,Alpha,tmp,tmp1); - tmp=indexall(ptstr,"-"); +//help:Slider(options=["Color=0.6*[0,0,1]","Size=2"]); + regional(pA,pB,pC,seg,sname,Alpha,color,size,tmp,tmp1); + color="Color=0.6*[0,0,1]"; //190120from + size="size->2"; + forall(options, + tmp=Toupper(substring(#,0,1)); + if(tmp=="C", + color=#; + ); + if(tmp=="S", + tmp=Strsplit(#,"="); + size="size->"+tmp_2; + ); + ); //190120to + tmp=Indexall(ptstr,"-"); pA=substring(ptstr,0,tmp_1-1); pC=substring(ptstr,tmp_1,tmp_2-1); pB=substring(ptstr,tmp_2,length(ptstr)); @@ -958,7 +989,7 @@ Slider(ptstr,p1,p2):=( //17.04.11 ); Putpoint(pA,p1); Putpoint(pB,p2); - Listplot([parse(pA),parse(pB)],["notex","color->[0,0.4,0.4]","size->2"]); + Listplot([parse(pA),parse(pB)],["Msg=n","notex",color,size]); // create([sname],"Segment",[parse(pA),parse(pB)]); // tmp2=Listplot("",[p1,p2],["nodata"]); Putonseg(pC,parse("sg"+pA+pB)); @@ -975,7 +1006,22 @@ Putpoint(name,Ptinit,Pt):=( if(!contains(ptstr,name), createpoint(name,Pcrd([Ptinit_1,Ptinit_2])); , - ptstr=name+".xy="+textformat(Pcrd(Pt),5); + ptstr=name+".xy="+Textformat(Pcrd(Pt),5); + parse(ptstr); + ); +); +////%Putpoint end//// + +////%Putpoint start//// +Putpoint(name,Pt):=Putpoint(name,Pt,Pt); +Putpoint(name,Ptinit,Pt):=( +//help:Putpoint("A",[1,2],[1,A.y]); + regional(ptstr); + ptstr=apply(allpoints(),#.name);//16.10.06 + if(!contains(ptstr,name), + createpoint(name,Pcrd([Ptinit_1,Ptinit_2])); + , + ptstr=name+".xy="+Textformat(Pcrd(Pt),5); parse(ptstr); ); ); @@ -1012,7 +1058,16 @@ Bezierpt(t,ptlist,ctrlist):=( ////%Bezier start//// Bezier(ptctrlist):=BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,[]); -Bezier(ptctrlist,options):=BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,options); +Bezier(Arg1,Arg2):=( //190202from + regional(nm,ptctrlist,options); + if(islist(Arg1), + ptctrlist=Arg1; options=Arg2; + BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,options); + , + nm=Arg1; ptctrlist=Arg2; + BezierCurve(nm,ptctrlist_1,ptctrlist_2,[]); + ); +); //190202to Bezier(nm,ptlist,ctrlist):=BezierCurve(nm,ptlist,ctrlist,[]); Bezier(nm,ptlist,ctrlist,options):=BezierCurve(nm,ptlist,ctrlist,options); ////%Bezier end//// @@ -1042,9 +1097,9 @@ BezierCurve(nm,ptlistorg,ctrlistorg,options):=( ptlist=apply(ptlistorg,Lcrd(#)); // 16.08.16 ctrlist=[]; // 14.12.31 if(length(ctrlistorg)==length(ptlist)-1, - forall(ctrlistorg,tmp1, + forall(1..(length(ctrlistorg)),ii, //190202 + tmp1=apply(ctrlistorg_ii,Lcrd(#)); //190202 if(MeasureDepth(tmp1)==0,tmp=[tmp1],tmp=tmp1); - tmp=apply(tmp,Lcrd(#)); // 16.08.16 ctrlist=append(ctrlist,tmp); ); , @@ -1070,24 +1125,24 @@ BezierCurve(nm,ptlistorg,ctrlistorg,options):=( if(Noflg<3, println("generate Bezier "+name); out=apply(list,Pcrd(#)); - tmp=name+"="+textformat(out,5); + tmp=name+"="+Textformat(out,5); parse(tmp); - tmp1=textformat(ptlist,5); + tmp1=Textformat(ptlist,5); //no ketjs on tmp1=RSform(tmp1,2); //17.12.23 - tmp2=textformat(ctrlist,5); + tmp2=Textformat(ctrlist,5); tmp2=RSform(tmp2,3); //17.12.23 - GLIST=append(GLIST,name+"=Bezier("+tmp1+","+tmp2+opstr+")"); + GLIST=append(GLIST,name+"=Bezier("+tmp1+","+tmp2+opstr+")"); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -1188,14 +1243,14 @@ Putbezierdata(name,ptL,options):=( tmp1=name+"p"+text(#-1); Putpoint(tmp1,tmp,Lcrd(parse(tmp1))); // 16.08.16 inspect(parse(tmp1),"labeled",false); //15.01.22 - Letter([parse(tmp1),"ne",tmp1],["notex"]); //15.01.22 + Letter([parse(tmp1),"ne",tmp1],["notex"]); //15.01.22 inspect(parse(tmp1),"ptsize",psize); inspect(parse(tmp1),"color",3); tmp=(p1+2*p2)/3; tmp2=name+"q"+text(#-1); - Putpoint(tmp2,tmp,Lcrd(parse(tmp2))); // 16.08.16 + Putpoint(tmp2,tmp,Lcrd(parse(tmp2))); // 16.08.16 inspect(parse(tmp2),"labeled",false); //15.01.22 - Letter([parse(tmp2),"ne",tmp2],["notex"]); //15.01.22 + Letter([parse(tmp2),"ne",tmp2],["notex"]); //15.01.22 inspect(parse(tmp2),"ptsize",psize); inspect(parse(tmp2),"color",3); ctrs=append(ctrs,[parse(tmp1),parse(tmp2)]); @@ -1204,7 +1259,7 @@ Putbezierdata(name,ptL,options):=( tmp1=name+"p"+text(#-1); Putpoint(tmp1,tmp,Lcrd(parse(tmp1))); // 16.08.16 inspect(parse(tmp1),"labeled",false); //15.01.22 - Letter([parse(tmp1),"ne",tmp1],["notex"]); //15.01.22 + Letter([parse(tmp1),"ne",tmp1],["notex"]); //15.01.22 inspect(parse(tmp1),"ptsize",psize); inspect(parse(tmp1),"color",3); ctrs=append(ctrs,[parse(tmp1)]); @@ -1294,7 +1349,7 @@ Writebezier(head,seL):=( tmp1=bz_#; ); tmp1=replace(tmp1,"Bezier(","["); - tmp1=replace(tmp1,"list(","["); + tmp1=replace(tmp1,"list"+PaO(),"["); tmp1=replace(tmp1,")","]"); tmp1=replace(tmp1,",",".xy,"); tmp1=replace(tmp1,"]",".xy]"); @@ -1336,7 +1391,7 @@ Readbezier(file,optionorg):=( tmp1=parse(tmp+"k"); tmp2=parse(tmp+"c"); if(MeasureDepth(tmp2)==1,tmp2=[tmp2]); // 16.04.22from - if(geo==1, + if(geo==1, alpha="abcdefghijklmnopqrstuvwxyz"; forall(1..length(tmp1), tmp="k"+BezierNumber+"n"+text(nc)+substring(alpha,#-1,#); @@ -1507,7 +1562,7 @@ Bzspline(nm,ptLorg,options):=( pt1=parse("C"+text(#-1)+"q"); create([lstr],"Join",[pt1,pt]); tmp2="C"+text(#)+"p"; - tmp=Append((2*pt.xy-pt1.xy),1); + tmp=append((2*pt.xy-pt1.xy),1); create([tmp2],"PointOnLine",[parse(lstr),tmp]); ); ); @@ -1523,7 +1578,7 @@ Bzspline(nm,ptLorg,options):=( pt1=parse("C"+text(length(ptL)-1)+"q"); create([lstr],"Join",[pt1,pt]); tmp1="C1p"; - tmp=Append((2*pt.xy-pt1.xy),1); + tmp=append((2*pt.xy-pt1.xy),1); create([tmp1],"PointOnLine",[parse(lstr),tmp]); ); ctrlist=[]; @@ -1575,14 +1630,14 @@ Bzsspline(nm,ptLorg,options):=( if(cflg==0, pt=ptL_1; pt1=ptL_2; - Putpoint("C1p",(4*pt+pt1)/5,Lcrd(C1p)); // 16.08.16 + Putpoint("C1p",(4*pt+pt1)/5,Lcrd(C1p)); // 16.08.16 inspect(C1p,"ptsize",3); inspect(C1p,"color",3); ); if(cflg==1, pt=ptL_1; pt1=Lcrd(parse("C"+text(length(ptL)-1)+"q")); // 16.08.16 - tmp1="Putpoint("+Dq+"C1p"+Dq+",2*pt-pt1)"; // 16.08.16 + tmp1="Putpoint("+Dq+"C1p"+Dq+",2*pt-pt1)"; // 16.08.16 parse(tmp1); ); ctrlist=[]; @@ -1659,7 +1714,7 @@ MeetCurve(Crv,Xorg,Yorg):=( Ban=concat(tmp1,tmp2); Tate=select(Ban, abs(Cv_#_1-Cv_(#+1)_1)<= - 10^(-2)*abs(Cv_#_2-Cv_(#+1)_2) + 10^(-2)*abs(Cv_#_2-Cv_(#+1)_2) ); Ban=remove(Ban,Tate); Ylist=[]; @@ -1694,11 +1749,11 @@ MeetCurve(Crv,Xorg,Yorg):=( ); ////%MeetCurve end//// -////%PutonLine start//// -PutonLine(name,p1,p2):=PutonLine(name,p1,p2,[]); -PutonLine(name,p1org,p2org,options):=( -//help:PutonLine("C","sgAB"); -//help:PutonLine("C",pA,pB); +////%Putonline start//// +Putonline(name,p1,p2):=PutonLine(name,p1,p2,[]); +Putonline(name,p1org,p2org,options):=( +//help:Putonline("C","sgAB"); +//help:Putonline("C",pA,pB); regional(par,p1,p2,dx,dy,tmp,tmp1,tmp2); par=0.5; tmp=Divoptions(options); @@ -1725,19 +1780,20 @@ PutonLine(name,p1org,p2org,options):=( ); ); ); -////%PutonLine end//// +////%Putonline end//// -////%PutonSeg start//// -PutonSeg(name,sgstr):=( +////%Putonseg start//// +Putonseg(name,sgstr):=( regional(seg,p1,p2); if(isstring(sgstr),seg=parse(sgstr),seg=sgstr); - PutonSeg(name,LLcrd(seg_1),LLcrd(seg_2)); + Putonseg(name,LLcrd(seg_1),LLcrd(seg_2)); ); -PutonSeg(name,p1,p2):=PutonSeg(name,p1,p2,[]); -PutonSeg(name,p1org,p2org,options):=( -//help:PutonSeg("C","sgAB"); -//help:PutonSeg("C",pA,pB); - regional(par,dx,dy,p,tmp,tmp1,tmp2); +Putonseg(name,p1,p2):=Putonseg(name,p1,p2,[]); +Putonseg(name,p1org,p2org,options):=( +//help:Putonseg("C","sgAB"); +//help:Putonseg("C",pA,pB); + regional(Eps,par,dx,dy,p,tmp,tmp1,tmp2); + Eps=10^(-5); par=0.5; tmp=Divoptions(options); if(length(tmp_6)>0, @@ -1745,31 +1801,31 @@ PutonSeg(name,p1org,p2org,options):=( ); p1=Lcrd(p1org);//16.10.11from p2=Lcrd(p2org); - PutonLine(name,p1,p2,[par]); + Putonline(name,p1,p2,[par]); + p1=Pcrd(p1); p2=Pcrd(p2); //190120 dx=p2_1-p1_1; dy=p2_2-p1_2; p=parse(name+".xy"); - p=LLcrd(p); - if(abs(dx)>abs(dy) & (p_1-p1_1)*(p_1-p2_1)>0, - if(|p-p1|<|p-p2|, - parse(name+".xy=Pcrd(p1)"); - , - parse(name+".xy=Pcrd(p2)"); - ); - ); - if(abs(dx)0, - if(|p-p1|<|p-p2|, - parse(name+".xy=Pcrd(p1)"); - , - parse(name+".xy=Pcrd(p2)");//16.10.11until - ); - ); -); -////%PutonSeg end//// +// p=LLcrd(p); + if(abs(dx)>abs(dy), //190120from + if(p1_1>p2_1,tmp=p1;p1=p2;p2=tmp); + if(p_1p2_1,parse(name+".xy="+Textformat(p2,5));p=p2); + tmp=(p2_2-p1_2)/(p2_1-p1_1)*(p_1-p1_1)+p1_2; + parse(name+".y="+tmp); + , + if(p1_2>p2_2,tmp=p1;p1=p2;p2=tmp); + if(p_2p2_2,parse(name+".xy="+Textformat(p2,5));p=p2); + tmp=(p2_1-p1_1)/(p2_2-p1_2)*(p_2-p1_2)+p1_1; + parse(name+".x="+tmp); + ); //190120to +); +////%Putonseg end//// -////%PutonCurve start//// -PutonCurve(pn,crv):=PutonCurve(pn,crv,[]); -PutonCurve(pn,crv,options):=( +////%Putoncurve start//// +Putoncurve(pn,crv):=Putoncurve(pn,crv,[]); +Putoncurve(pn,crv,options):=( //help:Putoncurve("A","gr1"); //help:Putoncurve("A","gr1",[0,XMAX]); regional(Pmt,pstr,optionL,leftlim,rightlim,tmp,tmp1,Flg,Msg); @@ -1793,25 +1849,25 @@ PutonCurve(pn,crv,options):=( ); ); Pmt=MeetCurve(crv,leftlim,0); - pstr=apply(allpoints(),textformat(#,5)); // 15.04.07 + pstr=apply(allpoints(),Textformat(#,5)); // 15.04.07 if(!contains(pstr,pn), createpoint(pn,Pcrd(Pmt)); , tmp1=parse(pn+".x"); if(tmp1< leftlim % tmp1>rightlim, if(tmp1< leftlim,tmp= leftlim, tmp=rightlim); - Pmt=MeetCurve(crv,textformat(tmp,5),pn+".y"); + Pmt=MeetCurve(crv,Textformat(tmp,5),pn+".y"); , Pmt=MeetCurve(crv,pn+".x",pn+".y"); ); - ptstr=pn+".xy="+textformat(Pcrd(Pmt),5)+";"; + ptstr=pn+".xy="+Textformat(Pcrd(Pmt),5)+";"; parse(ptstr); ); if(Msg=="y", println("Put "+pn+" on Curve "+text(crv)); ); ); -////%PutonCurve end//// +////%Putoncurve end//// ////%CrossPoint start//// CrossPoint(name,Crv1,Crv2,range):=( @@ -1872,16 +1928,16 @@ Periodfun(defL,reporg,optionorg):=( // 16.11.24 forall(1..(length(defL)/3),nn, fun=defL_(3*nn-2); range=defL_(3*nn-1); - tmp1=if(isstring(range_1),parse(range_1),range_1); //17.06.11(2lines) + tmp1=if(isstring(range_1),parse(range_1),range_1); //17.06.11[2lines] tmp2=if(isstring(range_2),parse(range_2),range_2); minx=min(minx,tmp1); maxx=max(maxx,tmp2); num=defL_(3*nn); options=append(options,"Num="+text(num)); Plotdata("pe"+text(nn),fun, - "x="+textformat([tmp1,tmp2],5),options); + "x="+Textformat([tmp1,tmp2],5),options); pdata=append(pdata,"grpe"+text(nn)); - tmp1=range_1; //17.06.11(4lines) + tmp1=range_1; //17.06.11[4lines] if(isstring(tmp1),tmp1=replace(tmp1,"pi","%pi"),tmp1=format(tmp1,5)); tmp2=range_2; if(isstring(tmp2),tmp2=replace(tmp2,"pi","%pi"),tmp2=format(tmp2,5)); @@ -1900,7 +1956,7 @@ Periodfun(defL,reporg,optionorg):=( // 16.11.24 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)]); + tmp2=concat(tmp2,["trp"+np+text(nr)]); ); );//180724to pdata=concat(tmp1,pdata); @@ -2125,9 +2181,9 @@ Tabledata(nm,xLst,yLst,rmvL,optionorg):=( Putpoint(tmp,Tgrid(tmp1)); , Putpoint(tmp,Tgrid(tmp1),[R0.x,parse(tmp+".y")]); - rlist_(#+1)=parse(tmp+".xy"); + rlist_(#+1)=parse(tmp+".xy"); //no ketjs ); - Putpoint(tmp,Tgrid(tmp1),[R0.x,parse(tmp+".y")]); + Putpoint(tmp,Tgrid(tmp1),[R0.x,parse(tmp+".y")]); inspect(parse(tmp),"ptsize",3); inspect(parse(tmp),"labeled",false); if(mod(#,tick)==0 % #==n, @@ -2358,7 +2414,7 @@ Findcell(Tbdata,pos1,pos2):=( regional(tmp1,tmp2,posnw,posse,ctr,dx,dy); if(isstring(pos1), posnw=Tgrid(pos1); // 15.05.20 - posse=Tgrid(pos2); + posse=Tgrid(pos2); //posnw=parse(pos1); //posse=parse(pos2); , @@ -2479,9 +2535,9 @@ RSform(str,listfrom):=( //help:RSform(string,listfrom); regional(posL,mxlv,rep1,rep2,rep3,prev,out, tmp,tmp1,tmp2); - rep1="c("; rep2="c("; rep3="list("; - if(listfrom<3,rep2="list("); - if(listfrom==1,rep1="list("); + rep1="c"+PaO(); rep2="c"+PaO(); rep3="list"+PaO(); + if(listfrom<3,rep2="list"+PaO()); + if(listfrom==1,rep1="list"+PaO()); posL=Bracket(str,"[]"); tmp=apply(posL,#_2); mxlv=max(tmp); @@ -2505,8 +2561,8 @@ RSform(str,listfrom):=( out=replace(out,".xy",""); out=replace(out,".x","[1]"); out=replace(out,".y","[2]"); - out=replace(out,"c(1)","[1]");//17.10.06(2lines) - out=replace(out,"c(2)","[2]"); + out=replace(out,"c"+PPa("1"),"[1]");//17.10.06[2lines] + out=replace(out,"c"+PPa("2"),"[2]"); out; ); ////%RSform end//// @@ -2524,8 +2580,8 @@ RSslash(str):=( //17.09.24 Rform(list):=( regional(plotlist,comp,pos,out,strL,tmp,tmp1,tmp2,tmp3,Nj); out=list; - out=replace(out,"[[[","list([["); - out=replace(out,"[","c("); + out=replace(out,"[[[","list"+PaO()+"[["); + out=replace(out,"[","c"+PaO()); out=replace(out,"]",")"); out=replace(out,".xy",""); out=replace(out,".x","[1]"); @@ -2587,7 +2643,7 @@ IftoR(strorg):=( //180802 regional(str,ifL,ppL,cpL,kk,sL,out, tmp,tmp1,tmp2,tmp3,tmp4); str=replace(strorg,LFmark,""); - ifL=Indexall(str,"if("); + ifL=Indexall(str,"if"+PaO()); ppL=Bracket(str,"()"); cpL=Indexall(str,","); tmp1=Bracket(str,"[]"); @@ -2633,7 +2689,7 @@ FortoR(strorg):=( if(forstr==0, out=str; , - pre=substring(str,0,forstr-1)+"for("; + pre=substring(str,0,forstr-1)+"for"+PaO(); ppL=Bracket(str,"()"); tmp1=forstr+6; tmp=select(ppL,#_1==tmp1); @@ -2669,7 +2725,7 @@ Deffun(name,bodylist):=( funstr=funstr+");"; parse(funstr); tmp=indexof(name,"("); - str=substring(name,0,tmp-1)+"<-function("; + str=substring(name,0,tmp-1)+"<-function"+PaO(); str=str+substring(name,tmp,length(name))+"{"; forall(1..(length(bodylist)-1),nbody, bdy=bodylist_nbody; @@ -2704,7 +2760,7 @@ Deffun(name,bodylist):=( str=str+bdy+";"; ); ); - str=str+"return("+bodylist_(length(bodylist))+")}"; + str=str+"return"+PaO()+bodylist_(length(bodylist))+")}"; FUNLIST=append(FUNLIST,str); ); ////%Deffun end//// @@ -2725,69 +2781,141 @@ Inwindow(point,xrng,yrng):=( ); ////%Inwindow end//// -////%Windispg start//// -Windispg():=( - regional(Nj,Nk,Dt,Vj,tmp,tmp1,tmp2,opcindy); - if(ADDAXES=="1", //181215from - Drwxy(); -// ADDAXES="0"; - ); //181215to - gsave(); - layer(KETPIClayer); - forall(GCLIST,Nj, - if(isstring(Nj_1),Dt=parse(Nj_1),Dt=Nj_1); // 11.17 - if(islist(Dt) & length(Dt)>0, // 12.19,12.22 - tmp=MeasureDepth(Dt); - if(tmp==1,Dt=[Dt]); - opcindy=Nj_3; - if(Nj_2<0,tmp1=0,tmp1=Nj_2); - if(tmp1<10, - forall(Dt,Nk, - tmp2=Nk; // 14.12.04 - if(length(Nk)>1, - tmp="connect("+textformat(tmp2,5)+ - ",dashtype->"+text(tmp1)+",linecolor->"+KCOLOR+opcindy+")"; - parse(tmp); - , - if(length(Nk)==1, - tmp="draw("+text(tmp2_1)+opcindy+")"; // 14.12.31 - parse(tmp); - ); +////%Dashlinedata start//// +Dashlinedata(dataorg,sen,gap,ptn):=( + regional(data,eps,dtall,len,lenlist,ii,lenall,kari, + naga,tobi,nsen,seglist,segunit,hajime,owari,jj, + flg,tt,ptL,out,tmp,tmp1,tmp2); + eps=10.0^(-6); + if(isstring(dataorg),data=parse(dataorg),data=dataorg); + dtall=length(data); + out=[]; + len=0; lenlist=[0]; + forall(2..dtall,ii, + len=len+|data_ii-data_(ii-1)|; + lenlist=append(lenlist,len); + ); + lenall=lenlist_dtall; + if(lenall>0, + kari=(sen+gap)*0.1;naga=sen*0.1;tobi=gap*0.1; + if(|data_1-data_dtall|0,hajime=flg-1); + flg=0; + forall(hajime..dtall,jj, + if(flg==0, + if(len+naga0,owari=flg-1); + tt=len-lenlist_hajime; + tt=tt/(lenlist_(hajime+1)-lenlist_hajime); + tmp=data_hajime+tt*(data_(hajime+1)-data_hajime); + ptL=[tmp]; + forall((hajime+1)..owari,jj, + ptL=append(ptL,data_jj); + ); + tt=(len+naga-lenlist_owari); + tt=tt/(lenlist_(owari+1)-lenlist_owari); + tmp=data_owari+tt*(data_(owari+1)-data_owari); + ptL=append(ptL,tmp); + out=append(out,ptL); ); ); - grestore(); - layer(0); + out; ); -Windispg(pltdata):=( - regional(pdata,Nj,Nk,Dt,tmp,tmp1,tmp2,opcindy); +////%Dashlinedata end//// + +////%Windispg start//// +Windispg():=( + if(ADDAXES=="1", //181215from + Drwxy(); + ADDAXES="0"; + ); //181215to + Windispg(GCLIST); //190125 +); +Windispg(gcLorg):=( //190125 + regional(gcL,Nj,Nk,Dt,Vj,tmp,tmp1,tmp2,tmp3,tmp4,opcindy); + gcL=gcLorg; //190125from + if(length(gcL)>0, + if(!islist(gcL_1),gcL=[gcL]); + ); //190125to gsave(); layer(KETPIClayer); - if(!islist(pltdata),tmp=[pltdata],tmp=pltdata); - pdata=select(GCLIST,contains(tmp,#_1)); - forall(pdata,Nj, + forall(gcL,Nj, if(isstring(Nj_1),Dt=parse(Nj_1),Dt=Nj_1); // 11.17 if(islist(Dt) & length(Dt)>0, // 12.19,12.22 tmp=MeasureDepth(Dt); if(tmp==1,Dt=[Dt]); opcindy=Nj_3; - if(Nj_2<0,tmp1=0,tmp1=Nj_2); + tmp=Nj_2; //190119from + if(!islist(tmp),tmp=[tmp,""]); //190123 + if(tmp_1<0,tmp1=0,tmp1=tmp_1); //190119from if(tmp1<10, forall(Dt,Nk, - tmp2=Nk; // 14.12.04 if(length(Nk)>1, - tmp="connect("+textformat(tmp2,5)+ // 15.05.11 - ",dashtype->"+text(tmp1)+ - ",linecolor->"+KCOLOR+opcindy+")"; - parse(tmp); - , - if(length(Nk)==1, - tmp="draw("+text(tmp2_1)+opcindy+")"; // 14.12.31 + tmp3=""; + if(indexof(opcindy,"color")==0, //190122from + tmp3=tmp3+",linecolor->"+KCOLOR; + ); + tmp3=tmp3+opcindy; + if(tmp1==0, //190126from + if((length(tmp_2)>0)&(indexof(opcindy,"size")==0), + tmp3=tmp3+",size->"+tmp_2; + ); //190124to + tmp="connect("+Textformat(Nk,5)+tmp3+");";//190125 parse(tmp); + , + if(tmp1==1, + tmp4=Dashlinedata(Nk,2.5,2.5,0); + forall(tmp4, + tmp="connect("+Textformat(#,5)+tmp3+");"; + parse(tmp); + ); + , + tmp3=",dashtype->"+text(tmp1)+tmp3; + forall(1..(length(Nk)-1), + tmp="draw("+Textformat([Nk_#,Nk_(#+1)],5)+tmp3+");"; + parse(tmp); + ); + ); ); - ); + , + tmp="draw("+text(Nk_1)+opcindy+");"; // 14.12.31 + parse(tmp); + ); //190126to ); ); ); @@ -2830,7 +2958,7 @@ WritetoRS(filename,shchoice):=( tmp1=format(re(tmp_1),6);// 15.02.05 tmp2=format(re(tmp_2),6); tmp=#.name+"="+"c("+tmp1+","+tmp2+");"; - tmp=tmp+"Assignadd('"+#.name+"',"+#.name+")"; + tmp=tmp+"Assignadd('"+#.name+"',"+#.name+")"; Plist=append(Plist,tmp); , println("Remove the abnormal poiint "+#.name); //181106 @@ -2850,26 +2978,26 @@ WritetoRS(filename,shchoice):=( println(SCEOUTPUT,""); ); if(iswindows(), - println(SCEOUTPUT,"options(encoding='UTF-8')"); //180513 + println(SCEOUTPUT,"options"+PaO()+"encoding='UTF-8')"); //190111 ); tmp1=replace(Dirwork,"\","/"); if((iswindows())&(indexof(tmp1,"Users")>0), tmp=Indexall(tmp1,"/"); tmp2=substring(tmp1,tmp_3-1,length(tmp1)); tmp1=substring(tmp1,0,tmp_3-1); - println(SCEOUTPUT,"Drv=shell('echo %HOMEDRIVE%',intern=TRUE)"); - println(SCEOUTPUT,"Drv=Drv[length(Drv)]"); - println(SCEOUTPUT,"Hpath=shell('echo %HOMEPATH%',intern=TRUE)"); - println(SCEOUTPUT,"Hpath=Hpath[length(Hpath)]"); + println(SCEOUTPUT,"Drv=shell"+PaO()+"'echo %HOMEDRIVE%',intern=TRUE)"); //190111 + println(SCEOUTPUT,"Drv=Drv[length"+PaO()+"Drv)]"); + println(SCEOUTPUT,"Hpath=shell"+PaO()+"'echo %HOMEPATH%',intern=TRUE)"); + println(SCEOUTPUT,"Hpath=Hpath[length"+PaO()+"Hpath)]"); println(SCEOUTPUT,"Rest="+Dqq(tmp2)); - println(SCEOUTPUT,"Path=paste(Drv,Hpath,Rest,sep='')"); - println(SCEOUTPUT,"Path=gsub('\\','/',Path,fixed=TRUE)"); //180610 - println(SCEOUTPUT,"setwd(Path)"); + println(SCEOUTPUT,"Path=paste"+PaO()+"Drv,Hpath,Rest,sep='')"); + println(SCEOUTPUT,"Path=gsub"+PaO()+"'\\','/',Path,fixed=TRUE)"); //180610 + println(SCEOUTPUT,"setwd"+PaO()+"Path)"); , - println(SCEOUTPUT,"setwd('"+tmp1+"')"); + println(SCEOUTPUT,"setwd"+PaO()+"'"+tmp1+"')"); );//180409to tmp=replace(Libname,"\","/"); //17.09.24from - println(SCEOUTPUT,"source('"+tmp+".r')"); //181213 + println(SCEOUTPUT,"source"+PaO()+"'"+tmp+".r')"); //181213 if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0), if(GPACK=="tpic",GPACK="pict2e"); ); @@ -2879,20 +3007,20 @@ WritetoRS(filename,shchoice):=( ); if(GPACK=="tikz", //181213from tmp=replace(tmp+"_reptikz","\","/"); - println(SCEOUTPUT,"source('"+tmp+".r')"); + println(SCEOUTPUT,"source"+PaO()+"'"+tmp+".r')"); ); //181213to - println(SCEOUTPUT,"Ketinit()"); - println(SCEOUTPUT,"cat(ThisVersion,'\n')"); + println(SCEOUTPUT,"Ketinit"+PPa("")); + println(SCEOUTPUT,"cat"+PaO()+"ThisVersion,'\n')"); println(SCEOUTPUT,"Fnametex='"+Fnametex+"'"); println(SCEOUTPUT,"FnameR='"+FnameR+"'"); println(SCEOUTPUT,"Fnameout='"+Fnameout+"'"); println(SCEOUTPUT,"arccos=acos; arcsin=asin; arctan=atan"); - println(SCEOUTPUT,"Acos<- function(x){acos(max(-1,min(1,x)))}"); - println(SCEOUTPUT,"Asin<- function(x){asin(max(-1,min(1,x)))}"); + println(SCEOUTPUT,"Acos<- function"+PPa("x")+"{acos"+PaO()+"max"+PaO()+"-1,min"+PaO()+"1,x)))}"); + println(SCEOUTPUT,"Asin<- function"+PPa("x")+"{asin"+PaO()+"max"+PaO()+"-1,min"+PaO()+"1,x)))}"); println(SCEOUTPUT,"Atan=atan"); - println(SCEOUTPUT,"Sqr<- function(x){if(x>=0){sqrt(x)}else{0}}"); + println(SCEOUTPUT,"Sqr<- function"+PPa("x")+"{if"+PaO()+"x>=0){sqrt"+PaO()+"x)}else{0}}"); println(SCEOUTPUT,"Factorial=factorial"); - println(SCEOUTPUT,"Norm<- function(x){norm(matrix(x,nrow=1),"+Dqq("2")+")}"); + println(SCEOUTPUT,"Norm<- function"+PPa("x")+"{norm"+PaO()+"matrix"+PaO()+"x,nrow=1),"+Dqq("2")+")}"); println(SCEOUTPUT,""); forall(COM0thlist, if(indexof(#,"Texcom")==0, //17.09.22 @@ -2902,7 +3030,7 @@ WritetoRS(filename,shchoice):=( ); ); println(SCEOUTPUT, - "Setwindow(c("+XMIN+","+XMAX+"), c("+YMIN+","+YMAX+"))"); + "Setwindow(c"+PaO()+XMIN+","+XMAX+"), c"+PaO()+YMIN+","+YMAX+"))"); forall(Plist, println(SCEOUTPUT,#); ); @@ -2914,7 +3042,7 @@ WritetoRS(filename,shchoice):=( if(islist(tmp1), tmp2="["; forall(tmp1, - tmp2=tmp2+textformat(#,6)+","; + tmp2=tmp2+Textformat(#,6)+","; ); tmp1=substring(tmp2,0,length(tmp2)-1)+"]"; , @@ -2924,27 +3052,27 @@ WritetoRS(filename,shchoice):=( tmp1=RSform(tmp1); print(SCEOUTPUT,tmp+"="+tmp1+";"); //17.09.22 // tmp=substring(tmp,0,length(tmp)-1); - println(SCEOUTPUT,"Assignadd('"+tmp+"',"+tmp+")"); + println(SCEOUTPUT,"Assignadd"+PaO()+"'"+tmp+"',"+tmp+")"); ); forall(FUNLIST, println(SCEOUTPUT,#); ); - forall(GLIST, + forall(GLIST, //no ketjs on println(SCEOUTPUT,RSform(#)); - ); + ); //no ketjs off tmp=text(Pnamelist); - tmp=replace(tmp,"[","list("); + tmp=replace(tmp,"[","list"+PaO()); Pnamelist=replace(tmp,"]",")"); println(SCEOUTPUT,"PtL="+Pnamelist); tmp=select(GCLIST,#_2==-1); GrL=apply(tmp,#_1); tmp=text(GrL); - tmp=replace(tmp,"[","list("); + tmp=replace(tmp,"[","list"+PaO()); tmp=replace(tmp,"]",")"); println(SCEOUTPUT,"GrL="+tmp); tmp1=""; if(length(tmp1)>0, - tmp1="WriteOutData(Fnameout"+tmp1+");"; + tmp1="WriteOutData"+PaO()+"Fnameout"+tmp1+");"; println(SCEOUTPUT,tmp1); ); forall(COM1stlist, @@ -2955,13 +3083,13 @@ WritetoRS(filename,shchoice):=( ); ); println(SCEOUTPUT,""); - println(SCEOUTPUT,"# Windisp(GrL)"); + println(SCEOUTPUT,"# Windisp"+PPa("GrL")); println(SCEOUTPUT,""); - println(SCEOUTPUT,"if(1==1){"); + println(SCEOUTPUT,"if"+PaO()+"1==1){"); println(SCEOUTPUT,""); tmp1=replace(Dirwork,"\","/"); //180408to if((iswindows())&(indexof(tmp1,"Users")>0), - println(SCEOUTPUT,"Path=paste(Path,"+Dqq("/"+Fnametex)+",sep='')"); + println(SCEOUTPUT,"Path=paste"+PaO()+"Path,"+Dqq("/"+Fnametex)+",sep='')"); tmp="Openfile(Path,'"+ULEN+"'"; , tmp="Openfile('"+tmp1+"/"+Fnametex+"','"+ULEN+"'"; @@ -2999,18 +3127,18 @@ WritetoRS(filename,shchoice):=( ); //180721to ); if(length(GrL)>0, - println(SCEOUTPUT," Drwline(GrL)"); + println(SCEOUTPUT," Drwline"+PPa("GrL")); ); - // println(SCEOUTPUT,"Closefile('"+ADDAXES+"')"); //181224(2line) - println(SCEOUTPUT,"Closefile("+Dqq("0")+")"); + // println(SCEOUTPUT,"Closefile"+PaO()+"'"+ADDAXES+"')"); //181224(2line) + println(SCEOUTPUT,"Closefile"+PaO()+""+Dqq("0")+")"); println(SCEOUTPUT,""); println(SCEOUTPUT,"}"); if(shchoice=="sh", println(SCEOUTPUT,""); - println(SCEOUTPUT,"quit()"); + println(SCEOUTPUT,"quit"+PPa("")); , println(SCEOUTPUT,""); - println(SCEOUTPUT,"#quit()"); + println(SCEOUTPUT,"#quit"+PPa("")); ); closefile(SCEOUTPUT); if(iswindows(), //180513from @@ -3020,14 +3148,14 @@ WritetoRS(filename,shchoice):=( tmp=Indexall(tmp1,"/"); tmp2=substring(tmp1,tmp_3-1,length(tmp1)); tmp1=substring(tmp1,0,tmp_3-1); - println(SCEOUTPUT,"Drv=shell('echo %HOMEDRIVE%',intern=TRUE)"); - println(SCEOUTPUT,"Drv=Drv[length(Drv)]"); - println(SCEOUTPUT,"Hpath=shell('echo %HOMEPATH%',intern=TRUE)"); - println(SCEOUTPUT,"Hpath=Hpath[length(Hpath)]"); + println(SCEOUTPUT,"Drv=shell"+PaO()+"'echo %HOMEDRIVE%',intern=TRUE)"); + println(SCEOUTPUT,"Drv=Drv[length"+PaO()+"Drv)]"); + println(SCEOUTPUT,"Hpath=shell"+PaO()+"'echo %HOMEPATH%',intern=TRUE)"); + println(SCEOUTPUT,"Hpath=Hpath[length"+PaO()+"Hpath)]"); println(SCEOUTPUT,"Rest="+Dqq(tmp2)); - println(SCEOUTPUT,"Path=paste(Drv,Hpath,Rest,sep='')"); - println(SCEOUTPUT,"setwd(Path)"); - println(SCEOUTPUT,"source('"+filename+"',encoding='UTF-8')"); + println(SCEOUTPUT,"Path=paste"+PaO()+"Drv,Hpath,Rest,sep='')"); + println(SCEOUTPUT,"setwd"+PaO()+"Path)"); + println(SCEOUTPUT,"source"+PaO()+"'"+filename+"',encoding='UTF-8')"); ); closefile(SCEOUTPUT); ); //180513to @@ -3071,21 +3199,21 @@ Extractdata(number,name,options):=( if(Noflg<3, println("extract outdata "+name); tmp1=parse(name); - tmp3=[ //17.09.18 - "Tmpout=ReadOutData("+Dq+File+Dq+")" + tmp3=[ //17.09.18 //no ketjs on + "Tmpout=ReadOutData("+Dq+File+Dq+")" ]; - GLIST=concat(GLIST,tmp3); + GLIST=concat(GLIST,tmp3); //no ketjs off ); if(Noflg<2, if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 + ); //no ketjs off + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("}");//180722 - ); - , + ); //no ketjs off + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -3175,11 +3303,11 @@ ReadOutData(pathorg,filenameorg,optionsorg):=( if(length(ptL)>0, if(length(ptL)==1, ptL=ptL_1; - tmp=apply(ptL,textformat(#,6)); + tmp=apply(ptL,Textformat(#,6)); , tmp="["; forall(ptL,tmp1, - tmp=tmp+apply(tmp1,textformat(#,6))+","; + tmp=tmp+apply(tmp1,Textformat(#,6))+","; ); tmp=substring(tmp,0,length(tmp)-1)+"]"; ); @@ -3189,7 +3317,7 @@ ReadOutData(pathorg,filenameorg,optionsorg):=( parse(varname+"="+tmp); outdt=append(outdt,ptL); ptL=[]; - varname=cmd; + varname=cmd; varL=append(varL,varname); ); ); @@ -3197,11 +3325,11 @@ ReadOutData(pathorg,filenameorg,optionsorg):=( if(length(ptL)>0, if(length(ptL)==1, ptL=ptL_1; - tmp=apply(ptL,textformat(#,6)); + tmp=apply(ptL,Textformat(#,6)); , tmp="["; forall(ptL,tmp1, - tmp=tmp+apply(tmp1,textformat(#,6))+","; + tmp=tmp+apply(tmp1,Textformat(#,6))+","; ); tmp=substring(tmp,0,length(tmp)-1)+"]"; ); @@ -3344,7 +3472,7 @@ Makeshell(texmainfile,flow):=( ); ); ); - if(flg==0, // 17.10.13(Norbert) + if(flg==0, // 17.10.13[Norbert] tex=PathT; path=""; ); @@ -3511,7 +3639,7 @@ Makebat(texmainfile,flow):=( ); ); ); - if(flg==0, // 17.10.13(Norbert) + if(flg==0, // 17.10.13[Norbert] tex=PathT; path=""; ); @@ -3597,7 +3725,7 @@ Usegraphics(gpack):=( //180817 //help:Usegraphics("pict2e"); if(!contains(ADDPACK,gpack), if(gpack =="tikz", //181213from - Addpackage(["pgf","tikz"]); + Addpackage(["pgf","tikz"]); //190101 , Addpackage([gpack]); ); //181213to @@ -3615,11 +3743,15 @@ Viewtex():=( SCEOUTPUT=openfile(texfile+".tex"); tmp="\documentclass{article}"; // 16.06.09from if(indexof(PathT,"platex")>0, - tmp=replace(tmp,"article","jarticle"); - if(indexof(PathT,"uplatex")>0, //17.08.13from - tmp=replace(tmp,"jarticle","ujarticle"); - );//17.08.13until - ); // 16.06.09until + if(GPACK=="tikz", + tmp="\documentclass[dvipdfmx]{article}"; // 190101 + , + tmp=replace(tmp,"article","jarticle"); + if(indexof(PathT,"uplatex")>0, //17.08.13from + tmp=replace(tmp,"jarticle","ujarticle"); + );//17.08.13to + ); + ); // 16.06.09to println(SCEOUTPUT,tmp); if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0), //181213from if(GPACK=="tpic", GPACK="pict2e"); @@ -3636,7 +3768,7 @@ Viewtex():=( ); ); if(GPACK=="tikz", - println(SCEOUTPUT,"\usepackage[pgf,tikz}");//16.11.24 +// println(SCEOUTPUT,"\usepackage{pgf,tikz}");//190101 println(SCEOUTPUT,"\usepackage{ketpic,ketlayer}"); if(indexof(PathT,"lualatex")>0, println(SCEOUTPUT,"\usepackage{luatexja}"); @@ -3930,7 +4062,7 @@ Makehelplist(libname):=( flg=0; forall(1..3, if(flg==0, - if(substring(cmdall_#,0,7)=="start()", + if(substring(cmdall_#,0,7)=="start"+PPa(""), cmdall=cmdall_((#+1)..length(cmdall)); flg=1; ); @@ -3940,7 +4072,7 @@ Makehelplist(libname):=( tmp=length(cmdall); forall(0..2, if(flg==0, - if(substring(cmdall_(tmp-#),0,5)=="end()", + if(substring(cmdall_(tmp-#),0,5)=="end"+PPa(""), cmdall=cmdall_(1..(tmp-#-1)); flg=1; ); @@ -4467,11 +4599,11 @@ Maketitle(name):=( println(SCEOUTPUT,"title::"+name+"//"); println(SCEOUTPUT,""); println(SCEOUTPUT,"%%%%%%%%%%%%%%%%//"); - println(SCEOUTPUT,"main::(title)//"); + println(SCEOUTPUT,"main::"+PaO()+"title)//"); println(SCEOUTPUT,"\slidepage[m]//"); println(SCEOUTPUT,""); println(SCEOUTPUT,"%%%%%%%%%%%%%%%%//"); - println(SCEOUTPUT,"new::(title)//"); + println(SCEOUTPUT,"new::"+PaO()+"title)//"); println(SCEOUTPUT,"%repeat=1,para//"); println(SCEOUTPUT,"\slidepage//"); println(SCEOUTPUT,""); @@ -4504,7 +4636,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( if(sestr=="", RepeatList_nn=append(RepeatList_nn,ss); ); - ); + ); if(sestr=="", seL=[1]; , @@ -4513,7 +4645,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( tmp1=replace(tmp1,"-,","1.."); tmp1="["+tmp1+"]"; //17.01.03 seL=flatten(parse(tmp1)); //17.01.03 - ); + ); if(contains(seL,1), if(substring(ss,0,1)!="%", //16.01.04 println(SCEOUTPUT,ss); @@ -4548,7 +4680,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( if(substring(str,0,1)!="%", if(NonThinFlg==0, if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15 - if(MiniFlg==0, //180526from + if(MiniFlg==0, //180526from println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}%");//180701 println(SCEOUTPUT,str); println(SCEOUTPUT,"}%"); @@ -4598,7 +4730,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( tmp=seL_nn; if(NonThinFlg==0, if(!contains(["\begi","\end{"],substring(str,0,5)),//180526from - if(MiniFlg==0, + if(MiniFlg==0, tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}%";//180701 tmp1=[tmp1,str,"}%"]; , @@ -4671,9 +4803,9 @@ Presentation(texfile,txtfile):=( // tmp=load(tmp1); //181125from tmp=readfile2str(Dirwork,tmp1); tmp=replace(tmp,"////","||||"); - tmp=replace(tmp,"/LF/::","::"); - tmp=replace(tmp,"///LF/","/LF/"); - slideL=tokenize(tmp,"/LF/"); //181125to + tmp=replace(tmp,"/L"+"F/::","::"); + tmp=replace(tmp,"///L"+"F/","/L"+"F/"); + slideL=tokenize(tmp,"/L"+"F/"); //181125to slideorgL=slideL; // 16.07.11 slideL=apply(slideL,Removespace(#)); tmp=select(1..length(slideL),length(slideL_#)>0); // 16.07.11from @@ -4891,7 +5023,7 @@ Presentation(texfile,txtfile):=( tmp1=""; tmp2=""; tmp3=""; - sld=removespace(slideL_ns); // 16.06.28 + sld=Removespace(slideL_ns); // 16.06.28 sestr=""; if((substring(sld,0,1)=="%") & (substring(sld,0,2)!="%%"), // 17.06.23 Repeatsameslide(repeatflg,"",[slideL_ns]); @@ -5034,7 +5166,7 @@ Presentation(texfile,txtfile):=( +text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize) +"}{\scriptsize $\mathstrut \!\rhd\!\!|$}}}}}"); ); - tmp="{"+text(LinkPosV)+"}{\hyperlink{para"; //180529(2lines) + tmp="{"+text(LinkPosV)+"}{\hyperlink{para"; //180529[2lines] tmp=tmp+text(paractr+1)+"pg"+text(1); tmp3=append(tmp3, text(LinkPosH)+"}"+tmp+"}{\fbox{\Ctab{" // 17.01.19 @@ -5044,7 +5176,7 @@ Presentation(texfile,txtfile):=( tmp3=apply(tmp3,tmp,"\putnotew{"+tmp); tmp4=concat(tmp4,tmp3);// 17.01.12to tmp="\putnotee{"+text(LinkPosH+1)+"}{"+text(LinkPosV)+"}";//180524 - tmp=tmp+"{\scriptsize\color{blue} "+text(#)+"/"+text(nrep)+"}"; //180524(blue) + tmp=tmp+"{\scriptsize\color{blue} "+text(#)+"/"+text(nrep)+"}"; //180524[blue] tmp4=append(tmp4,tmp); tmp4=concat(tmp4,["\end{layer}",""]);//16.12.31until Repeatsameslide(repeatflg,text([#]),tmp4); @@ -5056,7 +5188,7 @@ Presentation(texfile,txtfile):=( flg=1; ); //17.06.23to if(flg==0, - if(indexof(sld,"\begin{verbatim}")==1, // 16.06.28from + if(indexof(sld,"\begin{verbatim}")==1, // 16.06.28from Repeatsameslide(repeatflg,sestr,[slideL_ns]); verbflg=1; flg=1; @@ -5245,7 +5377,7 @@ Presentation(texfile,txtfile):=( ); if(flg==0&tmp1=="end"&(length(flgL)>0), //180526 tmp=flgL_(length(flgL)); - if(tmp=="i", + if(tmp=="i", Repeatsameslide(repeatflg,sestr,["\end{itemize}"]); ); if(tmp=="e", @@ -5329,7 +5461,7 @@ Mkslides():=( Dirwork=replace(Dirwork,"/",pathsep()); parent=replace(Dirwork+Batparent,"/",pathsep());// 16.05.29 ); - tmp=replace(Dirwork,pathsep()+"fig","");//180604(2lines) + tmp=replace(Dirwork,pathsep()+"fig","");//180604[2lines] Changework(tmp); Setdirectory(Dirwork); if(!iswindows(), //180604from @@ -5411,32 +5543,32 @@ Mkslidesummary(inputfile,outputfile,options):=( fout=outputfile; if(indexof(fout,".")==0,fout=fout+".tex"); cmdL=[ - "Dt=readLines('"+fin+"',encoding='UTF-8')",[], - "num=grep('hypertarget',Dt,fixed=TRUE)",[], //180412 - "Dt=Dt[setdiff(1:length(Dt),num)]",[], - "Smain=c();Snew=c();Ssame=c()",[], - "for(J in 1:length(Dt)){",[], - " Tmp=length(grep('mainslide{',Dt[J],fixed=TRUE))",[], //180412 - " if(Tmp>0){Smain=c(Smain,1)}else{Smain=c(Smain,0)}",[], - " Tmp=length(grep('newslide{',Dt[J],fixed=TRUE))",[], //180412 - " if(Tmp>0){Snew=c(Snew,1)}else{Snew=c(Snew,0)}",[], - " Tmp=length(grep('sameslide',Dt[J],fixed=TRUE))",[], //180412 - " if(Tmp>0){Ssame=c(Ssame,1)}else{Ssame=c(Ssame,0)}",[], + "Dt=readLines"+PaO()+"'"+fin+"',encoding='UTF-8')",[], + "num=grep"+PaO()+"'hypertarget',Dt,fixed=TRUE)",[], //180412 + "Dt=Dt[setdiff"+PaO()+"1:length"+PaO()+"Dt),num)]",[], + "Smain=c"+PPa("")+";Snew=c"+PPa("")+";Ssame=c"+PPa(""),[], + "for"+PaO()+"J in 1:length"+PaO()+"Dt)){",[], + " Tmp=length"+PaO()+"grep"+PaO()+"'mainslide{',Dt[J],fixed=TRUE))",[], //180412 + " if"+PaO()+"Tmp>0){Smain=c"+PaO()+"Smain,1)}else{Smain=c"+PaO()+"Smain,0)}",[], + " Tmp=length"+PaO()+"grep"+PaO()+"'newslide{',Dt[J],fixed=TRUE))",[], //180412 + " if"+PaO()+"Tmp>0){Snew=c"+PaO()+"Snew,1)}else{Snew=c"+PaO()+"Snew,0)}",[], + " Tmp=length"+PaO()+"grep"+PaO()+"'sameslide',Dt[J],fixed=TRUE))",[], //180412 + " if"+PaO()+"Tmp>0){Ssame=c"+PaO()+"Ssame,1)}else{Ssame=c"+PaO()+"Ssame,0)}",[], "}",[], - "Nnew=c();Nsame=c()",[], - "for(J in 1:length(Dt)){",[], - " if((Snew[J]==1)|(Smain[J]==1)){Nnew=c(Nnew,J)}",[], - " if(Ssame[J]==1){Nsame=c(Nsame,J)}",[], + "Nnew=c"+PPa("")+";Nsame=c"+PPa(""),[], + "for"+PaO()+"J in 1:length"+PaO()+"Dt)){",[], + " if"+PaO(2)+"Snew[J]==1)|"+PaO()+"Smain[J]==1)){Nnew=c"+PaO()+"Nnew,J)}",[], + " if"+PaO()+"Ssame[J]==1){Nsame=c"+PaO()+"Nsame,J)}",[], "}",[], "Out=Dt[1:Nnew[1]]",[], - "for(J in Looprange(2,length(Nnew))){",[], - " Tmp=max(c(1,Nsame[Nsame","<",unicode("0009")]; + out=[]; + if(substring(line,0,2)!="//", + pL=Indexall(line,"("); + forall(pL,jj, + flg=0; + if(contains(pL,jj-1), flg=1); + forall(reverse(1..(jj-1)), + if(flg==0, + if(#==1, + tmp=substring(line,0,1); + if(contains(sep,tmp), + tmp=substring(line,1,jj-1); + , + tmp=substring(line,0,jj-1); + ); + flg=1; + ); + ); + if(flg==0, + tmp=substring(line,#-1,#); + if(contains(sep,tmp), + tmp=substring(line,#,jj-1); + if(indexof(substring(line,0,#-1),"//")==0, + flg=1; + ); + ); + ); + ); + if((flg==1)&(length(tmp)>0), + out=append(out,tmp); + ); + ); + ); + out=remove(out,rmv); + tmp=out; + out=[]; + forall(tmp, + if(!contains(out,#),out=append(out,#)); + ); + out; +); +////%Findfun end//// + +////%Extractfun start//// +Extractfun(strL):=( + regional(nL,str,str2,start,sep,out,tmp,tmp1,tmp2); + out=[]; + forall(strL,str, + nL=Indexall(str,Dq); + str2=""; + start=0; + forall(1..(length(nL)/2), + tmp1=nL_(2*#-1); + str2=str2+substring(str,start,tmp1-1); + start=nL_(2*#); + ); + str2=str2+substring(str,start,length(str)); + fL=Findfun("csdraw",str2); + out=remove(out,fL); + out=concat(out,fL); + ); +); +////%Extractfun end//// + +//DL1=Readcsv(Dirhead+pathsep()+"ketcindyjs","basic1list.txt"); +//DL2=Readcsv(Dirhead+pathsep()+"ketcindyjs","basic2list.txt"); +//DL=concat(DL1,DL2); +//Out=[]; + +////%Extractall start//// +Extractall(name):=( + regional(fL,jj,tmp,tmp1,tmp2,tmp3); + fL=apply(Out,#_1); + tmp1=select(DL,#_1==name); + if(length(tmp1)>0, + tmp1=tmp1_1; + if(!contains(fL,tmp1), + Out=append(Out,tmp1); + fL=append(fL,tmp1_1); + if(length(tmp1)>=5, + forall(5..(length(tmp1)),jj, + tmp=tmp1_jj; + if(!contains(fL,tmp), + Extractall(tmp); + ); + ); + ); + ); + ); + tmp1=Out; + Out=[]; + forall(1..(length(tmp1)), + if(!contains(Out,tmp1_#), + Out=append(Out,tmp1_#); + ); + ); + Out; +); +////%Extractall end//// + +////%Copyketcindyjs start//// 190128 +Copyketcindyjs():=( + regional(tmp,tmp1,tmp2,drive,fname); + if(iswindows(), + drive="C:"; + fname=Dirhead; + tmp=indexof(fname,":"); + if(tmp>0, + drive=substring(Dirwork,0,tmp); + fname=substring(fname,tmp,length(fname)); + ); + kc():=( + println("kc : "+kc(Dirwork+Batparent,Dirlib,Fnametex)); // 16.06.04 + ); + SCEOUTPUT = openfile(Batparent); + println(SCEOUTPUT,drive); + println(SCEOUTPUT,"cd "+Dqq(fname)); + println(SCEOUTPUT,"set xcp="+Dqq("\Windows\System32\xcopy")); + tmp1=Dqq("%xcp%")+" /Y /Q /S /E /R "+Dqq("ketcindyjs\"); + tmp2=" "+Dqq(Dircdy+"ketcindyjs\"); + println(SCEOUTPUT,tmp1+"Cindy.js.map"+tmp2); + println(SCEOUTPUT,tmp1+"webfont.js"+tmp2); + println(SCEOUTPUT,tmp1+"katex-plugin.js"+tmp2); + println(SCEOUTPUT,tmp1+"Cindy.js"+tmp2); + println(SCEOUTPUT,tmp1+"CindyJS.css"+tmp2); + tmp1=Dqq("%xcp%")+" /Y /Q /S /E /R "+Dqq("ketcindyjs\katex\"); + tmp2=" "+Dqq(Dircdy+"ketcindyjs\katex\"); + println(SCEOUTPUT,tmp1+"katex.min.css"+tmp2); + println(SCEOUTPUT,tmp1+"katex.min.js"+tmp2); + tmp1=Dqq("%xcp%")+" /Y /Q /S /E /R "+Dqq("ketcindyjs\katex\fonts\"); + tmp2=" "+Dqq(Dircdy+"ketcindyjs\katex\fonts\"); + println(SCEOUTPUT,tmp1+"KaTeX_Main-Regular.ttf"+tmp2); + println(SCEOUTPUT,tmp1+"KaTeX_Main-Regular.woff"+tmp2); + println(SCEOUTPUT,tmp1+"KaTeX_Main-Regular.woff2"+tmp2); + println(SCEOUTPUT,tmp1+"KaTeX_Math-Italic.ttf"+tmp2); + println(SCEOUTPUT,tmp1+"KaTeX_Math-Italic.woff"+tmp2); + println(SCEOUTPUT,tmp1+"KaTeX_Math-Italic.woff2"+tmp2); + println(SCEOUTPUT,"exit 0"); + closefile(SCEOUTPUT); + , + kc():=( + println("kc : "+kc(Dirwork+Shellparent,Mackc+Dirlib,Fnametex)); + ); + SCEOUTPUT = openfile(Shellparent); + println(SCEOUTPUT,"#!/bin/sh"); + println(SCEOUTPUT,"cd "+Dqq(Dirhead)); + println(SCEOUTPUT,"cp -r -p ketcindyjs "+Dircdy+"/"); + println(SCEOUTPUT,"exit 0"); + closefile(SCEOUTPUT); + ); + kc(); +); +////%Coptketcindyjs end//// + +////%Ketjsoption start//// 190201 +Ketjsoption():=Setketcindyjs(); +Ketjsoption(list):=Setketcindyjs(list); +////%Ketjsoption end//// + +////%Setketcindyjs start//// 190201 +Setketcindyjs():=( + KETJSOP; +); +Setketcindyjs(list):=( +//help:Setketcindyjs(); +//help:Setketcindyjs(["Local=(n)","Scale=(1)","Nolabel=[]"]); + regional(eqL,color,tmp); + tmp=Divoptions(list); + eqL=tmp_5; + tmp=tmp_(length(tmp)); + tmp=substring(tmp,1,length(tmp)); + tmp=replace(tmp,"->","="); + parse(tmp); + tmp=round(255*color); + if(color!=[0,0,0],eqL=append(eqL,"Color="+text(tmp))); + KETJSOP=eqL; + KETJSOP; +); +////%Setketcindyjs end//// + +////%Mkketcindyjs start//// 190115 +Mkketcindyjs():=Mkketcindyjs(KETJSOP); //190129 +Mkketcindyjs(options):=( //17.11.18 +//help:Mkketcindyjs(); +//help:Mkketcindyjs(options=["Local=(n)","Scale=(1)","Nolabel=[]","Color=","Grid="]); +//help:Mkketcindyjs(optionsadd=["Web=(y)","Path=Dircdy"]); + regional(webflg,localflg,htm,htmorg,from,upto,flg,fL,fun,jj,tmp,tmp1,tmp2,tmp3, + lib1,lib2,jc,nn,name,partL,toppart,lastpart,path,ketflg,flg,cmdL,scale,nolabel, + color,grid,out,igL,DL,Out); + webflg="Y"; //190128 texflg removed + localflg="N"; //190128 + scale=1; //190129 + nolabel=["SW","NE"]; //190129 + color=""; + grid=""; + path=Dircdy; + forall(options, + tmp=Strsplit(#,"="); + tmp1=Toupper(substring(tmp_1,0,1)); + tmp2=tmp_2; + if(tmp1=="W", + webflg=Toupper(substring(tmp2,0,1)); + ); + if(tmp1=="L", + localflg=Toupper(substring(tmp2,0,1)); + ); + if(tmp1=="S", + scale=parse(tmp2); + ); + if(tmp1=="N", + tmp=tmp2; + if(indexof(tmp2,"[")>0, + tmp=substring(tmp2,1,length(tmp2)-1); + ); + tmp=tokenize(tmp,","); + nolabel=concat(nolabe,tmp); + ); + if(tmp1=="C", + color=tmp2; + if(substring(color,0,1)=="[", //190130from + color=substring(color,1,length(color)-1); + ); //190130to + ); + if(tmp1=="G", + grid=tmp2; + ); + if(tmp1=="P", + if(!tmp2="Dircdy", + path=tmp2; + ); + ); + ); + if((webflg=="N")&(localflg=="Y"), + if(!isexists(Dircdy,"ketcindyjs"), + Copyketcindyjs(); + println("ketcindyjs has been copied"); + ); + ); + if(!isexists(Dircdy,Fhead+".html"), + drawtext(mouse().xy-[0,1],"'Write/Rewrite to CindyJS' at first",size->24,color->[1,0,0]); + wait(3000); + , + htmorg=Readlines(Dircdy,Fhead+".html"); + tmp=select(1..(length(htmorg)),indexof(htmorg_#,"id="+Dqq("csdraw"))>0); + from=tmp_1+1; + flg=0; + forall(from..(length(htmorg)), + if(flg==0, + if(indexof(htmorg_#,"")>0, + upto=#-1; + flg=1; + ); + ); + ); + fL=Extractfun(htmorg_(from..upto)); + DL=Readcsv(Dirhead+pathsep()+"ketcindyjs","basic1list.txt"); + tmp=Readcsv(Dirhead+pathsep()+"ketcindyjs","basic2list.txt"); + DL=concat(DL,tmp); //DL and Out arenecessary for Extractall + Out=[]; + forall(fL,fun, + Extractall(fun); + ); + tmp=Readlines(Dirhead+pathsep()+"ketcindyjs","ignoredfun.txt"); + tmp=apply(tmp,Removespace(#)); //190131 + igL=select(tmp,(length(#)>0)&(substring(#,0,2)!="//")); //190131 + tmp1=select(Out,contains(igL,#_1)); + Out=remove(Out,tmp1); USEDFUN=apply(Out,#_1); //190130 + tmp1=select(1..(length(htmorg)),indexof(htmorg_#,"script id=")>0); + partL=[]; + forall(tmp1,nn, + from=nn; + tmp2=htmorg_from; + tmp=Indexall(tmp2,Dq); + name=substring(tmp2,tmp_1,tmp_2-1); + tmp=select((from+1)..(length(htmorg)),indexof(htmorg_#,"")>0); + upto=tmp_1; + partL=append(partL,[name,from,upto]); + ); + tmp=apply(partL,#_2); + tmp=min(tmp)-1; + toppart=[1,tmp]; + tmp=apply(partL,#_3); + tmp=max(tmp)+1; + lastpart=[tmp,length(htmorg)]; + if(webflg=="Y", + tmp1=Fhead+"json.html"; + , + tmp1=Fhead+"jsoff.html"; + ); + setdirectory(path); + SCEOUTPUT = openfile(tmp1); + tmp1=htmorg_((toppart_1)..(toppart_2)); + if(webflg=="N", + if(localflg=="N", //190128 + tmp3=replace(Dirhead+"/ketcindyjs/",pathsep(),"/"); + tmp= " "; + tmp1_(length(tmp1)-2)=tmp; + tmp= " "; + tmp1_(length(tmp1)-1)=tmp; + tmp=" "; //190203 + tmp1_(length(tmp1))=""; //190128to + ); + , + tmp1_(length(tmp1))=""; //190117to + ); + forall(tmp1, + println(SCEOUTPUT,#); + ); + tmp=""); + tmp=select(partL,#_1=="csdraw"); + tmp=tmp_1; + from=tmp_2; + upto=tmp_3; + tmp1=htmorg_(from..upto); + ketflg="off"; //190202from + forall(tmp1, + if(indexof(#,"no ketjs")>0, + if(indexof(#,"no ketjs on")>0, + ketflg="on"; + ); + if(indexof(#,"no ketjs off")>0, + ketflg="off"; + ); + , + if(ketflg=="off", + tmp=Removespace(#); + if(substring(tmp,0,2)!="//", + println(SCEOUTPUT,#); + ); + ); + ); + ); + tmp1=htmorg_((lastpart_1)..(lastpart_2)); + tmp=select(1..(length(tmp1)),indexof(tmp1_#,Dqq("cs*"))>0); + tmp=tmp_1; + forall(1..tmp, //190117from + println(SCEOUTPUT,tmp1_#); + ); + from=tmp+1; //190117to + tmp=" use: ["+Dqq("katex")+"],"; + println(SCEOUTPUT,tmp); + out=[]; //190129 + forall(from..(length(tmp1)),jj, + flg=0; //190126from + tmp2=["Figure","Parent","ParaF","Anime","Flip","Title","Slide","Digest", + "KeTJS","KeTJSoff","Objview"]; + if(indexof(tmp1_jj,"type: "+Dqq("Button"))>0, + nn=indexof(tmp1_jj,"text: "); + tmp=substring(tmp1_jj,nn-1,length(tmp1_jj)); + nn=Indexall(tmp,Dq); + tmp=substring(tmp,nn_1,nn_2-1); + if(!contains(tmp2,tmp), + out=append(out,tmp1_jj); //190129 + ); + flg=1; + ); + if(flg==0, + tmp=indexof(tmp1_jj,"type: "+Dq+"Free")+indexof(tmp1_jj,"type: "+Dq+"Point"); + if(tmp>0, + tmp2=tmp1_jj; + tmp=Indexall(tmp2,Dq); //190129from + tmp=substring(tmp2,tmp_1,tmp_2-1); + if(contains(nolabel,tmp), + if(indexof(tmp2,"labeled: true")>0, + tmp2=replace(tmp2,"labeled: true","labeled: false"); + ); + ); + if(indexof(tmp2,"size:")==0, + tmp2=replace(tmp2,"}",", size: 3.0}"); + out=append(out,tmp2); //190129 + , + out=append(out,tmp2); //190129 + ); //190129to + flg=1; + ); + ); + if(flg==0, + out=append(out,tmp1_jj); //190129 + ); //190126to + ); + tmp=select(1..(length(out)),indexof(out_#," ],")>0); //190129from + tmp=tmp_1; + tmp1=out_(tmp-1); + if(substring(tmp1,length(tmp1)-1,length(tmp1))==",", //190201from + out_(tmp-1)=substring(tmp1,0,length(tmp1)-1); + ); //190201to + tmp=select(1..(length(out)),indexof(out_#,"width:")>0); + jj=tmp_1; + tmp1=out_jj; + flg=0; + forall(1..(length(tmp1)-1), + if(flg==0, + tmp=substring(tmp1,#-1,#); + if(tmp==":", + tmp2=substring(tmp1,#+1,length(tmp1)-1); + flg=1; + ); + ); + ); + tmp=round(scale*parse(tmp2)); + out_jj=" width: "+text(tmp)+","; + tmp=select(1..(length(out)),indexof(out_#,"height:")>0); + jj=tmp_1; + tmp1=out_jj; + flg=0; + forall(1..(length(tmp1)-1), + if(flg==0, + tmp=substring(tmp1,#-1,#); + if(tmp==":", + tmp2=substring(tmp1,#+1,length(tmp1)-1); + flg=1; + ); + ); + ); + tmp=round(scale*parse(tmp2)); + out_jj=" height: "+text(tmp)+","; + if(length(color)>0, + tmp=select(1..(length(out)),indexof(out_#,"background: ")>0); + jj=tmp_1; + tmp=indexof(out_jj,")"); //190130from + tmp=substring(out_jj,tmp-1,length(out_jj)); + out_jj=" background: "+Dq+"rgb("+color+tmp; //190130to + ); + if(length(grid)>0, + tmp=select(1..(length(out)),indexof(out_#,"grid:")>0); + jj=tmp_1; + tmp1=" grid: "+grid; + if(indexof(out_jj,",")>0, + tmp1=tmp1+","; + ); + out_jj=tmp1; + ); + forall(out, + println(SCEOUTPUT,#); + ); //190129to + closefile(SCEOUTPUT); + setdirectory(Dirwork); + if(webflg=="Y",tmp="json",tmp="jsoff"); + drawtext(mouse().xy-[0,1],tmp+"in "+path,size->20,color->[1,0,0]); + wait(1000); + ); +); +////%Mkketcindyjs end//// + //help:end(); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt index 5760eda39a2..5a61f9a92e3 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt @@ -1,3 +1,19 @@ +// 20190127 + Gccexists changed (in case that PathC is full path in Mac/Windws) +// 20190126 +// Boxplot changed ( Pointdata[size] ) +// 20190125 +// Readcsv changed/debugged ( option "Head=" added. For 1 line data ) +// HIstplot, Boxplot changed (wait=5) +// 20190124 +// Gccexists added +// Sfcutparadata debugged (optionh) +// 20190123 +// Sfbdparadata,... debugged (in case of emply options,optionsh ) +// kcC chnage ( positon "-lm" changed for Mac/Linux ) +// 20181219 +// Rfun debugged ( Out=y ) +// CalcbyR debugged ( argment list changed to string) // 20181218 // Help (Sfbdparadata ,,,, ) // 20181217 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs index 946743bed6f..354cedc324e 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs @@ -14,7 +14,7 @@ // along with this program. If not, see // -println("ketcindylibout(20181218 loaded"); +println("ketcindylibout(20190127 loaded"); //help:start(); @@ -783,6 +783,7 @@ CalcbyR(name,path,cmd,optionorg):=( strL=tmp_7; dig=5; tmp=cmd_(length(cmd)-1); //181130from + if(!isstring(tmp),tmp=text(tmp)); //190109 if(indexof(tmp,"=")+indexof(tmp,"::")>0, cat="Y"; , @@ -1132,7 +1133,8 @@ Rfun(name,fun,argL,optionorg):=( cmdL=concat(cmdL,[ nm+"="+fun,argL, ]); - options=concat(options,["Wait=2"]); +// options=concat(options,["Wait=2"]); + options=concat(options,["Wait=2","Cat=y"]); //190109 CalcbyR(nm,cmdL,options); if(ErrFlag==0, if(disp==1, // 15.11.24 @@ -1179,10 +1181,6 @@ Readcsv(pathorg,file,optionorg):=( options=remove(options,[#]); ); ); -// if(tmp=="W", // removed:17.02.19 -// waiting=parse(tmp2); -// options=remove(options,[#]); -// ); if(tmp=="S", sep=tmp2; options=remove(options,[#]); @@ -1285,19 +1283,35 @@ Readcsv(pathorg,file,optionorg):=( ); ); ); -// New readcsv (181125) +// New readcsv [181125] Readcsv(file):=Readcsv(Dirwork,file); -Readcsv(path,file):=( +Readcsv(path,file):=Readcsv(path,file,[]); +Readcsv(path,file,options):=( //help:Readcsv("ex.csv"); //help:Readcsv(directory,"ex.csv"); -//help:Readcsv(options=["Head=yes","Sep=-999","Flat=no","Use=R"]); - regional(dt); +//help:Readcsv(options=["Head=no"]); + regional(dt,eqL,head,from,end,tmp); + tmp=Divoptions(options); + eqL=tmp_5; + head="n"; from=1; //190125from + forall(eqL, + tmp=Strsplit(#,"="); + if(Toupper(substring(tmp_1,0,1))=="H", + head=substring(tmp_2,0,1); + ); + ); + if(Toupper(head)=="Y", + from=2; + ); //190125to dt=readfile2str(path,file); dt=tokenize(dt,"/LF/"); + end=length(dt); if(dt_(length(dt))=="", - dt=dt_(1..(length(dt)-1)); + end=end-1; + dt=dt_(from..end); //190125 ); dt=apply(dt,tokenize(#,",")); + if(length(dt)==1, dt=dt_1); //190125 dt; ); ////%Readcsv end//// @@ -1567,7 +1581,7 @@ Boxplot(nm,dataorg,ypos,dy,optionorg):=( tmp=divoptions(options); eqL=tmp_5; strL=tmp_7; - waiting=3; + waiting=10; wrflg=0; forall(eqL, tmp=indexof(#,"="); @@ -1707,7 +1721,7 @@ Boxplot(nm,dataorg,ypos,dy,optionorg):=( out=bp_(6..length(bp)); if(length(out)>0, out=apply(out,[#,ypos]); - Pointdata(name+text(1),out,concat(options,[0,"Size=4"])); + Pointdata(name+text(1),out,concat(options,[0,"Size=2","Inside=white"])); //190125 ); pstr=substring(pstr,0,length(pstr)-1)+"]"; println("generate totally "+name); @@ -1732,7 +1746,7 @@ Histplot(nm,dataorg,optionorg):=( breaks = "breaks="+Dq+"Sturges"+Dq; density=0; relative=0; - waiting=3; + waiting=10; //190125 forall(eqL, tmp=Strsplit(#,"="); tmp1=Toupper(substring(tmp_1,0,1)); @@ -4756,140 +4770,6 @@ Frifun(name,fun,argL,optionorg):=( parse(nm); ); -Mkketcindyjs():=Mkketcindyjs("ketcindylib"); -Mkketcindyjs(Arg):=( - if(isstring(Arg), - Mkketcindyjs(Arg,[]) - , - Mkketcindyjs("ketcindylib",Arg) - ); -); -Mkketcindyjs(libname,options):=( //17.11.18 -//help:Mkketcindyjs(); -//help:Mkketcindyjs(options=["Tex=y","Net=y"]); - regional(texflg,netflg,tmp,tmp1,tmp2,dirfile,dirwork,dirketjs); - dirwork=replace(Dirwork,"\","/"); - tmp=replace(Dircdy,"\","/"); - if(substring(tmp,length(tmp)-1,length(tmp))=="/",//180411from - dirfile=substring(tmp,0,length(tmp)-1); - , - dirfile=tmp; - );//180411to - tmp=replace(Dirlib,"\","/"); - dirketjs=replace(tmp,"ketlib","ketcindyjs");//180411to - texflg="Y"; - netflg="Y"; - forall(options, - tmp1=Toupper(#); - if(indexof(tmp1,"TEX")>0, - tmp=indexof(tmp1,"="); - texflg=Toupper(substring(tmp1,tmp,tmp+1)); - ); - if(indexof(tmp1,"NET")>0, - tmp=indexof(tmp1,"="); - netflg=Toupper(substring(tmp1,tmp,tmp+1)); - ); - ); - if(isexists(dirfile,Fhead+".html"),//180411to - SCEOUTPUT = openfile(Fhead+".r"); - println(SCEOUTPUT,"Looprange<- function(a,b){"); - println(SCEOUTPUT," if (a<=b) return(a:b)"); - println(SCEOUTPUT," return(c())"); - println(SCEOUTPUT,"}"); - println(SCEOUTPUT,"setwd('"+dirketjs+"')"); - println(SCEOUTPUT,"Dtket=readLines('"+libname+".txt')"); - println(SCEOUTPUT,"setwd('"+dirfile+"')");//180411 - println(SCEOUTPUT,"Dtjs=readLines('"+Fhead+".html')"); - println(SCEOUTPUT,"Qt=rawToChar(as.raw(34))"); - println(SCEOUTPUT, - "Dtinit=c(paste('')"); - println(SCEOUTPUT,"Dthead=c()"); - println(SCEOUTPUT,"for(I in Looprange(1,length(Dtjs))){"); - println(SCEOUTPUT," if(length(grep('',sep='')"); - println(SCEOUTPUT, - " }"); - ); - println(SCEOUTPUT, - " Dthead=c(Dthead,Tmp)"); - println(SCEOUTPUT, - " }else{"); - println(SCEOUTPUT, - " Is=I; break"); - println(SCEOUTPUT, - " }"); - println(SCEOUTPUT, - "}"); - println(SCEOUTPUT,"Dt=c()"); - println(SCEOUTPUT,"for(I in Looprange(Is,length(Dtjs))){"); - println(SCEOUTPUT," Dt=c(Dt,Dtjs[I])"); - println(SCEOUTPUT," if(length(grep('',Dtjs[I],fixed=TRUE))>0){"); - println(SCEOUTPUT," if(length(grep('draw',Dt[1],fixed=TRUE))>0){Dtdraw=Dt}"); - println(SCEOUTPUT," if(length(grep('keytyped',Dt[1],fixed=TRUE))>0){Dtkey=Dt}"); - println(SCEOUTPUT," Dt=c()"); - println(SCEOUTPUT," if(length(grep('