On Thu, 13 May 2021, Henning Hraban Ramm wrote:
Am 11.05.2021 um 18:02 schrieb Aditya Mahajan
: Look at this old code on how hide such code behind a macro to have a clean interface:
https://github.com/adityam/mp-sketch/blob/master/mp-sketch.mp
Hi Aditya, I’m trying to include my additions into your code, but it doesn’t work.
numeric sketch_amount; sketch_amount := 3bp; numeric sketch_passes; sketch_passes := 5;
def sketchdraw expr p = do_sketchdraw(p if (path p): randomized sketch_amount fi) enddef;
def do_sketchdraw(expr p) text t = normaldraw p t ; enddef;
Now I want to draw that path several times.
If I understand it right, I can’t put that into "sketchdraw" because that leaves the end open for path additions like "withcolor".
But it also doesn’t work in "do_sketchdraw"; I thought it might like this:
A slightly different approach is needed. See attached. I also added a bit a error protection in case someone sets sketch_passes to be negative by mistake.
It may be interesting to rewrite these macros using the new key-value interface for metapost, so that something like this works:
\sketchdraw[amount=3bp, passes=5, transparency=yes] fullsquare scaled 1cm withcolor red; one resembles present-weird-001.pdf (in the doc tree) ... it was from
On 5/13/2021 6:36 PM, Aditya Mahajan wrote: the times one could rely on acrobat to jump around a large page ... i used that one for a presentation about mathml (decades ago) ... in times that the main question one got was "why use something else than latex for math" or "why use tex if you don't do math" which put context in a weird spot (but also permitted to come up with weird presentation styles that didn't look too tex) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------