Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
/* * This file: * http://anggtwu.net/MAXIMA/myqdraw1.mac.html * http://anggtwu.net/MAXIMA/myqdraw1.mac * (find-angg "MAXIMA/myqdraw1.mac") * Author: Eduardo Ochs <eduardoochs@gmail.com> * * (defun e () (interactive) (find-angg "MAXIMA/myqdraw1.mac")) * (find-angg "MAXIMA/barematrix1.mac" "includegraphics") * (find-angg ".maxima/maxima-init.mac" "load_qdraw") * * «.myapply» (to "myapply") * «.mylabels» (to "mylabels") * «.mylabels-tests» (to "mylabels-tests") * «.includegraphics» (to "includegraphics") * «.includegraphics-tests» (to "includegraphics-tests") * «.myQdraw-pdf» (to "myQdraw-pdf") * «.myQdraw-pdf-tests» (to "myQdraw-pdf-tests") */ load_qdraw(); myqdraw0([lists]) := apply('qdraw, flatten([lists])); myqdraw ([lists]) := block([], myqdraw_body : lists, apply('myqdraw0, lists)); /* * «myapply» (to ".myapply") * (find-es "maxima" "myapply") */ butlast (L) := firstn(L, length(L)-1); expandlast (L) := append(butlast(L), last(L)); flattenlast (L) := append(butlast(L), flatten([last(L)])); myapply (f,[L]) := apply(f, expandlast(L)); myapply1 (f, L ) := apply(f, expandlast(L)); myapply1_fl(f, L ) := apply(f, flattenlast(L)); /* * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) ** (find-angg "MAXIMA/myqdraw1.mac") load ("~/MAXIMA/myqdraw1.mac"); apply (foo, [[2,3],[4,5]]); myapply (foo, [2,3],[4,5], [[6,7],[8,9]] ); myapply1 (foo, [[2,3],[4,5], [[6,7],[8,9]]]); myapply1_fl(foo, [[2,3],[4,5], [[6,7],[8,9]]]); */ /* «mylabels» (to ".mylabels") * (find-es "maxima" "qdraw-label") */ mylabel (strxy, opts) := apply('label, [append([concat("",strxy[1]), strxy[2], strxy[3]], opts)]); mylabels(strxys,[opts]) := makelist(mylabel(strxy,opts), strxy, strxys); /* «mylabels-tests» (to ".mylabels-tests") * * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) ** (find-angg "MAXIMA/myqdraw1.mac") load ("~/MAXIMA/myqdraw1.mac"); mylabel ( [2,3,4], [lc(blue)]); mylabels([[2,3,4],[5,6,7]],lc(blue), lc(red)); strxys : create_list([10*x+y,x,y], x, [2,3,4], y, [1,2,3]); myqdraw(xr(0,5),yr(0,4), more(proportional_axes=xy), label_align(c), mylabels(strxys, lc(red)) ); */ /* «includegraphics» (to ".includegraphics") * (find-es "maxima" "texput-includegraphics") */ /* includegraphics_dir : "2024-1-C3/"; */ includegraphics_dir : "2024-2-C3/"; includegraphics_fmt1(o) := apply('includegraphics_fmt, args(o)); includegraphics_fmt (opts, stem) := format("\\includegraphics[~a]{~a~a.pdf}", opts, includegraphics_dir, stem)$ includegraphics_qdraw_stem(stem) := format("~~/LATEX/~a~a", includegraphics_dir, stem)$ texput('includegraphics, 'includegraphics_fmt1); /* «includegraphics-tests» (to ".includegraphics-tests") * * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) ** (find-angg "MAXIMA/myqdraw1.mac") load ("~/MAXIMA/myqdraw1.mac"); includegraphics_fmt ("height=2cm", "foo"); includegraphics_fmt1(bla("height=2cm", "foo")); includegraphics_qdraw_stem ("foo"); includegraphics ("height=2cm", "foo"); tex (includegraphics ("height=2cm", "foo")); tex1(includegraphics ("height=2cm", "foo")); */ /* «myQdraw-pdf» (to ".myQdraw-pdf") */ myQdraw_terminalpdf(stem) := more(terminal=pdf, file_name=includegraphics_qdraw_stem(stem))$ myQdraw_draw(stem,opts,[lists]) := apply('myqdraw, lists)$ myQdraw_pdf (stem,opts,[lists]) := (apply('myqdraw,[lists, myQdraw_terminalpdf(stem)]), includegraphics(opts,stem))$ myps_scale : 5; /* In find-Maxima2-links the order below is inverted */ myQdraw([args]) := apply('myQdraw_pdf, args)$ myQdraw([args]) := apply('myQdraw_draw, args)$ /* «myQdraw-pdf-tests» (to ".myQdraw-pdf-tests") * * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) ** (find-angg "MAXIMA/myqdraw1.mac") load ("~/MAXIMA/myqdraw1.mac"); "Try in different orders:"$ myQdraw([args]) := apply('myQdraw_draw, args)$ myQdraw([args]) := apply('myQdraw_pdf, args)$ maxy : 2; maxy : 3; myQdraw("test", "height=2cm", xr(0,2*%pi), yr(-2,maxy), more(proportional_axes=xy), ex([sin(x), cos(x)], x,0,2*%pi) ); ** (find-fline "~/LATEX/2024-1-C3/" "test.pdf") ** (find-pdf-page "~/LATEX/2024-1-C3/test.pdf") # (find-efunction 'find-Maxima2-links) # (find-Maxima2-links "blockname") */ /* * Local Variables: * coding: utf-8-unix * End: */