Re: [NTG-context] Passing text to Metapost functions

2005-12-27 Thread Taco Hoekwater

David Arnold wrote:

Hans,

I've tried various things without much success. I cannot seem to  access 
the contents of xlbl below.


Is this approach ever going to work?


I can make your example work by passing the argument as
a true metapost string:

  * remove the \MPstring command: draw textext.origin(xlbl);
  * create_axes(xmin,xmax,ymin,ymax,ux,uy)(x);

But it is out of sync: you always have to call texexec twice
whenever you make changes.

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


Re: [NTG-context] smaller symbol

2005-12-27 Thread Taco Hoekwater

Ciro Soto wrote:

Invisible Friends:

I am trying to use \ll and \gg instead of quotation marks.
The problem is that they are too big for my taste.
What would be the easiest way to make them, say 0.75\bodyfontsize ?


Don't you want \leftguillemot and \rightguillemot?

Anyway, there are fake ones based omn \ll and \gg, these should
be what you had in mind: \fakeleftguillemot, \fakerightguillemot

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


Re: [NTG-context] image command in Metapost

2005-12-27 Thread Taco Hoekwater

David Arnold wrote:

What does the image command do? Where is it documented?


It executes a set of commands and creates an expression of
type picture from them. It is defined in the plain macros.

Cheers,
Taco


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


Re: [NTG-context] \definedescription question

2005-12-27 Thread Taco Hoekwater

VnPenguin wrote:

On 12/26/05, Willi Egger [EMAIL PROTECTED] wrote:


No, it does not work for me :(


There has been a patch to this core recently. Will investigate.

Taco



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


Re: [NTG-context] image command in Metapost

2005-12-27 Thread David Arnold

Perfect. Thanks. :-)

On Dec 27, 2005, at 12:19 AM, Taco Hoekwater wrote:


David Arnold wrote:

What does the image command do? Where is it documented?


It executes a set of commands and creates an expression of
type picture from them. It is defined in the plain macros.

Cheers,
Taco


___
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] Passing text to Metapost functions

2005-12-27 Thread David Arnold
OK. But I need it set as btex $x$ etex at the right end of the  
horizontal axis.


On Dec 27, 2005, at 12:09 AM, Taco Hoekwater wrote:


David Arnold wrote:

Hans,
I've tried various things without much success. I cannot seem to   
access the contents of xlbl below.

Is this approach ever going to work?


I can make your example work by passing the argument as
a true metapost string:

  * remove the \MPstring command: draw textext.origin(xlbl);
  * create_axes(xmin,xmax,ymin,ymax,ux,uy)(x);

But it is out of sync: you always have to call texexec twice
whenever you make changes.

Cheers,
Taco
___
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] Columns (text alignment)

2005-12-27 Thread Fabio Mancinelli

Peter Rolf wrote:


I attach my working example.


Thank you Peter!
Your example has been enlightening.

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


Re: [NTG-context] Passing text to Metapost functions

2005-12-27 Thread Taco Hoekwater



David Arnold wrote:
OK. But I need it set as btex $x$ etex at the right end of the  
horizontal axis.


I'm not going to fiddle with the right end for you, but
You can make it $x$ by:

   create_axes(xmin,xmax,ymin,ymax,ux,uy)($x$);

Cheers, Taco

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


Re: [NTG-context] \definedescription question

2005-12-27 Thread Taco Hoekwater



VnPenguin wrote:

On 12/26/05, Willi Egger [EMAIL PROTECTED] wrote:





No, it does not work for me :(


After checking, it turns out it works for me as well. I have:

 tex : pdfeTeXk, 3.141592-1.30.3-2.2 (Web2C 7.5.5)
 context : ver: 2005.12.19
 cont-en : ver: 2005.12.19  fmt: 2005.12.22  mes: english

So perhaps something else is wrong. What is your log file?

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


[NTG-context] no 'D' in math-eul.tex

2005-12-27 Thread Johan Sandblom
In May I discovered that there was a typo in math-eul.tex rendering
the lower-case 'd' an 'e'. Amazingly, the same problem occurs also for
the upper-case 'D', and requires changing the line

\definemathcharacter [D] [nothing] [mr] [45]

into

\definemathcharacter [D] [nothing] [mr] [44]

Apparently this beautiful font is severely underused to allow this
typo to survive!

Regards, Johan
--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
What is wanted is not the will to believe, but the
will to find out, which is the exact opposite
- Bertrand Russell
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Weird things...

2005-12-27 Thread Taco Hoekwater

Fabio Mancinelli wrote:

Why this happens?


Because an interal ConTeXt macro (\dododosetlayer) is calling
a TeX primitive (\chardef) with a number that is higher than 256.
That number has become so high because of the columnset
definitions, which is why changing the ordering fixed it.

A full fix of the bug requires some work, simply changing that
one \chardef didn't cut it (the 'bad character code' moves
elsewhere).

Cheers,

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


Re: [NTG-context] smaller symbol

2005-12-27 Thread Ciro Soto
Thank you Taco and Mojca.
I had tried with \guillemotright and \guillemotleft based on a latex manual
I found in the web. Since it didn't work, I then tried the \ll and \gg combination.
Thank you Taco for the right syntax of the keywords.
CiroOn 12/27/05, Mojca Miklavec 
[EMAIL PROTECTED] wrote:
On 12/26/05, Ciro Soto wrote: Invisible Friends:I am trying to use \ll and \gg instead of quotation marks.The problem is that they are too big for my taste.What would be the easiest way to make them, say 
0.75\bodyfontsize ?I guess that \leftguillemot instead of \ll already solves theproblem, but if you really want to scale them, it's most elegant to doit this way:\installlanguage[es]
[leftquotation={\scale[height=.75ex]{\leftguillemot}}, rightquotation={\scale[height=.75ex]{\rightguillemot}}] % .75\bodyfontsize is way too big % or the ugly \fakeleftguillemot instead of \leftguillemot, as Taco proposed
\mainlanguage[es]\starttext\quotation{To quote or not to quote,} that's the question!\stoptext(Even if you don't need to scale them, this is the way how to getguillemots instead of double commas.)
The only problem is that they're scaled so that baseline remains whereit is: quotation marks are placed too low because of that. So youprobably want to do raise them a bit as well:\raise.25ex\hbox{\scale[height=.5ex]{\rightguillemot}}
Mojca

-- All problems are at the interface. Each one of them has a solution.from: The Guitar Maker: An Exploration of Wisdom, Design and Love. A novel by C. A. Soto Aguirre.
http://www.TheGuitarMakerExploration.com/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \definedescription question

2005-12-27 Thread VnPenguin
On 12/27/05, Taco Hoekwater [EMAIL PROTECTED] wrote:


 VnPenguin wrote:
  On 12/26/05, Willi Egger [EMAIL PROTECTED] wrote:
 
 
 
  No, it does not work for me :(

 After checking, it turns out it works for me as well. I have:

   tex : pdfeTeXk, 3.141592-1.30.3-2.2 (Web2C 7.5.5)
   context : ver: 2005.12.19
   cont-en : ver: 2005.12.19  fmt: 2005.12.22  mes: english

 So perhaps something else is wrong. What is your log file?


Hi Taco  Willi,
It works now ;-) So I think I done some errors yesterday :)

Thanks and Happy holidays,

Cheers

--
http://vnoss.org
Vietnamese Open Source Software Community
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] running ConTeXt from the new DVD

2005-12-27 Thread Mojca Miklavec
Hello,

I just got the new DVD, TeX Collection 2005, tried to run cdemo.bat
and to compile one of the sample documents, but:

texmfstart newtexexec.rb --autopdf --pdf demo-tex.tex
TeXExec | processing document 'demo-tex.tex'
TeXExec | provide ctx file
TeXExec | tex processing method: context
TeXExec | TeX run 1
TeXExec | tex engine: pdfetex
TeXExec | tex format: cont-en
TeXExec | progname: context
This is pdfeTeX, Version 3.141592-1.30.3-2.2 (Web2c 7.5.5)
 \write18 enabled.
I can't find the format file `pdfetex.fmt'!
pdfetex: unrecognized option `--alias=context'
pdfetex: unrecognized option `--undump=cont-en'
TeXExec | runtime: 3.315
Exit code: 0



texexec --make --all
cannot be executed since the CD is not writable. Can this be overcome
anyhow, is there a problem specific to my PC or is this distribution
on DVD unusable as such?

(I often have similar format missing problems when I update MikTeX
but then the problem disappers when I reboot the computer - not that I
understand why since I refresh the database and remake all the formats
each time anyway.)

Thank you,
Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Weird things...

2005-12-27 Thread Hans Hagen

Fabio Mancinelli wrote:


Hi all...

I would like to report a weird behavior when compiling the attached 
tex file...


ah. that one took me a while .. in page-lyr.tex,

  
\chardef\layerpagebox\csname\@@layerbox#2\currentlayer\layerpage\endcsname

  \chardef\layerbox\csname\@@layerbox#3\endcsname

should be:

  
\mathchardef\layerpagebox\csname\@@layerbox#2\currentlayer\layerpage\endcsname

  \mathchardef\layerbox\csname\@@layerbox#3\endcsname

(column sets need lots of boxes in etex mode and then the layer box ends 
up  255 and using a chardef here is not working any more)


[you need to remake the format]

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


Re: [NTG-context] Weird things...

2005-12-27 Thread Hans Hagen

Taco Hoekwater wrote:


Fabio Mancinelli wrote:


Why this happens?



Because an interal ConTeXt macro (\dododosetlayer) is calling
a TeX primitive (\chardef) with a number that is higher than 256.
That number has become so high because of the columnset
definitions, which is why changing the ordering fixed it.

A full fix of the bug requires some work, simply changing that
one \chardef didn't cut it (the 'bad character code' moves
elsewhere).


another one:

  \mathchardef\collectorbox\csname\@@collectorbox#1\endcsname

two times in core-box

Hans

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


Re: [NTG-context] running ConTeXt from the new DVD

2005-12-27 Thread Hans Hagen

Mojca Miklavec wrote:


Hello,

I just got the new DVD, TeX Collection 2005, tried to run cdemo.bat
and to compile one of the sample documents, but:

 


texmfstart newtexexec.rb --autopdf --pdf demo-tex.tex
   


TeXExec | processing document 'demo-tex.tex'
TeXExec | provide ctx file
TeXExec | tex processing method: context
TeXExec | TeX run 1
TeXExec | tex engine: pdfetex
TeXExec | tex format: cont-en
TeXExec | progname: context
This is pdfeTeX, Version 3.141592-1.30.3-2.2 (Web2c 7.5.5)
\write18 enabled.
I can't find the format file `pdfetex.fmt'!
pdfetex: unrecognized option `--alias=context'
pdfetex: unrecognized option `--undump=cont-en'
TeXExec | runtime: 3.315
 


Exit code: 0
   





texexec --make --all
cannot be executed since the CD is not writable. Can this be overcome
anyhow, is there a problem specific to my PC or is this distribution
on DVD unusable as such?

(I often have similar format missing problems when I update MikTeX
but then the problem disappers when I reboot the computer - not that I
understand why since I refresh the database and remake all the formats
each time anyway.)
 



cdemo is using the minimal but it looks like miktex is loaded and not 
the minimal binary ... there was a fix for this recently but that will 
not work when running from cd


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


Re: [NTG-context] no 'D' in math-eul.tex

2005-12-27 Thread Hans Hagen

Johan Sandblom wrote:


In May I discovered that there was a typo in math-eul.tex rendering
the lower-case 'd' an 'e'. Amazingly, the same problem occurs also for
the upper-case 'D', and requires changing the line

\definemathcharacter [D] [nothing] [mr] [45]

into

\definemathcharacter [D] [nothing] [mr] [44]
 


ok, fixed,


Apparently this beautiful font is severely underused to allow this
typo to survive!
 

or maybe the D is not used that much (those chars are only used alone, 
not in words, so if one can do with A-C the D is never hit)


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


[NTG-context] description question (bis)

2005-12-27 Thread VnPenguin
Hi,
I have another question about description list : How to make
description list with idented text, not header ?
Example:


This is header

 This is the text of description. This is the text of description.
 This is the text of description. This is the text of description.
 This is the text of description. This is the text of description.

Thank you in advance,

Cheers,

--
http://vnoss.org
Vietnamese Open Source Software Community
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] It works, passing text

2005-12-27 Thread David Arnold

Taco,

I have something that works. Thanks for hanging in there with me.

%output=pdf

\setupcolors[state=start]

\definecolor[gridlines][s=0.7]

\startMPinclusions

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

vardef create_grid(expr xxmin,xxmax,xxscl,yymin,yymax,yyscl,uux,uuy)=
  for k=xxmin step xxscl until xxmax:
draw (xmin*uux,k*uuy)--(xmax*uux,k*uuy) withcolor \MPcolor 
{gridlines};
draw (k*uux,ymin*uuy)--(k*uux,ymax*uuy) withcolor \MPcolor 
{gridlines};

  endfor;
enddef;

vardef create_axes (expr xxmin,xxmax,yymin,yymax,uux,uuy) (text  
xlbl,ylbl) =

  textextoffset:=3pt;
  picture p; p:=textext.rt(xlbl); p:=p shifted (1.05*xxmax*ux,0);
  picture q; q:=textext.top(ylbl); q:=q shifted (0,1.05*yymax*uy);
  drawdblarrow (1.05*xxmin*uux,0)--(1.05*xxmax*uux,0);
  draw p;
  drawdblarrow (0,1.05*yymin*uuy)--(0,1.05*yymax*uuy);
  draw q;
enddef;

vardef drawf(expr xxmin,xxmax,yymin,yymax,uux,uuy,n)=
  path p; p:=(xxmin,f(xxmin));
  numeric dx; dx=(xxmax-xxmin)/n;
  for x=xmin step dx until xxmax:
p:=p--(x,f(x));
  endfor;
  p:=p--(xxmax,f(xxmax));
  path cpath;
  cpath:=(xxmin,yymin)--(xxmax,yymin)--(xxmax,yymax)--(xxmin,yymax)-- 
cycle;

  p:=p cutbefore cpath;
  p:=reverse p;
  p:=p cutbefore cpath;
  p:=p xyscaled (uux,uuy);
  drawdblarrow p withcolor blue;
enddef;

\stopMPinclusions


\starttext

\startMPpage

%initialize function
vardef f(expr x)=
x*x
enddef;

%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-5;
xmax:=5;
xscl:=1;
ymin:=-5;
ymax:=5;
yscl:=1;

%initialize number of points
numeric num_points;
num_points:=100;

%initialize dimensions of image
numeric width, height;
width=3in;
height=3in;

%initialize scale
numeric ux, uy;
(xmax-xmin)*ux=width; (ymax-ymin)*uy=height;

%create the grid
create_grid(xmin,xmax,xscl,ymin,ymax,yscl,ux,uy);

%create the axes
create_axes(xmin,xmax,ymin,ymax,ux,uy)($x$)($y$);

%draw the function
drawf(xmin,xmax,ymin,ymax,ux,uy,num_points);

\stopMPpage

\stoptext

%%% Local Variables:
%%% mode: conTeXt-en
%%% End:

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


Re: [NTG-context] \definedescription question

2005-12-27 Thread Hans Hagen

Willi Egger wrote:


Hi,

Her the following works:

\definedescription
   [Desc]
   [location=top,hang=3,headstyle={\color[red]}]

or

\definedescription
   [Desc]
   
[location=top,hang=3,headstyle={\switchtobodyfont[34pt]\bf\color[red]}]



Willi

VnPenguin wrote:


Hi all,
I'm trying to define a description:

\definedescription
[Desc]
[location=top,hang=3,headcolor=red]

But my PDF has not color for description header (I have already
\setupcolors[state=start]).

Another test:

\definedescription
[Desc]
[location=top,hang=3,headstyle={\switchtobodyfont[16pt]\red\bf}]

Does not work :(

Question: How to define color  font size for description header ? The
document of description is not complet. Search on Wiki  Mailing list
can not help me.




this shoudl work:

\setupcolors[state=start]

\definedescription
   [Desc]
   [location=top,hang=3,headstyle=bold,headcolor=red]
  
\starttext


\Desc {test} test

\stoptext

in

{\switchtobodyfont[16pt]\red\bf}

the \red may fail in some cases due to implicit grouping

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


Re: [NTG-context] description question (bis)

2005-12-27 Thread Hans Hagen

VnPenguin wrote:


Hi,
I have another question about description list : How to make
description list with idented text, not header ?
Example:


This is header

This is the text of description. This is the text of description.
This is the text of description. This is the text of description.
This is the text of description. This is the text of description.

Thank you in advance,
 


ugly but working:

\setupcolors[state=start]

\definedescription
   [Desc]
   [location=top,
hang=3,
headstyle=bold,
headcolor=red,
command=\hskip-2cm,
margin=2cm]

\starttext

\input tufte \startDesc {test} \input tufte \stopDesc

\stoptext

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


Re: [NTG-context] \setupMPvariables in \startMPpage

2005-12-27 Thread Hans Hagen

David Arnold wrote:



All,

Why doesn't this work?

%output=pdf

\startuseMPgraphic{usquare}
  draw unitsquare scaled 4cm;
\stopuseMPgraphic

\starttext

\startMPpage
\useMPgraphic{square}
\stopMPpage

\stoptext


because you nest a graphic, kind of

beginfig(1) beginfig(2) draw unitsquare scaled 4cm; endfig ; endfig ;

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


Re: [NTG-context] \setupMPvariables in \startMPpage

2005-12-27 Thread Hans Hagen

David Arnold wrote:


Why doesn't this work?

%output=pdf

\startuseMPgraphic{usquare}
  draw unitsquare scaled \MPvar{u};
\stopuseMPgraphic

\starttext

\startMPpage
\setupMPvariables[usquare][u=4cm]
\includeMPgraphic{usquare}
\stopMPpage

\stoptext


because

(1) after startMPpage metapost code is expected (or something like 
\includeMPgraphic{...} that expands to mp code
(2) when the setup is moved outside the startMPpage, contex does not 
know what vars to preset


however, this works (MPrawvar is undocumented, yet)

\startuseMPgraphic{usquare}
 draw unitsquare scaled \MPrawvar{usquare}{u};
\stopuseMPgraphic

\starttext

\setupMPvariables[usquare][u=4cm]

\startMPpage
\includeMPgraphic{usquare}
\stopMPpage

\stoptext

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


Re: [NTG-context] hlingrid text t parameter?

2005-12-27 Thread Hans Hagen

David Arnold wrote:


All,

In mp-grid.mp, I find this definition:

def hlingrid (expr Min, Max, Step, Length, Width) text t =
  image ( for i=Min step Step until Max+grid_eps :
draw (origin--(Width,0)) shifted (0,i*(Length/Max)) t ;
  endfor ; ) ;
enddef ;

See the text t at the end of the first line? Can someone tell me what  
that does and can I have a small example of its use?


t (text) is anything upto the ;

so you can use it to pass things like 'withcolor red' and so

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


Re: [NTG-context] \startMPpage ... \stopMPpage

2005-12-27 Thread Hans Hagen

David Arnold wrote:



% \startMPpage
%   \includeMPgraphic{EnglishRule}
% \stopMPpage


you can only include a simple usable graphic, defined with 
\startuseMPgraphic; unique mp graphics are more tricky and involve


(once we have lua in tex we can find ways around this since then we can 
(1) implement some of the unique housekeeping in lua and (2) fool tex 
with hidden expansions)


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


Re: [NTG-context] more font packages

2005-12-27 Thread Hans Hagen

Taco Hoekwater wrote:


Henning Hraban Ramm wrote:


Here's a present for you:
http://www.fiee.net/texnique/?menu=0-1-4

I made some more font packages and also published some symbol  
packages (Apostrophe HardTalk, FontShop FFDingbests, Klein  
RudolfsBats and my own Unitas2).
The additional files of the newer packages are finally in the right  
places (docs/fonts/... and tex/context/third)



I'll think about a better structure of the page including preview  
pictures...



Wow! I am going to create a texmf-hraban tree. :-)


nice indeed!

suggestion:

put the typescripts under

tex/context/third/

(taco, do we need a subdir there ... maybe just third/typescripts ?)

that way context (tex) can find those tex files

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


Re: [NTG-context] more font packages

2005-12-27 Thread Hans Hagen

Taco Hoekwater wrote:


Henning Hraban Ramm wrote:


Here's a present for you:
http://www.fiee.net/texnique/?menu=0-1-4

I made some more font packages and also published some symbol  
packages (Apostrophe HardTalk, FontShop FFDingbests, Klein  
RudolfsBats and my own Unitas2).
The additional files of the newer packages are finally in the right  
places (docs/fonts/... and tex/context/third)



I'll think about a better structure of the page including preview  
pictures...


in the (nice) sample tables in convington \tx comes out as tx which 
indicates an encoding problem (i see  that you use qx so maybe there is 
something wrong with the vector?)


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


Re: [NTG-context] description question (bis)

2005-12-27 Thread VnPenguin
On 12/27/05, Hans Hagen [EMAIL PROTECTED] wrote:
 ugly but working:

 \setupcolors[state=start]

 \definedescription
 [Desc]
 [location=top,
  hang=3,
  headstyle=bold,
  headcolor=red,
  command=\hskip-2cm,
  margin=2cm]

 \starttext

 \input tufte \startDesc {test} \input tufte \stopDesc

 \stoptext


wow, your solution works well :)
Thank you so much,
Regards,

--
http://vnoss.org
Vietnamese Open Source Software Community
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] more font packages

2005-12-27 Thread Taco Hoekwater

Hans Hagen wrote:


Wow! I am going to create a texmf-hraban tree. :-)


nice indeed!


I settled for texmf-fonts, actually. I have a bunch of other
(commercial) fonts as well, so it made sense to group those
together, apart from my private macro files.


suggestion:

put the typescripts under

tex/context/third/

(taco, do we need a subdir there ... maybe just third/typescripts ?)


How about tex/context/third/hraban ? :-)

I believe an extra level is a good idea, but I have no strong
feelings about naming conventions below third/.  The chance of
collisions is (very) small as it stands, so I believe there is no
need to be prescriptive beyond that extra level.

Cheers,

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


Re: [NTG-context] description question (bis)

2005-12-27 Thread VnPenguin
On 12/27/05, VnPenguin [EMAIL PROTECTED] wrote:
 On 12/27/05, Hans Hagen [EMAIL PROTECTED] wrote:
  ugly but working:
 
  \setupcolors[state=start]
 
  \definedescription
  [Desc]
  [location=top,
   hang=3,
   headstyle=bold,
   headcolor=red,
   command=\hskip-2cm,
   margin=2cm]
 
  \starttext
 
  \input tufte \startDesc {test} \input tufte \stopDesc
 
  \stoptext
 

 wow, your solution works well :)
 Thank you so much,
 Regards,

Just added this solution to wiki :-)

  http://wiki.contextgarden.net/Description

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


[NTG-context] function machine

2005-12-27 Thread David Arnold

Hans, Taco, et al,

This is getting pretty close to the limit of my expertise. The good  
stuff of it is stolen from Metafun and mp-func.mp.


Because of the way I handle clipping the path,

  p:=p cutbefore cpath;
  p:=reverse p;
  p:=p cutbefore cpath;

this will only work on functions (like lines, quadratics, and  
polynomials, maybe sinusoids) that both enter and leave the region  
inside the clipping path.


I proceed the in the order I do because I want the axes layered atop  
the grid and the functions layered atop the grid and axes.


It's actually a pretty cool routine for teachers as it almost works  
like a TI83 calculator. Just change xmin, xmax, xscl, ymin, ymax, and  
yscl to determine domain and range and tick marks, then adjust the  
number of points for a smooth graph, then set the width of the figure  
you want. There's an option to label the axes differently from the  
usual x and y, if needed.


Finally, thanks to Hans' expertise, the drawfcn routine allows for a  
parametric definition of the intended curve.


All you need to do to make another graphic is copy and paste  
everything  between \startMPpage ... \stopMPpage and adjust the  
parameters described above. Now you have a second plot.


You can run texexec with

texexec filename

or

texexec --page=2 filename

if you only want your second graphic. When I compile all, I write an  
xml database file (very cool) and use


\usemodule[fig-base]
\usefigurebase[figures/figlibSection1]

in my document. Very cool working arrangement.

Here's some lines from my xml file:

figurelibrary language=en

description
organizationCollege of the Redwoods Mathematics Department/ 
organization

projectIntermediate Algebra Text/project
productChapter 1/product
commentFigures for Section 1/comment
/description

figure
filesection1figs-mpgraph.1/file
labelyeqx2/label
copyrightCollege of the Redwoods Mathematics Department/copyright
comment/comment
/figure

figure
filesection1figs-mpgraph.2/file
labelyeq2x2/label
copyrightCollege of the Redwoods Mathematics Department/copyright
comment/comment
/figure

...

/figurelibrary

And here's my function machine. I'd love to hear any suggestions for  
improvement. Thanks to all who have helped me the last week (Taco has  
been especially patient). I've learned a lot.


%output=pdf

\setupcolors[state=start]

\definecolor[gridlines][s=0.7]

\startMPinclusions

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

vardef create_grid (expr l,r,h,b,t,v,wid,ht)=
  save ux, uy; numeric ux, uy;
  (r-l)*ux=wid; (t-b)*uy=ht;
  for k=b step v until t:
draw (l*ux,k*uy)--(r*ux,k*uy) withcolor \MPcolor{gridlines};
  endfor;
  for k=l step h until r:
draw (k*ux,b*uy)--(k*ux,t*uy) withcolor \MPcolor{gridlines};
  endfor;
enddef;

vardef create_axes (expr l,r,b,t,wid,ht) (text xlbl,ylbl) =
  save ux, uy; numeric ux, uy;
  (r-l)*ux=wid; (t-b)*uy=ht;
  textextoffset:=3pt;
  drawdblarrow (1.05*l*ux,0)--(1.05*r*ux,0);
  draw textext.rt(xlbl) shifted (1.05*r*ux,0);
  draw textext.bot(decimal r) shifted (r*ux,0);
  drawdblarrow (0,1.05*b*uy)--(0,1.05*t*uy);
  draw textext.top(ylbl) shifted (0,1.05*t*uy);
  draw textext.lft(decimal t) shifted (0,t*uy);
enddef;

vardef drawfcn (expr ind,dep,l,r,b,t,wid,ht,n) text txt =
  save x, dx, ux, uy; numeric x, dx, ux, uy;
  dx:=(r-l)/n;
  (r-l)*ux=wid; (t-b)*uy=ht;
  save cpath; path cpath; cpath:=(l,b)--(r,b)--(r,t)--(l,t)--cycle;
  save p; path p; hide (x:=l;) p:=(scantokens(ind),scantokens(dep));
  for xx:=l step dx until r:
hide (x:=xx;) p:=p--(scantokens(ind),scantokens(dep));
  endfor;
  hide(x:=r;) p:=p--(scantokens(ind),scantokens(dep));
  p:=p cutbefore cpath;
  p:=reverse p;
  p:=p cutbefore cpath;
  p:=p xyscaled (ux,uy);
  drawdblarrow p txt;
enddef;

\stopMPinclusions

\starttext

\startMPpage

%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-10;
xmax:=10;
xscl:=1;
ymin:=-10;
ymax:=10;
yscl:=1;

%initialize number of points
numeric num_points;
num_points:=100;

%initialize dimensions of image
numeric width, height;
width=3in;
height=3in;

%create the grid
create_grid(xmin,xmax,xscl,ymin,ymax,yscl,width,height);

%create the axes
create_axes(xmin,xmax,ymin,ymax,width,height)($x$)($y$);

%draw the function
%drawf(xmin,xmax,ymin,ymax,width,height,num_points);
drawfcn(x,x*x,xmin,xmax,ymin,ymax,width,height,100) ;

%to add another function with extra formatting, try:
% drawfcn(x,(x+1)*(x+1),xmin,xmax,ymin,ymax,width,height,100)
% withpen pencircle scaled 2pt dashed evenly withcolor red;

\stopMPpage

\stoptext

%%% Local Variables:
%%% mode: conTeXt-en
%%% End:





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