ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: David Arnold <dwarnold45@cox.net>
Subject: Help --- Arithmetic Overflow: Weird error
Date: Wed, 3 Jan 2007 16:08:18 -0800	[thread overview]
Message-ID: <3AA7648D-D0A9-4F9B-B85C-6C977444DD82@cox.net> (raw)

All,

Anyone see what I am doing wrong here?

\setupcolors[state=start]

\definecolor[gridlines][s=0.7]

\startMPinclusions

color mygridcolor; mygridcolor=\MPcolor{gridlines};

\stopMPinclusions

\starttext

\startbuffer[one]

% initialize scale
numeric u; 10u=4cm;

% draw grid
for k=-5u step 1u until 5u:
     draw (-5u,k)--(5u,k) withcolor mygridcolor;
     draw (k,-5u)--(k,5u) withcolor mygridcolor;
endfor;

% draw axes
drawdblarrow (-5.2u,0)--(5.2u,0);
drawdblarrow (0,-5.2u)--(0,5.2u);

% label axes
label.rt(btex $\tfx x$ etex, (5.2u,0));
label.top(btex $\tfx y$ etex, (0,5.2.u));
label.bot(btex $\tfx 5$ etex, (5u,0));
label.lft(btex $\tfx 5$ etex, (0,5u));

%draw the given line and the parallel line
drawdblarrow (-5u,-4.5u)--(5u,0.5u) withcolor blue;
label.bot(btex $\tfx x-2y=4$ etex, (-5u,-4.5u));

%pairs
pair Q, R;
R:=(4u,0u);
Q:=(0u,-2u);

%labels
dotlabel.lrt(btex $\tfx R(4,0)$ etex, R);
dotlabel.lrt(btex $\tfx Q(0,-2)$ etex, Q);

\stopbuffer

\startbuffer[two]

% initialize scale
numeric u; 10u=4cm;

% draw grid
for k=-5u step 1u until 5u:
     draw (-5u,k)--(5u,k) withcolor mygridcolor;
     draw (k,-5u)--(k,5u) withcolor mygridcolor;
endfor;

% draw axes
drawdblarrow (-5.2u,0)--(5.2u,0);
drawdblarrow (0,-5.2u)--(0,5.2u);

% label axes
label.rt(btex $\tfx x$ etex, (5.2u,0));
label.top(btex $\tfx y$ etex, (0,5.2.u));
label.bot(btex $\tfx 5$ etex, (5u,0));
label.lft(btex $\tfx 5$ etex, (0,5u));

%draw the given line and the parallel line
drawdblarrow (-5u,-4.5u)--(5u,0.5u) withcolor blue;
label.bot(btex $\tfx x-2y=4$ etex, (-5u,-4.5u));
drawdblarrow (-4u,5u)--(1u,-5u) withcolor blue;

%pairs
pair P, Q, R;
P:=(-3u,3u);
Q:=(-3u,1u);
R:=(-2u,1u);
draw P--Q--R withpen pencircle scaled 1pt withcolor red;
label.lft(btex $\tfx \Delta y=-2$ etex, 0.5[P,Q]);
label.bot(btex $\tfx \Delta x=1$ etex, 0.5[Q,R]);

%labels
dotlabel.urt(btex $\tfx (-3,3)$ etex, P);

\stopbuffer

\startbuffer[combined]
   \startcombination[2*1]
     {\processMPbuffer[one]}{(a)}
     {\processMPbuffer[two]}{(b)}
   \stopcombination
\stopbuffer

\startlinecorrection[blank]
\midaligned{\getbuffer[combined]}
\stoplinecorrection

%\startlinecorrection[blank]
%\midaligned{\processMPbuffer[two]}
%\stoplinecorrection

\stoptext

I am getting this error:

! Arithmetic overflow.
<recently read> \@@raggedskipb

\setraggedness ...e \@@raggedskipa \@@raggedskipb
                                                   \hyphenpenalty  
\@@raggedsk...

\raggedcenter ->\setraggedness \middleraggedness
                                                  \setraggedskips 2 
\middlerag...

\@@align@@middle ...gedcenter \else \raggedcenter
                                                   \fi \fi
\next2 #1,->\dodosetupalign {#1}
                                 \doprocesscommaitem
\doprocesscommalist ...item \gobbleoneargument #1,
                                                   ]\relax \global  
\advance \...
...
l.3     {\processMPbuffer[two]}{(
                                  b)}
?

It doesn't seem to be the Metapost code, because if you uncomment and  
comment the last few lines like this:

%\startbuffer[combined]
%  \startcombination[2*1]
%    {\processMPbuffer[one]}{(a)}
%    {\processMPbuffer[two]}{(b)}
%  \stopcombination
%\stopbuffer
%
%\startlinecorrection[blank]
%\midaligned{\getbuffer[combined]}
%\stoplinecorrection

\startlinecorrection[blank]
\midaligned{\processMPbuffer[two]}
\stoplinecorrection


It compiles fine. So does this:

I'm stymied.

             reply	other threads:[~2007-01-04  0:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-04  0:08 David Arnold [this message]
     [not found] ` <6faad9f00701031734x4bc9cacbn2e7f82ad32c1c62b@mail.gmail.com>
2007-01-04  1:37   ` David Arnold
     [not found]     ` <6faad9f00701031745r5c7c3a61o3db50cb65f8912b5@mail.gmail.com>
2007-01-04  1:46       ` David Arnold
     [not found]         ` <6faad9f00701031801i6d7535efp484dbf9cd13d1888@mail.gmail.com>
2007-01-04  2:10           ` David Arnold
2007-01-04  2:41             ` Mojca Miklavec
     [not found]               ` <37742018-4D97-46D7-B874-B49151AD0EEF@cox.net>
     [not found]                 ` <6faad9f00701031945i1de26b4el4a315d25c3949382@mail.gmail.com>
2007-01-04  3:52                   ` David Arnold
     [not found]                     ` <6faad9f00701032003i1afe1377p29e78a15b78a9f9a@mail.gmail.com>
     [not found]                       ` <19E60BD8-EE2D-4CE5-BE98-2F33894D1DAF@cox.net>
     [not found]                         ` <6faad9f00701032019o13b55d5dkc0e639b8211a283a@mail.gmail.com>
2007-01-04  5:26                           ` David Arnold
2007-01-04 10:36             ` Rolf Marvin Bøe Lindgren

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=3AA7648D-D0A9-4F9B-B85C-6C977444DD82@cox.net \
    --to=dwarnold45@cox.net \
    --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).