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.
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to