ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Floris van Manen <vm@klankschap.nl>
To: ntg-context@ntg.nl
Subject: Re: weekend upload - stacking and animation
Date: Tue, 13 Jul 2021 16:11:04 +0200	[thread overview]
Message-ID: <91caf663-ad53-344c-4f1a-8bd7146d28c6@klankschap.nl> (raw)
In-Reply-To: <bc6b0490-0914-8a28-9179-c97834fb5fe4@xs4all.nl>



On 13/07/2021 15:14, Hans Hagen wrote:
> How about:
> 
> \startuseMPgraphic{demo}
>      for i=1 upto 10:
>          draw fullcircle scaled (i*cm/3)
>              withcolor (i*red/10)
>              withpen   pencircle scaled (bp/2)
>              withstacking i
>          ;
>      endfor ;
> \stopuseMPgraphic
> 
> \unprotect
> 
> \tolerant\protected\def\useMPanimation[#1]#2%
>    {\begingroup
>     \scratchtoks\emptytoks
> 
> \dorecurse{10}{\etoksapp\scratchtoks{{\useMPgraphic[\c!stacking={\recurselevel}]{#2}}}}% 
> 
>     \expanded{\startanimation[#1]\the\scratchtoks\stopanimation}%
>     \endgroup}
> 
> \protect
> 
> \setupinteraction[state=start]
> 
> \usemodule[animation]
> 
> \starttext
>      \useMPanimation[menu=yes]{demo}
> \stoptext

Placing this excerpt in a file and compiling it I get an error:


$ context animation.tex

resolvers       | formats | executing runner 'run luametatex format': 
/home/vm/context/tex/texmf-linux-64/bin/luametatex --jobname="animation" 
--fmt=/home/vm/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt 
--lua=/home/vm/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui 
cont-yes.mkiv --c:currentrun=1 --c:fulljobname="./animation.tex" 
--c:input="./animation.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:texmfbinpath="/home/vm/context/tex/texmf-linux-64/bin"
open source     > level 1, order 1, name 'cont-yes.mkiv'
fonts           > beware: no fonts are loaded yet, using 'lm mono' in box
system          >
system          > ConTeXt  ver: 2021.07.10 21:51 LMTX  fmt: 2021.7.12 
int: english/english
system          > system          > 'cont-new.mkxl' loaded
open source     > level 2, order 2, name 
'/home/vm/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system          > beware: some patches loaded from cont-new.mkiv
close source    > level 2, order 2, name 
'/home/vm/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system          > files > jobname './animation', input 
'./animation.tex', result './animation'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > level 2, order 3, name './animation.tex'
modules         > 'animation' is not found
fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
tex error       > tex error on line 31 in file ./animation.tex: 
Undefined control sequence

\startanimation [menu=yes]{\useMPgraphic 
[stacking={1}]{demo}}{\useMPgraphic [stacking={2}]{demo}}{\useMPgraphic 
[stacking={3}]{demo}}{\useMPgraphic [stacking={4}]{demo}}{\useMPgraphic 
[stacking={5}]{demo}}{\useMPgraphic [stacking={6}]{demo}}{\useMPgraphic 
[stacking={7}]{demo}}{\useMPgraphic [stacking={8}]{demo}}{\useMPgraphic 
[stacking={9}]{demo}}{\useMPgraphic [stacking={10}]{demo}}

<argument> \startanimation [menu=yes]\the \scratchtoks \stopanimation

<macro> \expanded #1->\xdef \m_syst_helpers_expanded {\noexpand #1
     }\m_syst_helpers_expanded
<macro> \useMPanimation [#1]#2->\begingroup \scratchtoks \emptytoks \par 
\dorecurse {10}{\etoksapp \scratchtoks {{\useMPgraphic [\c!stacking 
={\recurselevel }]{#2}}}}\expanded {\startanimation [#1]\the 
\scratchtoks \stopanimation }
     \endgroup

<line 4.31>     \useMPanimation[menu=yes]{demo}

21        \expanded{\startanimation[#1]\the\scratchtoks\stopanimation}%
22        \endgroup}
23
24     \protect
25
26     \setupinteraction[state=start]
27
28     \usemodule[animation]
29
30     \starttext
31 >>      \useMPanimation[menu=yes]{demo}
32     \stoptext
33
The control sequence at the end of the top line of your error message 
was never
\def'ed. You can just continue as I'll forget about whatever was undefined.
mtx-context     | fatal error: return code: 256

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-07-13 14:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.580.1626060721.1143.ntg-context@ntg.nl>
2021-07-12 19:29 ` weekend upload Jeong Dal
2021-07-12 20:00   ` Aditya Mahajan
2021-07-13 10:25 ` weekend upload - stacking and animation Jeong Dal
2021-07-13 13:14   ` Hans Hagen
2021-07-13 14:11     ` Floris van Manen [this message]
2021-07-13 15:02       ` Hans Hagen
2021-07-13 14:59   ` Wolfgang Schuster
2021-07-13 22:34     ` Jeong Dal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91caf663-ad53-344c-4f1a-8bd7146d28c6@klankschap.nl \
    --to=vm@klankschap.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).