diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-25 21:49:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-25 21:49:04 +0000 |
commit | 149bc3fbc5c7aac22d6f6439c5af590420f2b82d (patch) | |
tree | a7835e48b0e16a3a57e6078a85b81665ee404401 /Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs | |
parent | 9ddb2c44860e61a962778bcb5294315c3722db6b (diff) |
ketcindy (25dec18)
git-svn-id: svn://tug.org/texlive/trunk@49502 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs')
-rw-r--r-- | Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs | 207 |
1 files changed, 149 insertions, 58 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs index e96e1d36cce..c904a1d0fae 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 <http://www.gnu.org/licenses/> // -println("ketcindybasic2(20181125) loaded"); +println("ketcindybasic2(20181224) loaded"); //help:start(); @@ -499,16 +499,6 @@ MakeRarg(arglist):=( ); ////%MakeRarg end//// -////%Setax start//// -Setax(arglist):=( -//help:Setax(["l","x","e","y","n","O","sw"]); -//help:Setax([7,"nw"]); - regional(tmp); - tmp=MakeRarg(arglist); - Com1st("Setax("+tmp+")"); -); -////%Setax end//// - ////%Htickmark start//// Htickmark(arglist):=( //help:Htickmark([1,"1",2,"sw","2"]); @@ -589,22 +579,109 @@ Htick(px,lenorg,options):=( ); ////%Htick end//// +////%Setax start//// +Setax(arglist):=( +//help:Setax(["l","x","e","y","n","O","sw",]); +//help:Setax([7,"nw"]); +//help:Setax([8,linestyle,colorax,colorlabel]); + regional(st,nn,tmp); //181215from + st=1; nn=1; + if(isreal(arglist_1), + st=2; + nn=arglist_1; + ); + forall(st..(length(arglist)), + tmp=arglist_#; + if(length(tmp)>0,AXSTYLE_nn=tmp); + nn=nn+1; + ); //181215from +// tmp=MakeRarg(arglist); +// Com1st("Setax("+tmp+")"); +); +////%Setax end//// + ////%Drwxy start//// -Drwxy():=Drwxy([]); //180820from -Drwxy(options):=( +Drwxy():=Drwxy([]); +Drwxy(optionsorg):=( //help:Drwxy(); //help:Drwxy(options=["Origin=[0,0]","Xrng=","Yrng=","Ax=l,x,e,..."]); - regional(tmp); - tmp=""; - forall(options, - if(length(tmp)>0, - tmp=tmp+","+Dqq(#); - , - tmp=Dqq(#); + 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]; + ax=AXSTYLE; + linesty=ax_8; + if(isstring(ax_9),colorax=ax_9,colorax=text(ax_9)); + if(length(colorax)>0, + colorax="Color="+colorax; + ); + if(isstring(ax_10),colorla=ax_10,colorla=text(ax_10)); + if(length(colorla)>0, //181217from + colorla="Color="+colorla; + , + if(length(colorax)>0, + colorla=colorax; + ); + ); //181217to + forall(eqL, + tmp=Strsplit(#,"="); + tmp1=Toupper(substring(tmp_1,0,1)); + if(tmp1=="O", + org=parse(tmp_2); + options=remove(options,[#]); + ); + if(tmp1=="X", + xrng=parse(tmp_2); + options=remove(options,[#]); + ); + if(tmp1=="Y", + yrng=parse(tmp_2); + options=remove(options,[#]); + ); + if(tmp1=="A", + tmp2=tokenize(tmp_2,","); + st=1; nn=1; + if(isreal(tmp2_1), + st=2; + nn=tmp2_1; + ); + forall(st..(length(tmp2)), + tmp=tmp2_#; + if(length(tmp)>0,ax_nn=tmp); + nn=nn+1; + ); + options=remove(options,[#]); ); ); - Com2nd("Drwxy("+tmp+")"); //180820to - Addax(0); // 16.01.21 + options=append(options,linesty); //181216 + if(substring(ax_1,0,1)=="a", + 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) + 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]]; + Arrowdata("axx"+text(AXCOUNT),tmp,tmp1); + tmp=[[org_1,yrng_1],[org_1,yrng_2]]; + Arrowdata("axy"+text(AXCOUNT),tmp,tmp1); + , + tmp=[[xrng_1,org_2],[xrng_2,org_2]]; + tmp1=append(options,colorax);//181216 + Listplot("axx"+text(AXCOUNT),tmp,tmp1); + tmp=[[org_1,yrng_1],[org_1,yrng_2]]; + Listplot("axy"+text(AXCOUNT),tmp,tmp1); + ); + AXCOUNT=AXCOUNT+1; + 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 ); ////%Drwxy end//// @@ -651,7 +728,7 @@ Drawpoint(ptlistorg,nn):=( ////%Addax start//// Addax(param):=( //help:Addax(0); - ADDAXES=textformat(param,5); + ADDAXES=text(param); ); ////%Addax end//// @@ -676,6 +753,7 @@ Expr(listorg,options):=( //16.10.09 ////%Letter start//// Letter(Pt,Dr,St):=Letter([Pt,Dr,St]); Letter(list):=Letter(list,[]); +Letter(Pt,Dr,St,options):=Letter([Pt,Dr,St],options);//181218 Letter(list,options):=( //help:Letter([C,"c","Graph of $f(x)$"]); //help:Letter([C,"c","xy"],["size->30"]); @@ -812,6 +890,7 @@ Letterrot(pt,dir,tmov,nmov,str,options):=( ////%Exprrot start//// Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str,[]); +Expr(pt,dir,str,options):=Expr([pt,dir,str],options);//181218 Exprrot(pt,dir,Arg1,Arg2):=( if(islist(Arg2), Exprrot(pt,dir,"t0n0",Arg1,Arg2); @@ -2649,6 +2728,10 @@ Inwindow(point,xrng,yrng):=( ////%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, @@ -2786,18 +2869,30 @@ WritetoRS(filename,shchoice):=( println(SCEOUTPUT,"setwd('"+tmp1+"')"); );//180409to tmp=replace(Libname,"\","/"); //17.09.24from - println(SCEOUTPUT,"source('"+tmp+".r')");//temporary - if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0) - %(GPACK=="pict2e"), // 180817 + println(SCEOUTPUT,"source('"+tmp+".r')"); //181213 + if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0), + if(GPACK=="tpic",GPACK="pict2e"); + ); + if(GPACK=="pict2e", // 180817 tmp=replace(tmp+"_rep2e","\","/"); println(SCEOUTPUT,"source('"+tmp+".r')"); ); + if(GPACK=="tikz", //181213from + tmp=replace(tmp+"_reptikz","\","/"); + println(SCEOUTPUT,"source('"+tmp+".r')"); + ); //181213to println(SCEOUTPUT,"Ketinit()"); println(SCEOUTPUT,"cat(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,"Atan=atan"); + println(SCEOUTPUT,"Sqr<- function(x){if(x>=0){sqrt(x)}else{0}}"); + println(SCEOUTPUT,"Factorial=factorial"); + println(SCEOUTPUT,"Norm<- function(x){norm(matrix(x,nrow=1),"+Dqq("2")+")}"); println(SCEOUTPUT,""); forall(COM0thlist, if(indexof(#,"Texcom")==0, //17.09.22 @@ -2906,7 +3001,8 @@ WritetoRS(filename,shchoice):=( if(length(GrL)>0, println(SCEOUTPUT," Drwline(GrL)"); ); - println(SCEOUTPUT,"Closefile('"+ADDAXES+"')"); + // println(SCEOUTPUT,"Closefile('"+ADDAXES+"')"); //181224(2line) + println(SCEOUTPUT,"Closefile("+Dqq("0")+")"); println(SCEOUTPUT,""); println(SCEOUTPUT,"}"); if(shchoice=="sh", @@ -3498,9 +3594,13 @@ Addpackage(packorg):=( ////%Usegraphics start//// Usegraphics(gpack):=( //180817 -//help:Usegrapchics("pict2e"); +//help:Usegraphics("pict2e"); if(!contains(ADDPACK,gpack), - Addpackage([gpack]); + if(gpack =="tikz", //181213from + Addpackage(["pgf","tikz"]); + , + Addpackage([gpack]); + ); //181213to ); GPACK=gpack; ); @@ -3521,36 +3621,27 @@ Viewtex():=( );//17.08.13until ); // 16.06.09until println(SCEOUTPUT,tmp); - if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0) - %(GPACK=="pict2e"), //16.11.23,12.16,180817 - if(indexof(PathT,"pdflatex")>0, - println(SCEOUTPUT,"\usepackage[pdftex]{pict2e}");//16.11.24 - , - println(SCEOUTPUT,"\usepackage{pict2e}");//16.12.16 - if(indexof(PathT,"lualatex")>0, //180817 - println(SCEOUTPUT,"\usepackage{luatexja}"); - ); - ); - tmp=replace(Dirhead,"\","/"); //17.10.30from - tmp=replace(tmp,"scripts","tex/latex"); - if(isexists(tmp,""), - println(SCEOUTPUT,"\usepackage{ketpic2e,ketlayer2e}"); - , - tmp=replace(Dirhead+"/ketpicstyle","\","/"); - println(SCEOUTPUT,"\usepackage{"+tmp+"/ketpic2e}"); - println(SCEOUTPUT,"\usepackage{"+tmp+"/ketlayer2e}"); - ); - , + if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0), //181213from + if(GPACK=="tpic", GPACK="pict2e"); + ); + if(GPACK=="tpic", tmp=replace(Dirhead,"\","/"); - tmp=replace(tmp,"scripts","tex/latex"); - if(isexists(tmp,""), - println(SCEOUTPUT,"\usepackage{ketpic,ketlayer}"); - , - tmp=replace(Dirhead+"/ketpicstyle","\","/"); - println(SCEOUTPUT,"\usepackage{"+tmp+"/ketpic}"); - println(SCEOUTPUT,"\usepackage{"+tmp+"/ketlayer}"); + println(SCEOUTPUT,"\usepackage{ketpic,ketlayer}"); + ); + if(GPACK=="pict2e", + println(SCEOUTPUT,"\usepackage{pict2e}"); + println(SCEOUTPUT,"\usepackage{ketpic2e,ketlayer2e}"); + if(indexof(PathT,"lualatex")>0, + println(SCEOUTPUT,"\usepackage{luatexja}"); + ); + ); + if(GPACK=="tikz", + println(SCEOUTPUT,"\usepackage[pgf,tikz}");//16.11.24 + println(SCEOUTPUT,"\usepackage{ketpic,ketlayer}"); + if(indexof(PathT,"lualatex")>0, + println(SCEOUTPUT,"\usepackage{luatexja}"); ); - );//17.10.30until + );//181213to println(SCEOUTPUT,"\usepackage{amsmath,amssymb}"); println(SCEOUTPUT,"\usepackage{graphicx}"); println(SCEOUTPUT,"\usepackage{color}"); @@ -5448,7 +5539,7 @@ BBdata(fname,optionorg):=( if(iswindows(), kcfile="kc.bat"; , - if(macosx(), + if(ismacosx(), //181219 kcfile="kc.command"; , kcfile="kc.sh"; |