ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Help --- Arithmetic Overflow: Weird error
@ 2007-01-04  0:08 David Arnold
       [not found] ` <6faad9f00701031734x4bc9cacbn2e7f82ad32c1c62b@mail.gmail.com>
  0 siblings, 1 reply; 8+ messages in thread
From: David Arnold @ 2007-01-04  0:08 UTC (permalink / 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-01-04 10:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-04  0:08 Help --- Arithmetic Overflow: Weird error David Arnold
     [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

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).