[NTG-context] Setting to help with overflow in Metapost

2006-07-22 Thread dwarnold45
All,

This code is causing an overflow. Isn't there a setting that will allow bigger 
numbers? 

I am not looking for more code and/or rescaling code, but a setting that I know 
is there that will allow larger numbers.
%mode=short

\startcomponent section1exercises

\project book
\product chapter5/chapter5

\usemodule[newmat]
\usemodule[math=ext]
\usemodule[fig-base]
\usefigurebase[figures/figlibSection1]

\setupheadnumber[chapter][6]
\setupheadnumber[section][1]

\def\qor{\quad\text{or}\quad}
\def\qqor{\qquad\text{or}\qquad}
\def\qand{\quad\text{and}\quad}
\def\qqand{\qquad\text{and}\qquad}

\setupcolors[state=start]

\definecolor[gridlines][s=0.7]

\startMPinclusions

color mygridcolor; mygridcolor=\MPcolor{gridlines};
color gridlines; gridlines:=\MPcolor{gridlines};

def vtick(expr pos)=
 draw ((0,-3)--(0,3)) shifted pos;
enddef;

def htick(expr pos)=
 draw ((-3,0)--(3,0)) shifted pos;
enddef;

def opendot(expr pos)=
 fill fullcircle scaled 4pt shifted pos withcolor white;
 draw fullcircle scaled 4pt shifted pos withcolor red;
enddef;

def filleddot(expr pos)=
 fill fullcircle scaled 4pt shifted pos withcolor red;
 draw fullcircle scaled 4pt shifted pos withcolor red;
enddef;
\stopMPinclusions

\startuseMPgraphic{55_grid}
  for k=-5u step 1u until 5u:
   draw (k,-5u)--(k,5u) withcolor gridlines;
   draw (-5u,k)--(5u,k) withcolor gridlines;
  endfor;
\stopuseMPgraphic

\startuseMPgraphic{55_xy_axes}
 drawdblarrow (-5u,0)--(5u,0);
 label.rt(btex $\tfx x$ etex, (5u,0));
 label.bot(btex $\tfx 5$ etex, (5u,0));
 drawdblarrow (0,-5u)--(0,5u);
 label.top (btex $\tfx y$ etex, (0,5u));
 label.lft(btex $\tfx 5$ etex, (0,5u));
\stopuseMPgraphic

\startuseMPgraphic{1010_grid}
  for k=-10u step 1u until 10u:
   draw (k,-10u)--(k,10u) withcolor gridlines;
   draw (-10u,k)--(10u,k) withcolor gridlines;
  endfor;
\stopuseMPgraphic

\startuseMPgraphic{1010_xy_axes}
 drawdblarrow (-10u,0)--(10u,0);
 label.rt(btex $\tfx x$ etex, (10u,0));
 label.bot(btex $\tfx 10$ etex, (10u,0));
 drawdblarrow (0,-10u)--(0,10u);
 label.top (btex $\tfx y$ etex, (0,10u));
 label.lft(btex $\tfx 10$ etex, (0,10u));
\stopuseMPgraphic

\startuseMPgraphic{1010_xy_axes_ti}
 drawdblarrow (-10u,0)--(10u,0);
 label.rt(btex $\tfx x$ etex, (10u,0));
 label.bot(btex $\tfx 10$ etex, (10u,0));
 label.bot(btex $\tfx -10$ etex, (-10u,0));
 drawdblarrow (0,-10u)--(0,10u);
 label.top (btex $\tfx y$ etex, (0,10u));
 label.lft(btex $\tfx 10$ etex, (0,10u));
 label.lft(btex $\tfx -10$ etex, (0,-10u));
\stopuseMPgraphic

\startuseMPgraphic{05_grid}
  for k=0 step 1u until 5u:
   draw (k,0)--(k,5u) withcolor gridlines;
   draw (0,k)--(5u,k) withcolor gridlines;
  endfor;
\stopuseMPgraphic

\startuseMPgraphic{05_xy_axes}
 drawarrow (0,0)--(5u,0);
 label.rt(btex $\tfx x$ etex, (5u,0));
 label.bot(btex $\tfx 5$ etex, (5u,0));
 drawarrow (0,0)--(0,5u);
 label.top (btex $\tfx y$ etex, (0,5u));
 label.lft(btex $\tfx 5$ etex, (0,5u));
\stopuseMPgraphic


\startquestions

% Exercise #29
\beginquestion
\startquestion[ex:secqu.29]
  $p(x)=-x^6-4x^5+27x^4+78x^3+4x^2+376x-480$
\stopquestion
\endquestion

\beginlonganswer
\startanswer
%\startlinecorrection[blank]
%\midaligned{\externalfigure[q25v][width=0.4\textwidth]}
%\midaligned{\externalfigure[q25][width=0.4\textwidth]}
%\stoplinecorrection
\stopanswer
\endlonganswer

\beginshortanswer
\startanswer
Note that the leading term $-x^6$ (dashed) has the same end-behavior as the 
polynomial $p$.

\startbuffer

  %initialize scale and draw axes
  numeric u; 20ux=2in; 1uy=2in;
  drawdblarrow (-10ux,0)--(10ux,0);
  label.rt(btex $\tfx x$ etex, (10ux,0));
  label.bot(btex $\tfx -10$ etex, (-10ux,0));
  label.bot(btex $\tfx 10$ etex, (10ux,0));
  drawdblarrow (0,-5000uy)--(0,5000uy);
  label.top(btex $\tfx y$ etex, (0,5000uy));
  label.lft(btex $\tfx -5000$ etex, (0,-5000uy));
  label.lft(btex $\tfx 15$ etex, (0,5000uy));


  %leading term
  vardef lead(expr x)=
   -1*x*x*x*x*x*x
  enddef;

  %polynomial
  vardef p(expr x)=
   -1*x**6-4*x**5+27*x**4+78*x**3+4*x**2+376*x-480
  enddef;

  %path p_lead
  path p_lead;
  p_lead:=(-4.1352,lead(-4.1352));
  for x=-4.1352 step .1 until 4.1252:
   p_lead:=p_lead--(x,lead(x));
  endfor;
  p_lead:=p_lead--(4.1252,lead(4.1252));
  p_lead:=p_lead xyscaled(ux,uy);
  draw p_lead dashed evenly withcolor red;

  %path p_p
  path p_p;
  p_p:=(-6.5009,p(-6.5009));
  for x=-6.5009 step .1 until 5.3356 :
   p_p:=p_p--(x,p(x));
  endfor;
  p_p:=p_p--( 5.3356 ,p(5.3356));
  p_p:=p_p xyscaled(ux,uy);
  drawdblarrow p_p withcolor blue;
  label.rt(btex $\tfx p(x)=-x^6-4x^5+27x^4+78x^3+4x^2+376x-480$ etex, (5.3356 
,p(5.3356 )) xyscaled(ux,uy));
\stopbuffer

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

\stopanswer
\endshortanswer


% Exercise #30
\beginquestion
\startquestion[ex:secqu.30]
  $p(x)=2x^4-3x^3+x-10$
\stopquestion
\endquestion

\beginlonganswer[-]
\startanswer
\stopanswer
\endlonganswer

\beginshortanswer[-]
\startanswer
\stopanswer
\endshortanswer



\stopq

Re: [NTG-context] staticMPfigure & fonts

2006-07-22 Thread Renaud AUBIN
Hans Hagen a écrit :

>ah, i introduced so the name gets lost (btw, in your test file, the 
>label is wrong (i think)
>
>\def\dostartstaticMPfigure#1#2\stopstaticMPfigure
>  {\startstaticMPgraphic{\jobname-#1}#2\stopstaticMPgraphic
>   \def\MPgraphicfile{\jobname-#1}%
>   \doifmode{*\v!first}{\executesystemcommand
> {texmfstart --ifchanged=\MPgraphicfile.mp texexec --mpgraphic 
> \MPgraphicfile.mp}}%
>   \endgroup}
>  
>
Works great (fonts + static)... Thanks

Renaud
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] U3D (embedded 3D objects)

2006-07-22 Thread Renaud AUBIN




Hans Hagen a écrit :

  Renaud AUBIN wrote:
  
  
Hi all,

What's new on this topic ?
Since 3D is now supported by acroread linux, I would know if we can do 
that with ConTeXt... I'll take a look at 
https://sourceforge.net/projects/u3d in order to try to provide some 
samples...

R

  
  in principle context can support those things (given that pdftex provides access to the relevant structures but we can always extend that)

as usual, the problem is ... specs ... and in thsi case sample 3d files 

so, if you want this and are willing to filter/provide the info ... 

Hans 
  


Hi,

I have converted a CATIA 3D model of mine to u3d (the nice Mitsubishi
PA10 remodelled from a 2D drawing ;) ).
For test, I have try to embed it to a LaTeX document with movie15, here
is the source and the result
http://renojrl.lrv.uvsq.fr/testbed/u3d/pa10-movie15.tgz
(I have to get a better understanding of the views defs but it's not
the main problem)

Maybe this package and its doc can be a good startpoint ?

Renaud


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Scite for Windows -- Repeat command in Dos console

2006-07-22 Thread dwarnold45
All,

Anyone know how to repeat a command in the DOS console in Windows Scite? F3 
woks in a DOS box in XP, but that is reserved for something else in Scite.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Toggle output window open and closed in Scite

2006-07-22 Thread dwarnold45
All,

Anyone know how to toggle the output window open and closed in Scite?
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] modes with Scite

2006-07-22 Thread dwarnold45
All,

I am using the Scite editor provided by one of the Context dristributions.

Is there a way to include modes with one of the various compiling commands?
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] U3D (embedded 3D objects)

2006-07-22 Thread aubin
Selon Hans Hagen <[EMAIL PROTECTED]>:

> Renaud AUBIN wrote:
> > Hi all,
> >
> > What's new on this topic ?
> > Since 3D is now supported by acroread linux, I would know if we can do
> > that with ConTeXt... I'll take a look at
> > https://sourceforge.net/projects/u3d in order to try to provide some
> > samples...
> >
> > R
> in principle context can support those things (given that pdftex provides
> access to the relevant structures but we can always extend that)
>
> as usual, the problem is ... specs ... and in thsi case sample 3d files
>
> so, if you want this and are willing to filter/provide the info ...

I'm just working on this... I have succeeded in compiling U3D
viewer/converter/etc. for linux... I'll try to provide some custom made sample
from CAD program (windows or linux).

Another interesting point (web3d response to Intel's u3d ;) ),
http://www.web3d.org/news/releases/archives/2006/05/octaga_to_devel.php
since blender supports x3d export. But we have to wait (a bit ?) for the
plugin...

Renaud

>
> Hans
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>  | www.pragma-pod.nl
> -
>
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] U3D (embedded 3D objects)

2006-07-22 Thread Hans Hagen
Renaud AUBIN wrote:
> Hi all,
>
> What's new on this topic ?
> Since 3D is now supported by acroread linux, I would know if we can do 
> that with ConTeXt... I'll take a look at 
> https://sourceforge.net/projects/u3d in order to try to provide some 
> samples...
>
> R
in principle context can support those things (given that pdftex provides 
access to the relevant structures but we can always extend that)

as usual, the problem is ... specs ... and in thsi case sample 3d files 

so, if you want this and are willing to filter/provide the info ... 

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] New MyWay on arrowas

2006-07-22 Thread Hans Hagen
Aditya Mahajan wrote:
> Hi all,
>
>   Thanks to Hans and Taco, we now have extensible arrows in context. To 
> see how to use them, have a look at
>
> http://dl.contextgarden.net/myway/matharrows.pdf
>
>   
great 

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Charts, Graphs, Tufte, and ConTeXt

2006-07-22 Thread Hans Hagen
David Wooten wrote:
> There is a special (albeit not well furnished) place in my heart for 
> Tufte's /"Visual Display of Quantitative Information/", so I suppose I 
>   
fyi: there is a new tufte book (don't have it yet but i'm told that it's 
nice too)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] How to update ConTeXt

2006-07-22 Thread Hans Hagen
Arkady Shraer wrote:
> Hello,
>
> I just downloaded file cont-tmf.zip from pragma-ade site.
> Can I update my ConTeXt with the contents of the archive or I have to
> do other manipulations?
> I'm using tetex distribution in Ubuntu 6.06.
>   
cd to texmf-local (or its equivalent in Ubunto) and unzip the file there; then 
run texexec --make --all 

if you have a recent context, you can update with 

ctxtools --update 

which will download the xip, unpack it and remake the formats 

(if you are a mac user, just use gerbens installer to update) 

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] staticMPfigure & fonts

2006-07-22 Thread Hans Hagen
Renaud AUBIN wrote:
>
> I have updated to the alpha but the results doesn't need comments
> http://renojrl.lrv.uvsq.fr/testbed/static
>
> (
> comments ;) :
> - the static-test.mp is generated
> - the call \usestaticMPfigure does not work as seen in the pdf because 
> the mptopdf processing is apparently missing
> )
>
ah, i introduced so the name gets lost (btw, in your test file, the 
label is wrong (i think)

\def\dostartstaticMPfigure#1#2\stopstaticMPfigure
  {\startstaticMPgraphic{\jobname-#1}#2\stopstaticMPgraphic
   \def\MPgraphicfile{\jobname-#1}%
   \doifmode{*\v!first}{\executesystemcommand
 {texmfstart --ifchanged=\MPgraphicfile.mp texexec --mpgraphic 
\MPgraphicfile.mp}}%
   \endgroup}

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Charts, Graphs, Tufte, and ConTeXt

2006-07-22 Thread John R. Culleton
On Friday 21 July 2006 15:22, David Wooten wrote:
> Mojca Miklavec wrote:
> >> Thus I'm curious as to what others use... is R an efficient method to
> >> produce elegant charts? Is straight MetaPost preferable?
> >
> > With metapost you can surely achive most beautiful results and it is
> > not as difficult to learn as TeX-programming. Of course you might need
> > more time to draw what you need or to write your own set of macros,
> > but if you have high demands about quality this might be the way to
> > go.
> >
> > However, if you prefer doing it quicly using the existing tools (be
> > aware that you have to learn how to use those tools as well), R or
> > gnuplot might be an interesting choice. You'll be limited by the power
> > of those two tools, but in most cases they should suffice for the
> > normal usage.
> >
> > The gnuplot module is still in development (I've been just begging
> > Hans for help a few hours ago ;). Take a look at the demo section of
> > gnuplot (http://gnuplot.sourceforge.net/demo_4.1/) to see if it can
> > offer you what you want to do. In that case ask on the list again,
> > I'll give you further pointers how to use it with ConTeXt
> > (http://pub.mojca.org/gnuplot).
> >
> > But basically you can take any program to draw graphs and include the
> > resulting PDFs. I'm afraid that the macros from the paper which you
> > pointed to, use some PostScript code that cannot be handled as-is (you
> > need some conversion to PDF first) and I'm affraid that the effort put
> > into making it work woudn't pay off now that you have a great varienty
> > of other plotting programs, including metapost itself (esp. if the
> > package has never been released - you'll probably hardly get any
> > support for it).
> >
> > Mojca
>
> Thanks very much for your reply. Your advice seems strong, and in truth
> I have been intrigued by MetaPost for many years. This certainly seems a
> valid excuse to delve into it ;)
>
> David
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
I have always found Pstricks to be very useful. There is a module
m-pstric.tex 
that you can look at. 
-- 
John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 
http://wexfordpress.com


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] document structure (small bug)

2006-07-22 Thread Hans van der Meer
On Jul 22, 2006, at 14:19, Taco Hoekwater wrote:

> Hans van der Meer wrote:
>>
>>
>> No, I must be my fault, but even with the above help I cannot get it
>> working.
>> As far as I can figure out the value of \currentproduct seems NOT to
>> guard entry to the body of \startlocalenvironment[syllabus-s].
>
> This took a bit of digging, it appears to be a bug in core-job.tex.
> The definition of \setvalue{\e!start\v!localenvironment} ends with:
>
>   {\grabuntil{\e!stop\v!localenvironment}\relax}}
>
> but that should be:
>
>   {\grabuntil{\e!stop\v!localenvironment}\gobbleoneargument}}
>

This patch repairs it. Now \startlocalenvironment[syllabus-s] is  
properly entered when the argument matches the product. One more bug  
has been ironed out. But the fact that it took so long before it  
surfaced is telling, obviously not many people have used this  
mechanism since the manual came out!
Thanks for acting so fast.

Hans van der Meer



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] document structure (small bug)

2006-07-22 Thread Taco Hoekwater
Hi Hans-es,

Hans van der Meer wrote:
> 
> 
> No, I must be my fault, but even with the above help I cannot get it  
> working.
> As far as I can figure out the value of \currentproduct seems NOT to  
> guard entry to the body of \startlocalenvironment[syllabus-s].  

This took a bit of digging, it appears to be a bug in core-job.tex.
The definition of \setvalue{\e!start\v!localenvironment} ends with:

  {\grabuntil{\e!stop\v!localenvironment}\relax}}

but that should be:

  {\grabuntil{\e!stop\v!localenvironment}\gobbleoneargument}}


> Also \localenvironment seems to accept any  
> file for reading instead of rejecting everything except the current  
> product/component.

Yes, it only guards against loading the environment file twice. The
name is irrelevant.

> In the code of core-job.tex I read:
> 
> % more or less replaced by modes
> \setvalue{\e!start\v!localenvironment}[#1]%
> 
> 
> Must I conclude from this that localenvironments are more or less  
> passe? So that I can better avoid them and use modes (after
> \enablemode) as discriminating criterium?

There are probably system modes predefined for the products
name etc. I'll leave the question to be answered by Hans.

Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] document structure

2006-07-22 Thread Hans van der Meer

On Jul 22, 2006, at 10:19, Taco Hoekwater wrote:

> Hans van der Meer wrote:
>>>
>> Sorry, but I think I do not yet understand and I do not get it right.
>> Next is in a nutshell my setup of the environments, the relevant
>> projects are syllabus-s and syllabus-p
>
> My unsterstanding is that you do it like  this:
>
>% syllabys-s.tex
>\project syllabus
>\localenvironment syllabus-local-setup
>\starttext
>\stoptext
>
>% syllabys-p.tex
>\project syllabus
>\localenvironment syllabus-local-setup
>\starttext
>\stoptext
>
>% syllabus.tex:
>\environment syllabus-setup
>
>% syllabus-setup.tex
> \writestring{global env settings}
>
>% syllabus-local-setup.tex
>\startlocalenvironment[syllabus-s]
>  \writestring{this is only for the screen version}
>\stoplocalenvironment
>\startlocalenvironment[syllabus-p]
>  \writestring{this is only for the print version}
>\stoplocalenvironment
>
> (Untested)
>

No, I must be my fault, but even with the above help I cannot get it  
working.
As far as I can figure out the value of \currentproduct seems NOT to  
guard entry to the body of \startlocalenvironment[syllabus-s].  
Although the manual here explicitely mentions "component or product",  
I cannot see that happen. Also \localenvironment seems to accept any  
file for reading instead of rejecting everything except the current  
product/component.

In the code of core-job.tex I read:

% more or less replaced by modes
\setvalue{\e!start\v!localenvironment}[#1]%


Must I conclude from this that localenvironments are more or less  
passe? So that I can better avoid them and use modes (after  
\enablemode) as discriminating criterium?

Hans van der Meer


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] document structure

2006-07-22 Thread Taco Hoekwater
Hans van der Meer wrote:
>>
> Sorry, but I think I do not yet understand and I do not get it right.
> Next is in a nutshell my setup of the environments, the relevant  
> projects are syllabus-s and syllabus-p

My unsterstanding is that you do it like  this:

   % syllabys-s.tex
   \project syllabus
   \localenvironment syllabus-local-setup
   \starttext
   \stoptext

   % syllabys-p.tex
   \project syllabus
   \localenvironment syllabus-local-setup
   \starttext
   \stoptext

   % syllabus.tex:
   \environment syllabus-setup

   % syllabus-setup.tex
\writestring{global env settings}

   % syllabus-local-setup.tex
   \startlocalenvironment[syllabus-s]
 \writestring{this is only for the screen version}
   \stoplocalenvironment
   \startlocalenvironment[syllabus-p]
 \writestring{this is only for the print version}
   \stoplocalenvironment

(Untested)

Cheers, taco

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context