ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: macro that does not work (Metapost)
Date: Tue, 11 Feb 2020 11:50:57 +0100	[thread overview]
Message-ID: <CACyK-eri-B74w28H_jujYB96YWck6GYCD34E_6WPm7gEMrdcbw@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2430 bytes --]

Hi,
I have some problems with the following macro :

tex error       > mp error on line 23 in file /home/viserion/macro.tex:

! Missing argument to suite.
<to be read again>
{
<*> suite{
1,0}; suite(2,1); ;
That macro has more parameters than you thought.
I'll continue by pretending that each missing argument
is either zero or null.

! Missing argument to suite.
<to be read again>
{
<*> suite{
1,0}; suite(2,1); ;
That macro has more parameters than you thought.
I'll continue by pretending that each missing argument
is either zero or null.

! Extra tokens will be flushed.
<to be read again>
{
<*> suite{
1,0}; suite(2,1); ;
I've just read as much of that statement as I could fathom,
so a semicolon should have been next. It's very puzzling...
but I'll try to get myself back together, by ignoring
everything up to the next `;'. Please insert a semicolon
now in front of anything that you don't want me to delete.
(See Chapter 27 of The METAFONTbook for an example.)

[1]

13       enddef;
14     \stopMPcode
15     \starttext
16      On présente ci-dessous deux suites de dessins.
17           \startlinecorrection[blank]
18             \startmidaligned
19               \startcombination[2*1]
20                 {\startMPcode
21                   suite{1,0};
22                   suite(2,1);
23 >>               \stopMPcode}{\tfxx \bf Suite 2}
24           \stopcombination
25             \stopmidaligned
26           \stoplinecorrection
27     \stoptext

mtx-context     | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Tue Feb 11 11:45:53

##################################################
macro.tex
##################################################

\startMPcode
  def suite (expr n, t) =
  begingroup
   numeric u;
   u := 5mm;
   pickup pencircle scaled 4pt;
   for i=0 upto n:
     for j=0 upto n:
         drawdot (i*u,j*u) shifted(t*u,0) withcolor darkred;
     endfor
   endfor
  endgroup
  enddef;
\stopMPcode
\starttext
 On présente ci-dessous deux suites de dessins.
      \startlinecorrection[blank]
        \startmidaligned
          \startcombination[2*1]
            {\startMPcode
              suite{1,0};
              suite(2,1);
             \stopMPcode}{\tfxx \bf Suite 2}
      \stopcombination
        \stopmidaligned
      \stoplinecorrection
\stoptext


Thank you.
Fabrice

[-- Attachment #1.2: Type: text/html, Size: 4885 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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:[~2020-02-11 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 10:50 Fabrice Couvreur [this message]
2020-02-11 12:08 ` Hans Hagen
2020-02-11 12:19   ` Fabrice Couvreur
2020-02-11 13:00     ` Mikael P. Sundqvist
2020-02-11 20:40       ` Fabrice Couvreur

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=CACyK-eri-B74w28H_jujYB96YWck6GYCD34E_6WPm7gEMrdcbw@mail.gmail.com \
    --to=fabrice1.couvreur@gmail.com \
    --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).