Re: [NTG-context] Metapost labels

2013-08-07 Thread Alan BRASLAU
On Wed, 7 Aug 2013 06:50:54 +0200
Lutz Haseloff lutz.hasel...@gmail.com wrote:

 Hi all,
 
 with
 LuaTeX, Version beta-0.77.0-2013073017 (rev 4639)
 and
 ConTeXt  ver: 2013.08.06 15:50 MKIV beta  fmt: 2013.8.7  int:
 english/english
 Context seems not to be able to typeset Labels anymore.
 Yesterday, before an Update, all worked as expected.
 
 Minimal not working example:
 
 \starttext
 \startMPpage
 draw fullcircle scaled 5cm withcolor red;
 label(textext(\CONTEXT),origin);
 \stopMPpage
 \stoptext
 
 Or am I missing something happened in the last four weeks?

Something seems wrong with the current beta.
It does not find files (cont-yes.mkiv, etc.),
does not find fonts, etc. 
metapost loading 'metafun' fails, format not found

Following the mailing list, Hans tried `fixing' something with file loading...

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost labels

2013-08-07 Thread Hans Hagen

On 8/7/2013 6:50 AM, Lutz Haseloff wrote:

Hi all,

with
LuaTeX, Version beta-0.77.0-2013073017 (rev 4639)
and
ConTeXt  ver: 2013.08.06 15:50 MKIV beta  fmt: 2013.8.7  int:
english/english
Context seems not to be able to typeset Labels anymore.
Yesterday, before an Update, all worked as expected.

Minimal not working example:

\starttext
\startMPpage
draw fullcircle scaled 5cm withcolor red;
label(textext(\CONTEXT),origin);
\stopMPpage
\stoptext

Or am I missing something happened in the last four weeks?


some playing with transformations and keeping properties at the same 
time ... new beta uploaded


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost labels

2013-08-07 Thread Lutz Haseloff
Hi Hans,

Labels work again as expected.

Thanks for the quick help!


2013/8/7 Hans Hagen pra...@wxs.nl

 On 8/7/2013 6:50 AM, Lutz Haseloff wrote:

 Hi all,

 with
 LuaTeX, Version beta-0.77.0-2013073017 (rev 4639)
 and
 ConTeXt  ver: 2013.08.06 15:50 MKIV beta  fmt: 2013.8.7  int:
 english/english
 Context seems not to be able to typeset Labels anymore.
 Yesterday, before an Update, all worked as expected.

 Minimal not working example:

 \starttext
 \startMPpage
 draw fullcircle scaled 5cm withcolor red;
 label(textext(\CONTEXT),**origin);
 \stopMPpage
 \stoptext

 Or am I missing something happened in the last four weeks?


 some playing with transformations and keeping properties at the same time
 ... new beta uploaded

 Hans

 --**--**-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | www.pragma-pod.nl
 --**--**-
 __**__**
 ___
 If your question is of interest to others as well, please add an entry to
 the Wiki!

 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/**
 listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : 
 http://foundry.supelec.fr/**projects/contextrev/http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 __**__**
 ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Metapost labels

2013-08-06 Thread Lutz Haseloff
Hi all,

with
LuaTeX, Version beta-0.77.0-2013073017 (rev 4639)
and
ConTeXt  ver: 2013.08.06 15:50 MKIV beta  fmt: 2013.8.7  int:
english/english
Context seems not to be able to typeset Labels anymore.
Yesterday, before an Update, all worked as expected.

Minimal not working example:

\starttext
\startMPpage
draw fullcircle scaled 5cm withcolor red;
label(textext(\CONTEXT),origin);
\stopMPpage
\stoptext

Or am I missing something happened in the last four weeks?

Thanks

Greetings Lutz
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] fontsize drawing in metapost

2013-05-07 Thread Meer, H. van der
The reason behind starting this thread was the fact that I want my 
\useMPgraphic's arbitrarily (and perfectly) scaled. In Metapost/Metafun that is 
easily done through a \MPvar{scale} variable, applied to the main dimensions on 
which all measures in my figures depend. But for the fontsizes this turned out 
to be not so easy. Understandable, because text is typeset at the TeX-end not 
inside the Metapost.

Perhaps a better and possibly more elegant way seems the following route. When 
I turn Metapost figures into external pdf-files, these can be placed with 
\useexternalfigure and the scaled as a whole, drawing and text alike. My 
question is: can this be done without resorting to an external pdf? That is, 
can I pick up the result of \useMPgraphic somewhere, then put this in 
\useexternalfigure and apply everything possible there to the figure.

Does someone know how to?

Hans van der Meer 

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] fontsize drawing in metapost

2013-05-07 Thread Marco Patzer
On 2013–05–07 Meer, H. van der wrote:

 Perhaps a better and possibly more elegant way seems the following
 route. When I turn Metapost figures into external pdf-files, these
 can be placed with \useexternalfigure and the scaled as a whole,
 drawing and text alike. My question is: can this be done without
 resorting to an external pdf? That is, can I pick up the result of
 \useMPgraphic somewhere, then put this in \useexternalfigure and
 apply everything possible there to the figure.

You could use \scale :

\startuseMPgraphic{foo}
  fill unitcircle scaled 1cm;
  label(Foo, origin);
\stopuseMPgraphic

\starttext
\useMPgraphic{foo}
  \scale[width=3cm]{\useMPgraphic{foo}}
  \scale[width=3cm,height=5cm] {\useMPgraphic{foo}}
  \scale[scale=2500]   {\useMPgraphic{foo}}
\stoptext

Marco


signature.asc
Description: Digital signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] fontsize drawing in metapost

2013-05-07 Thread Meer, H. van der
Thanks. This is exactly what is needed. I feel myself somewhat silly, because I 
did try \scale, but with the wrong parameter setup; nothing happened then, of 
course. Now I know to do it right!

Hans van der Meer



On 7 May 2013, at 9:35 AM, Marco Patzer home...@lavabit.com
 wrote:

 On 2013–05–07 Meer, H. van der wrote:
 
 Perhaps a better and possibly more elegant way seems the following
 route. When I turn Metapost figures into external pdf-files, these
 can be placed with \useexternalfigure and the scaled as a whole,
 drawing and text alike. My question is: can this be done without
 resorting to an external pdf? That is, can I pick up the result of
 \useMPgraphic somewhere, then put this in \useexternalfigure and
 apply everything possible there to the figure.
 
 You could use \scale :
 
 \startuseMPgraphic{foo}
  fill unitcircle scaled 1cm;
  label(Foo, origin);
 \stopuseMPgraphic
 
 \starttext
\useMPgraphic{foo}
  \scale[width=3cm]{\useMPgraphic{foo}}
  \scale[width=3cm,height=5cm] {\useMPgraphic{foo}}
  \scale[scale=2500]   {\useMPgraphic{foo}}
 \stoptext
 
 Marco
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] fontsize drawing in metapost

2013-05-06 Thread Meer, H. van der
This is but a partial solution in my case, for two reasons:
1. \textstyle=\small gives few control, I tried textstyle=5pt without result
2. the setup cannot be placed inside \startuseMPgraphic, where I need it most.

I skimmed through meta-ini.mkiv, but did not find a solution.
It is however quite possible things cannot be done other than by putting a 
fontchange inside each label.

Hans van der Meer



On 6 May 2013, at 6:04 PM, Marco Patzer home...@lavabit.com wrote:

 On 2013–05–06 Meer, H. van der wrote:
 
 What is the simplest way to change the size of fonts in labels drawn in 
 MetaPost?
 
 Probably a font switch directly in the label:
 
  label(\small foobar, origin);
 
 \switchtobodyfont[size] can be done in \startMPenvironment and inside each 
 label.
 
 Better use setupMPinstance:
 
  \setupMPinstance
[metafun]
[textstyle=\small]
 
 Marco
 __
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] fontsize drawing in metapost

2013-05-06 Thread Meer, H. van der
I did some further experimentation, hoping using dimexp calculations would 
help. But either I am doing somthing wrong or I do not understand the innards 
of bodyfont switching well enough.
The example program seems to have accessed a 30 pt font (see the log file) but 
did not typeset in it, the dimexpr does evaluates to 30 pt.
Where am I at fault?

Hans van der Meer

\setuppapersize[A6][A6]
\setupbodyfont[10pt]
\starttext
10pt\ \begingroup\switchtobodyfont[20pt]20pt\endgroup\ 10pt\par
\writestatus{==}{}
10pt\ \begingroup\switchtobodyfont[\the\dimexpr(3\bodyfontsize)] times 
3\endgroup\ 10pt\par
dimexpr=\the\dimexpr(3\bodyfontsize)\par
\stoptext

fonts'fallback modern rm 10pt' is loaded
fontsbodyfont '20pt' is defined (can better be done global)
fontsbodyfont '24pt' is defined (can better be done global)
fontsbodyfont '16pt' is defined (can better be done global)
==  
fontsbodyfont '30.0pt' is defined (can better be done global)
fontsbodyfont '36pt' is defined (can better be done global)
fontsbodyfont '24pt' is defined (can better be done global)
fontsbodyfont '30.0pt' is defined (can better be done global)
fontsbodyfont '30.0pt' is not defined


On 6 May 2013, at 8:57 PM, Meer, H. van der 
h.vanderm...@uva.nlmailto:h.vanderm...@uva.nl wrote:

This is but a partial solution in my case, for two reasons:
1. \textstyle=\small gives few control, I tried textstyle=5pt without result
2. the setup cannot be placed inside \startuseMPgraphic, where I need it most.

I skimmed through meta-ini.mkiv, but did not find a solution.
It is however quite possible things cannot be done other than by putting a 
fontchange inside each label.

Hans van der Meer



On 6 May 2013, at 6:04 PM, Marco Patzer 
home...@lavabit.commailto:home...@lavabit.com wrote:

On 2013–05–06 Meer, H. van der wrote:

What is the simplest way to change the size of fonts in labels drawn in 
MetaPost?

Probably a font switch directly in the label:

label(\small foobar, origin);

\switchtobodyfont[size] can be done in \startMPenvironment and inside each 
label.

Better use setupMPinstance:

\setupMPinstance
  [metafun]
  [textstyle=\small]

Marco
_


dimexpr.pdf
Description: dimexpr.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Function Grapher

2013-02-23 Thread Jaroslav Hajtmar

Hello Troy.
Thank you very much for the link. It looks very nice and I'm sure that I 
will throw into teaching (I teach mathematics at the high school). I'm 
doing these things through Tikz and Pgfplots. Metapost unfortunately I 
don't control.
Is it possible allowing export to Tikz or Pgfplots? If I would had the 
opportunity to also download the source  Tikz or Pgfplots, it would be 
absolutely amazing.
My point is that I can post the graphs still adapt, modify, describe, 
and create animations from those exported sources.


Anyway, it's very hilarious application and I provide the link my 
students for their study purposes.


Kind regards.

Jaroslav Hajtmar


Dne 22.2.2013 19:44, Troy Henderson napsal(a):

The MetaPost output from my Function Grapher

http://www.tlhiv.org/mpgraph/

is now available in ConTeXt format.  This can be illustrated by 
choosing a graph type and selecting an example from one of the Example 
buttons.  Once the graph is drawn, the ConTeXt source can be 
downloaded using the Download drop-down box.  Simply executing 
`context mpgraph.tex` should produce the same graph viewed on the 
website in PDF.  If you see any bugs, feel free to let me know.


Troy Henderson


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Function Grapher

2013-02-23 Thread Troy Henderson

 Is it possible allowing export to Tikz or Pgfplots? If I would had the
 opportunity to also download the source  Tikz or Pgfplots, it would be
 absolutely amazing.


Unfortunately, I don't know TikZ or PGF, so not only would I have to learn
these, but I would also have to rewrite the code to include this output.
This is not a small feat.  I do not currently have plans for this.

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] MetaPost Function Grapher

2013-02-22 Thread Troy Henderson
The MetaPost output from my Function Grapher

http://www.tlhiv.org/mpgraph/

is now available in ConTeXt format.  This can be illustrated by choosing a
graph type and selecting an example from one of the Example buttons.  Once
the graph is drawn, the ConTeXt source can be downloaded using the
Download drop-down box.  Simply executing `context mpgraph.tex` should
produce the same graph viewed on the website in PDF.  If you see any bugs,
feel free to let me know.

Troy Henderson
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Metapost nodes.

2013-01-10 Thread Andre Caldas
Hello!

1. How does a metapost figure (\startMPcode) becomes a node?
2. When does it become a node?
3. What type of node it becomes?
4. Can I change its attributes?
5. Can I change its colors or transparency levels?


André Caldas.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Metapost nodes.

2013-01-10 Thread Hans Hagen

On 1/10/2013 5:15 PM, Andre Caldas wrote:

Hello!

1. How does a metapost figure (\startMPcode) becomes a node?


never, that is: it's turned into whatsit nodes with pdf operators and 
mixed with regular nodes when text is used



2. When does it become a node?


sometime in the mp converter


3. What type of node it becomes?


whatsits mixed with regular (for text)


4. Can I change its attributes?


whatsits can of course have attributes but as the content is arbitrary 
pdf these attributes don't play a role



5. Can I change its colors or transparency levels?


only by parsing the content or by hooking code into the converter or 
(better and more robust) by just applying color or transparency at the 
mp level


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2013-01-07 Thread Troy Henderson
I've added a few more animations since my last post.  They can be accessed
at

http://www.tlhiv.org/animations

There is one in particular that, I think, is quite impressive.  It is an
animation of a function f(x,y,t) where t is time.  It is available at the
aforementioned link or directly at

http://www.tlhiv.org/animations/nocgi/function_surface.html

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2013-01-07 Thread Marco Patzer
On 2013–01–07 Troy Henderson wrote:

 http://www.tlhiv.org/animations
 
 There is one in particular that, I think, is quite impressive.  It is an
 animation of a function f(x,y,t) where t is time.

I love that one. Very impressive, indeed! Although my browser
flickers for about 20s until it eventually starts, but that might
just be my flash player. Thanks for providing such nice animations.
I can't wait for the next one. Where's the RSS feed? ;)

Side note: When I access your site I get the following warning:

  Internal Server Error

  The server encountered an internal error or misconfiguration and was
  unable to complete your request.

  Please contact the server administrator, [no address given] and
  inform them of the time the error occurred, and anything you might
  have done that may have caused the error.

  More information about this error may be available in the server
  error log.

Marco


signature.asc
Description: Digital signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2013-01-07 Thread Rogers, Michael K

On Jan 7, 2013, at 11:46 AM, Marco Patzer 
home...@lavabit.commailto:home...@lavabit.com wrote:

On 2013–01–07 Troy Henderson wrote:

http://www.tlhiv.org/animations

There is one in particular that, I think, is quite impressive.  It is an
animation of a function f(x,y,t) where t is time.

I love that one. Very impressive, indeed! Although my browser
flickers for about 20s until it eventually starts, but that might
just be my flash player.

That is cool!  I think the flicker is from loading all the polygons.  Once it 
cycles through once or twice, they're all loaded and it plays smoothly.  (Or so 
it appears in my browser.)



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2013-01-07 Thread Alan BRASLAU
On Mon, 7 Jan 2013 10:22:41 -0600
Troy Henderson thend...@gmail.com wrote:

 I've added a few more animations since my last post.  They can be
 accessed at
 
 http://www.tlhiv.org/animations
 
 There is one in particular that, I think, is quite impressive.  It is
 an animation of a function f(x,y,t) where t is time.  It is available
 at the aforementioned link or directly at
 
 http://www.tlhiv.org/animations/nocgi/function_surface.html
 
 Troy

Do we get to see the MetaPost code?

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [metapost] MetaPost Animations

2013-01-02 Thread Jean-Michel Sarlat
Hello,

2012/12/28 Hans Hagen pra...@wxs.nl

 On 12/28/2012 8:41 PM, Troy Henderson wrote:

 I've created several animations using MetaPost/ConTeXt, and I have also
 created a webpage with these animations.  The URL to the page is

 http://www.tlhiv.org/**animations/ http://www.tlhiv.org/animations/

 Feedback is appreciated, and if there is a particular animation that you
 would like to see included, let me know and I will attempt to code them
 up in MetaPost, provide the source code, and include them on the webpage.


 There are some animated gifs at:

 http://en.wikipedia.org/wiki/**B%C3%A9zier_curvehttp://en.wikipedia.org/wiki/B%C3%A9zier_curve

 such curves are typical for mp so maybe they qualify.


These images are very explicit, with metapost, it is a pleasure to get them
:)
Here is a first draft :
http://melusine.eu.org/syracuse/metapost/animations/bezier/
Enter in the directories and click the button swf.

Jean-Michel Sarlat
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2013-01-01 Thread Jeong Dal
Dear Wolfgang,

Thank you for the explanation and the correction of the code.

It works nicely. It also taught me some other things too.

I'd like to ask you one more thing.
When you update the animation module, would you please concern the location of 
the menu?
I think that it is better to put it at the bottom center of the animation frame 
in default?  
Currently, it is located slightly left from the center.

Thanks again.

Best regards,

Dalyoung
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2013-01-01 Thread Wolfgang Schuster

Am 01.01.2013 um 15:30 schrieb Jeong Dal hak...@me.com:

 Dear Wolfgang,
 
 Thank you for the explanation and the correction of the code.
 
 It works nicely. It also taught me some other things too.
 
 I'd like to ask you one more thing.
 When you update the animation module, would you please concern the location 
 of the menu?
 I think that it is better to put it at the bottom center of the animation 
 frame in default?  
 Currently, it is located slightly left from the center.

This is a bug in context which adds a space for each symbol in a fieldstack 
(the mechanism
which is used to create the animation and which is documented in the metafun 
manual).

I reported it a few days ago on the dev list and hope Hans will fix it in the 
next beta.

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-31 Thread Jeong Dal
Dear Wolfgang,

Thank you for the explanation, and your sample works nicely.

I  enclosed \processMPbuffer using \startframe and \stopframe as following.
Then  I got a 'undefined control sequence' error.
If I use '\framed[]' instead of '\startframe … \stopframe', then it gave all 7 
circles of different radius in two pages without error.
If I add \startanimation … \stopanimation, the only change is the appearance 
of menu at the bottom of the last circle.(no animation)

What is wrong in the code?

Best regards,

Dalyoung


Happy New Year to all listers!!!



\startbuffer[circles]
path p;
numeric n, u;
u := 1cm;
n:=\recurselevel*u;
p := fullcircle scaled n;
draw p;
\stopbuffer

\usemodule[animation]
\setupinteraction[state=start]

\starttext
%\startanimation[menu=yes]
\dorecurse{7}{
\startframe
%   \framed[]%{\processMPbuffer[circles]}}
\processMPbuffer[circles]
\stopframe
}
%\stopanimation
\stoptext


! Undefined control sequence.
system  tex  error on line 23 in file test-ani.tex: Undefined control 
sequence ...
13 \setupinteraction[state=start]
14
15 \starttext
16
17 %\startanimation[menu=yes]
18 \dorecurse{7}{
19 \startframe
20 %\framed[]%{\processMPbuffer[circles]}}
21 \processMPbuffer[circles]
22 \stopframe
23  }
24 %\stopanimation
25
26 \stoptext
27
\121 #1#2- \startframe
\processMPbuffer [circles] \stopframe
\syst_helpers_recurse_indeed_yes ...curse_content
\syst_helpers_recurse_indeed
to be read again
{
inserted text
2
\syst_helpers_recurse_indeed ...the \innerrecurse
}{#2}
l.23 }




___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2012-12-31 Thread Wolfgang Schuster

Am 01.01.2013 um 04:50 schrieb Jeong Dal hak...@me.com:

 Dear Wolfgang,
 
 Thank you for the explanation, and your sample works nicely.
 
 I  enclosed \processMPbuffer using \startframe and \stopframe as following.
 Then  I got a 'undefined control sequence' error.
 If I use '\framed[]' instead of '\startframe … \stopframe', then it gave all 
 7 circles of different radius in two pages without error.
 If I add \startanimation … \stopanimation, the only change is the 
 appearance of menu at the bottom of the last circle.(no animation)
 
 What is wrong in the code?

1. The \frame and \startframe commands are only available *in* the animation 
environment where they are locally defined.

2. Although \framed sound similar to \frame there is no relation between both 
commands.

3. You have to expand the loop value *before* it is passed to metapost, see 
below.

\usemodule[animation]
\setupinteraction[state=start]

\startuseMPgraphic{circles}{counter}
path p;
numeric n, u;
u := 1cm;
n:=\MPvar{counter}*u;
p := fullcircle scaled n;
draw p;
\stopuseMPgraphic

\starttext
\startanimation[menu=yes]
\dorecurse{7}{%
\startframe
\useMPgraphic{circles}{counter=#1}%
\stopframe}
\stopanimation
\stoptext

4. You can also include the metapost code in the frame but you have to expand 
the \recurselevel value with the \expanded command (I have to upload a new 
version of the module first because \startframe isn’t expandable yet).

\usemodule[animation]
\setupinteraction[state=start]

\starttext
\startanimation[menu=yes]
\dorecurse{7}{\expanded
   {\startframe
\startMPcode
path p;
numeric n, u;
u := 1cm;
n:=\recurselevel*u;
p := fullcircle scaled n;
draw p;
\stopMPcode
\stopframe}}
\stopanimation
\stoptext

5. Use a PDF viewer with javascript support (e.g. Adobe Reader) to view the 
animation.

Kind regards and a happy new year,
Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2012-12-30 Thread Mojca Miklavec
On Sun, Dec 30, 2012 at 3:57 AM, Troy Henderson wrote:
 Bonus question: independent from the gears shape (assume that it stays
 as it is), there is something fundamentally wrong with the animation.
 What is that? ;)


 When fixing the teeth, I broke the direction of one of the gears.  It's
 repaired now.

Yes, it makes more sense now.

Very nice animations.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-30 Thread Jeong Dal
Dear Troy,

The animations are impressive and thank you for sharing the code.

In the creation of many pdf for animation, it changes the recurselevel only.
 I wonder if there is a way to make such kind of animation in ConTeXt using 
Wolfgang's animation module.
Then we can include the animation in PDF output directly.

Here is my trial.

I modified it as following and got an animation. But it is only good for a few 
step animation.

%
\startbuffer[base]
N:=64;%\N;
u:=136;
pair f;
c:=2/(1+sqrt(5));%\c;
if c1: f:=(1+-+c,0); v:=u/2; else: f:=(0,1+-+(1/c)); v:=u/c/2; fi; % Focus f 
is defined
path p,q;
pair z;
picture base;
numeric L;
p:=fullcircle yscaled c; % This is the ellipse
L:=length p;
draw p scaled (2*v) withpen pencircle scaled (v/260) dashed evenly; % Draw the 
ellipse dashed (will be traced later)
base:= currentpicture;
q:=bbox currentpicture enlarged (v/64); % Enlarge the bounding box slightly
q:=(llcorner q+(-v/128,-v/128))--(lrcorner q+(v/128,-v/128))--(urcorner 
q+(v/128,v/128))--(urcorner q+(-v/128,v/128))--cycle;
fill fullcircle scaled (v/32) shifted (f*v) withcolor red; % Focus
fill fullcircle scaled (v/32) shifted (-f*v) withcolor red; % Focus
base:=currentpicture; % Save this picture to draw in every frame
setbounds currentpicture to q; % Set the bounding box as described before
\stopbuffer

\startbuffer[fig1]
%\startMPpage
n:=1;%\recurselevel%1;
draw base; % Draw the common picture saved above
draw subpath (0,(n-1)/(N-1)*L) of p scaled (2*v) withpen pencircle scaled 
(v/130) withcolor blue; % Trace the ellipse in blue
z:=point ((n-1)/(N-1)*L) of p scaled v; % The point on the ellipse where we are 
thusfar
fill fullcircle scaled (v/32) shifted (2*z) withcolor blue; % Draw the point
draw (-f*v)--(2*z)--(f*v) withpen pencircle scaled (v/260); % Draw the string 
used to trace the ellipse
setbounds currentpicture to q; % Set the bounding box so that it is the same 
for each frame
%\stopMPpage
\stopbuffer

\startbuffer[fig2]
%\startMPpage
n:=2;
draw base; % Draw the common picture saved above
draw subpath (0,(n-1)/(N-1)*L) of p scaled (2*v) withpen pencircle scaled 
(v/130) withcolor blue; % Trace the ellipse in blue
z:=point ((n-1)/(N-1)*L) of p scaled v; % The point on the ellipse where we are 
thusfar
fill fullcircle scaled (v/32) shifted (2*z) withcolor blue; % Draw the point
draw (-f*v)--(2*z)--(f*v) withpen pencircle scaled (v/260); % Draw the string 
used to trace the ellipse
setbounds currentpicture to q; % Set the bounding box so that it is the same 
for each frame
%\stopMPpage
\stopbuffer

\startbuffer[fig3]
%\startMPpage
n:=3;
draw base; % Draw the common picture saved above
draw subpath (0,(n-1)/(N-1)*L) of p scaled (2*v) withpen pencircle scaled 
(v/130) withcolor blue; % Trace the ellipse in blue
z:=point ((n-1)/(N-1)*L) of p scaled v; % The point on the ellipse where we are 
thusfar
fill fullcircle scaled (v/32) shifted (2*z) withcolor blue; % Draw the point
draw (-f*v)--(2*z)--(f*v) withpen pencircle scaled (v/260); % Draw the string 
used to trace the ellipse
setbounds currentpicture to q; % Set the bounding box so that it is the same 
for each frame
%\stopMPpage
\stopbuffer

\setupinteraction[state=start]
\usemodule[animation]
\starttext
\startanimation[menu=yes]

{\processMPbuffer[base, fig1]}
{\processMPbuffer[base, fig2]}
{\processMPbuffer[base, fig3]}
\stopanimation
\stoptext

%

I also tried to simplify the code as following, but it just draw 10 figures not 
an animation.
Is there a way to combine them as an animation?

Thank you.

Best regards,

Dalyoung
 
%
\startbuffer[base]
N:=64;%\N;
u:=136;
pair f;
c:=2/(1+sqrt(5));%\c;
if c1: f:=(1+-+c,0); v:=u/2; else: f:=(0,1+-+(1/c)); v:=u/c/2; fi; % Focus f 
is defined
path p,q;
pair z;
picture base;
numeric L;
p:=fullcircle yscaled c; % This is the ellipse
L:=length p;
draw p scaled (2*v) withpen pencircle scaled (v/260) dashed evenly; % Draw the 
ellipse dashed (will be traced later)
base:= currentpicture;
q:=bbox currentpicture enlarged (v/64); % Enlarge the bounding box slightly
q:=(llcorner q+(-v/128,-v/128))--(lrcorner q+(v/128,-v/128))--(urcorner 
q+(v/128,v/128))--(urcorner q+(-v/128,v/128))--cycle;
fill fullcircle scaled (v/32) shifted (f*v) withcolor red; % Focus
fill fullcircle scaled (v/32) shifted (-f*v) withcolor red; % Focus
base:=currentpicture; % Save this picture to draw in every frame
setbounds currentpicture to q; % Set the bounding box as described before
\stopbuffer

\startbuffer[fig1]
%\startMPpage
n:=\recurselevel;
draw base; % Draw the common picture saved above
draw subpath (0,(n-1)/(N-1)*L) of p scaled (2*v) withpen pencircle scaled 
(v/130) withcolor blue; % Trace the ellipse in blue
z:=point ((n-1)/(N-1)*L) of p scaled v; % The point on the ellipse where we are 
thusfar
fill fullcircle scaled (v/32) shifted (2*z) withcolor blue; % Draw the point
draw (-f*v)--(2*z)--(f*v) withpen pencircle scaled 

Re: [NTG-context] MetaPost Animations

2012-12-30 Thread Wolfgang Schuster

Am 30.12.2012 um 14:19 schrieb Jeong Dal hak...@me.com:

 Dear Troy,
 
 The animations are impressive and thank you for sharing the code.
 
 In the creation of many pdf for animation, it changes the recurselevel only.
 I wonder if there is a way to make such kind of animation in ConTeXt using 
 Wolfgang's animation module.
 Then we can include the animation in PDF output directly.
 
 Here is my trial.
 
 I modified it as following and got an animation. But it is only good for a 
 few step animation.
 
 […]
 
 I also tried to simplify the code as following, but it just draw 10 figures 
 not an animation.
 Is there a way to combine them as an animation?

You can use a loop to create the frames, the only thing you have to be aware is
how to access the counter loop iteration. In most cases you can get the current
iteration of the loop with \recurselevel but this doesn’t work for animation 
because
each frame is saved in a symbol with \definesymbol[frame][code] without
expanding the content.

To fix this you can expand the content with \expanded{\frame{… \recurselevel …}}
or simpler by using “#1” instead of \recurselevel to access the counter.

The braces around each frame as in your example are only one method to set
the content for each frame (it emulates the \startoverlay and \startcombination
input), when you use a loop you have to use \frame{…} or \startframe … 
\stopframe
to set the content for each frame.


Example:

\usemodule[animation]

\setupinteraction[state=start]

\starttext

\startanimation[menu=yes,framerate=10]
\dorecurse{99}
  {\startframe
   \definedfont[Mono sa 4]\twodigits{#1}%
   \stopframe}
\stopanimation

\stoptext

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-29 Thread Hans Hagen

On 12/29/2012 2:02 AM, Rogers, Michael K wrote:


I thought Hans was talking about the animations of the construction of
Bezier curves, which are pretty cool.


the gears were mentioned in an off-list mail

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-29 Thread Hans Hagen

On 12/29/2012 3:55 AM, Troy Henderson wrote:

Are the gears more correct now?


Yes, it looks better this way. I don't know how deep the tooths need to 
be. Probably some complex formula is needed to determine that.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-29 Thread Mojca Miklavec
On Sat, Dec 29, 2012 at 3:55 AM, Troy Henderson wrote:
 Are the gears more correct now?

Better that previously, but there is still room for improvement. The
teeth are too small among other things.

Bonus question: independent from the gears shape (assume that it stays
as it is), there is something fundamentally wrong with the animation.
What is that? ;)

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-29 Thread Peter Münster
On Sat, Dec 29 2012, Mojca Miklavec wrote:

 there is something fundamentally wrong with the animation.

Not necessarily. Just imagine 2 motors: the 2 right gears are driving
the left one... ;)

-- 
   Peter
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-29 Thread Tom Fossen

Op 29-12-12 16:42, Mojca Miklavec schreef:

On Sat, Dec 29, 2012 at 3:55 AM, Troy Henderson wrote:

Are the gears more correct now?


[ ... ]

Bonus question: independent from the gears shape (assume that it stays
as it is), there is something fundamentally wrong with the animation.
What is that? ;)




I think you draw our attention to the question: which one of the wheals 
is driving which one?


Tom


--
Tom Fossen
Amersfoort
Netherlands
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-29 Thread Troy Henderson

 Bonus question: independent from the gears shape (assume that it stays
 as it is), there is something fundamentally wrong with the animation.
 What is that? ;)


When fixing the teeth, I broke the direction of one of the gears.  It's
repaired now.

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] MetaPost Animations

2012-12-28 Thread Troy Henderson
I've created several animations using MetaPost/ConTeXt, and I have also
created a webpage with these animations.  The URL to the page is

http://www.tlhiv.org/animations/

Feedback is appreciated, and if there is a particular animation that you
would like to see included, let me know and I will attempt to code them up
in MetaPost, provide the source code, and include them on the webpage.

Troy Henderson
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2012-12-28 Thread Otared Kavian
Dear Troy,

I just looked up your animations webpage: congratulations for the beautiful 
work you have done, and thanks for sharing.
I played a little bit with the hypocycloid source file you sent some time ago 
and found it useful for other situations as well.
Would it be possible to have the source files of the other examples you show on 
the webpage
http://www.tlhiv.org/animations/

Also, if I may suggest something, an animation like the one for Riemann sums 
would be very intersting for illustrating the Lebesgue integrals in order to 
show to students what is going on.

Best wishes for the New Year, and best regards: OK

On 28 déc. 2012, at 20:41, Troy Henderson thend...@gmail.com wrote:

 I've created several animations using MetaPost/ConTeXt, and I have also 
 created a webpage with these animations.  The URL to the page is
 
 http://www.tlhiv.org/animations/
 
 Feedback is appreciated, and if there is a particular animation that you 
 would like to see included, let me know and I will attempt to code them up in 
 MetaPost, provide the source code, and include them on the webpage.
 
 Troy Henderson
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2012-12-28 Thread Hans Hagen

On 12/28/2012 8:41 PM, Troy Henderson wrote:

I've created several animations using MetaPost/ConTeXt, and I have also
created a webpage with these animations.  The URL to the page is

http://www.tlhiv.org/animations/

Feedback is appreciated, and if there is a particular animation that you
would like to see included, let me know and I will attempt to code them
up in MetaPost, provide the source code, and include them on the webpage.


There are some animated gifs at:

http://en.wikipedia.org/wiki/B%C3%A9zier_curve

such curves are typical for mp so maybe they qualify.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-28 Thread Rogers, Michael K

On 12/28/2012 8:41 PM, Troy Henderson wrote:
 I've created several animations using MetaPost/ConTeXt, and I have also
 created a webpage with these animations.  The URL to the page is

 http://www.tlhiv.org/animations/

 Feedback is appreciated, and if there is a particular animation that you
 would like to see included, let me know and I will attempt to code them
 up in MetaPost, provide the source code, and include them on the webpage.

Neat.  MP - Flash seems to work well.

One thing, which you may know, gear teeth do not normally have rectangular 
profiles.  Nowadays, they are usually involutes of a circle and formerly were 
usually cycloids (so the gears don't slip against each other when they turn).  
I don't have a reference, but google turned up 
http://www.cadquest.com/books/pdf/gears.pdf, which shows how to draw involute 
gears.

Are you using the animations, or some frames perhaps, in a ConTeXt document?  I 
usually use Mathematica for such animations, but it and its ilk are expensive, 
although there are other alternatives.  As I'm still learning MP/Lua/ConTeXt, 
I'm just interested in the ways others use the system.

Thanks for sharing.

Michael



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-28 Thread Troy Henderson

  One thing, which you may know, gear teeth do not normally have
 rectangular profiles.


This must be what Hans was talking about.


 Are you using the animations, or some frames perhaps, in a ConTeXt
 document?


Well, actually I'm using ConTeXt/MetaPost to generate each frame of the
animation automagically.  The webpage will soon allow for downloading the
source for each ConTeXt document.  This generates a multi-page PDF where
each page of the PDF is a frame of the animation.  SWFtools (specifically,
pdf2swf) can then be used to convert the PDF to SWF.

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2012-12-28 Thread Rogers, Michael K
On Dec 28, 2012, at 3:49 PM, Troy Henderson 
thend...@gmail.commailto:thend...@gmail.com wrote:

One thing, which you may know, gear teeth do not normally have rectangular 
profiles.

This must be what Hans was talking about.

I thought Hans was talking about the animations of the construction of Bezier 
curves, which are pretty cool.

Thanks again for the response.



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2012-12-28 Thread Troy Henderson
Are the gears more correct now?

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Animations

2012-12-28 Thread Otared Kavian
Dear Troy,

The gears are much better now. However, have a look at 
http://fr.wikipedia.org/wiki/Fichier:Involute_wheel.gif
and
http://fr.wikipedia.org/wiki/Engrenage

The animation for Gibbs is also very nice: thanks for sharing!
I tried the TeX file for your Gibbs phenomena animation: I could not get the 
same pictures as you show on your webpage. I get only one page out of 8, and 
the log file says several times:
unknown path q
! Improper `clip'.
to be read again 

Best regards: OK

On 29 déc. 2012, at 03:55, Troy Henderson thend...@gmail.com wrote:

 Are the gears more correct now?
 
 Troy
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Animations

2012-12-28 Thread Troy Henderson

 I tried the TeX file for your Gibbs phenomena animation: I could not get
 the same pictures as you show on your webpage.


I built the TeX file with ConTeXt.  I am using the ConTeXt that comes with
TeX Live 2012.

 context gibbs.tex

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost instance mechanism broken

2012-12-06 Thread Marco Patzer
On 2012–11–25 Marco Patzer wrote:

 in one of the last few betas the MetaPost instance
 mechanism broke.

Did the interface change again? The following does not work on
today's beta, only “alpha” and “gamma” are printed.

\defineMPinstance
  [myinstance]
  [metafun]

\startuseMPgraphic{alpha}
  draw textext(alpha) ;
\stopuseMPgraphic

\startuseMPgraphic{myinstance::beta}
  draw textext(beta) ;
\stopuseMPgraphic

\starttext
  \useMPgraphic{alpha}
  \useMPgraphic{myinstance::beta}
  \startMPcode{myinstance}
draw textext(gamma) ;
  \stopMPcode
\stoptext


Marco

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost instance mechanism broken

2012-12-06 Thread Hans Hagen

On 12/6/2012 8:10 PM, Marco Patzer wrote:

On 2012–11–25 Marco Patzer wrote:


in one of the last few betas the MetaPost instance
mechanism broke.


Did the interface change again? The following does not work on
today's beta, only “alpha” and “gamma” are printed.

\defineMPinstance
   [myinstance]
   [metafun]

\startuseMPgraphic{alpha}
   draw textext(alpha) ;
\stopuseMPgraphic

\startuseMPgraphic{myinstance::beta}
   draw textext(beta) ;
\stopuseMPgraphic

\starttext
   \useMPgraphic{alpha}
   \useMPgraphic{myinstance::beta}
   \startMPcode{myinstance}
 draw textext(gamma) ;
   \stopMPcode
\stoptext


sure, we have a different interface on odd days

Currently instances are played with a bit (as Alan and I want the 
chemical module to run in its own but also want it to be public).


Anyhow, one complication is in the related variables. I now have a 
version that supports this:


\defineMPinstance
  [myinstance]
  [metafun]

\startuseMPgraphic{alpha}
draw textext(alpha) ;
\stopuseMPgraphic

\startuseMPgraphic{myinstance::beta}
  draw textext(beta) ;
\stopuseMPgraphic

\startuniqueMPgraphic{myinstance::beta}{width}
  draw textext(beta) xsized \MPvar{width} ;
\stopuniqueMPgraphic

\startuseMPgraphic{myinstance::epsilon}{width,height}
  draw textext(epsilon) xysized (\MPvar{width},\MPvar{height}) ;
\stopuseMPgraphic

\setMPvariables
  [myinstance::beta]
  [width=5cm]

\setMPvariables
  [epsilon]
  [width=5cm,
   height=5cm]

\starttext

one   : \useMPgraphic{alpha} \blank

two   : \useMPgraphic{myinstance::beta} \blank

three : \startMPcode{myinstance} draw textext(gamma) ; 
\stopMPcode \blank


four  : \reuseMPgraphic{myinstance::beta}{width=2cm} \blank

five  : \startMPcode{myinstance} draw textext(delta) ; 
\stopMPcode \blank


six   : \reuseMPgraphic{myinstance::epsilon}{height=2cm} \blank

seven : \reuseMPgraphic{myinstance::epsilon} \blank

\stoptext

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost instance mechanism broken

2012-11-26 Thread Sietse Brouwer
Aditya wrote:
 I am still using the old 2012.11.16 version, but now you have to specify
 the instance in the \startuseMPgraphic as well (Hans had announced this
 on the mailing list a few weeks ago):
 \startuseMPgraphic{instance::mygraphic}
 ...
 \stopuseMPgraphic

Since I don't use MetaPost, I don't think I'm the best person to
document this. But I took this as an opportunity to create the command
reference pages for a bunch of the \...MP... commands; perhaps one of
you could add this info to the proper page(s)? E.g. at
http://wiki.contextgarden.net/Command/startuseMPgraphic
There is an overview of the new stubs at
http://wiki.contextgarden.net/Template:MetaPost_see_also

Also: a question about
\startuseMPgraphic and
\startuniqueMPgraphic.
Both are supposed to be recompiled at every usage, so how are they
different? Actually trying it out suggests that useMPgraphic is the
only one of the two that re-evaluates its code every time; compare the
examples at
* http://wiki.contextgarden.net/Command/startuseMPgraphic and
* http://wiki.contextgarden.net/Command/startuniqueMPgraphic
But then \startuniqueMPgraphic would be the same as
\startreuseMPgraphic, so I think I'm still missing something.

Cheers,
Sietse
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost instance mechanism broken

2012-11-26 Thread Marco Patzer
2012-11-26 Sietse Brouwer:

 Since I don't use MetaPost, I don't think I'm the best person to
 document this. But I took this as an opportunity to create the command
 reference pages for a bunch of the \...MP... commands; perhaps one of
 you could add this info to the proper page(s)?

Thanks. I added some info about the change mentioned in this thread.

 Also: a question about
 \startuseMPgraphic and
 \startuniqueMPgraphic.
 Both are supposed to be recompiled at every usage, so how are they
 different? Actually trying it out suggests that useMPgraphic is the
 only one of the two that re-evaluates its code every time; compare the
 examples at

AFAIK useMPgraphic is always recalculated, reusableMPgraphic never
is. uniqueMPgraphic takes the size into account and recalculates if
the graphic dimensions change. If I recall correctly this is
mentioned somewhere in the MetaFun manual. But I agree, all these
commands for including MP graphics are confusing, given the fact
that one can survive pretty well with only useMPgraphic. I attached
a small example to show the difference.


Marco
\startuseMPgraphic{alpha}
	fill unitsquare
		xyscaled (\overlaywidth, \overlayheight)
		withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopuseMPgraphic

\defineoverlay
	[alpha]
	[\useMPgraphic{alpha}]

\startreusableMPgraphic{beta}
	fill unitsquare
		xyscaled (\overlaywidth, \overlayheight)
		withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopreusableMPgraphic

\defineoverlay
	[beta]
	[\reuseMPgraphic{beta}]

\startuniqueMPgraphic{gamma}
	fill unitsquare
		xyscaled (\overlaywidth, \overlayheight)
		withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopuniqueMPgraphic

\defineoverlay
	[gamma]
	[\uniqueMPgraphic{gamma}]

\starttext

\dontleavehmode
\framed[background=alpha]{foo}
\framed[background=alpha]{foo}
\framed[background=alpha]{foobar}

\dontleavehmode
\framed[background=beta]{foo}
\framed[background=beta]{foo}
\framed[background=beta]{foobar}

\dontleavehmode
\framed[background=gamma]{foo}
\framed[background=gamma]{foo}
\framed[background=gamma]{foobar}

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost instance mechanism broken

2012-11-26 Thread Aditya Mahajan

On Mon, 26 Nov 2012, Marco Patzer wrote:


2012-11-26 Sietse Brouwer:


Since I don't use MetaPost, I don't think I'm the best person to
document this. But I took this as an opportunity to create the command
reference pages for a bunch of the \...MP... commands; perhaps one of
you could add this info to the proper page(s)?


Thanks. I added some info about the change mentioned in this thread.


Also: a question about
\startuseMPgraphic and
\startuniqueMPgraphic.
Both are supposed to be recompiled at every usage, so how are they
different? Actually trying it out suggests that useMPgraphic is the
only one of the two that re-evaluates its code every time; compare the
examples at


AFAIK useMPgraphic is always recalculated, reusableMPgraphic never
is. uniqueMPgraphic takes the size into account and recalculates if
the graphic dimensions change. If I recall correctly this is
mentioned somewhere in the MetaFun manual. But I agree, all these
commands for including MP graphics are confusing, given the fact
that one can survive pretty well with only useMPgraphic. I attached
a small example to show the difference.


The distinction was more important in MkII when extra runs for different 
MP graphics could take a lot of time. But it MkIV, the difference in 
performance is, I believe, inconsequential.


Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost instance mechanism broken

2012-11-26 Thread Hans Hagen

On 11/26/2012 5:10 PM, Marco Patzer wrote:

2012-11-26 Sietse Brouwer:


Since I don't use MetaPost, I don't think I'm the best person to
document this. But I took this as an opportunity to create the command
reference pages for a bunch of the \...MP... commands; perhaps one of
you could add this info to the proper page(s)?


Thanks. I added some info about the change mentioned in this thread.


Also: a question about
\startuseMPgraphic and
\startuniqueMPgraphic.
Both are supposed to be recompiled at every usage, so how are they
different? Actually trying it out suggests that useMPgraphic is the
only one of the two that re-evaluates its code every time; compare the
examples at


AFAIK useMPgraphic is always recalculated, reusableMPgraphic never
is. uniqueMPgraphic takes the size into account and recalculates if
the graphic dimensions change. If I recall correctly this is


Can be more than dimensions. This is the default hash:

\def\overlaystamp
  {\overlaywidth :%
   \overlayheight:%
   \overlaydepth :%
   \MPcolor\overlaycolor:%
   \MPcolor\overlaylinecolor}

so: width, height, depth, background color, line color

but is one says

\startuniqueMPgraphic{mygraphic}{linewidth,.}

given that linewidth is set, those values are also taken into account


mentioned somewhere in the MetaFun manual. But I agree, all these
commands for including MP graphics are confusing, given the fact
that one can survive pretty well with only useMPgraphic. I attached
a small example to show the difference.


It does make a difference when you have documents with thousands of 
graphics (mkiv is much faster btw) and the pdf file is also smaller when 
reuse is applied


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] MetaPost instance mechanism broken

2012-11-25 Thread Marco Patzer
Hi,

in one of the last few betas the MetaPost instance
mechanism broke.

\defineMPinstance
  [myinstance]
  [metafun]

\startuseMPgraphic{mympgraphic}
  fill fullsquare scaled 1cm withcolor blue;
\stopuseMPgraphic

\starttext\null
  \useMPgraphic{myinstance::mympgraphic}
\stoptext


Marco

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost instance mechanism broken

2012-11-25 Thread Wolfgang Schuster

Am 25.11.2012 um 18:11 schrieb Marco Patzer home...@lavabit.com:

 Hi,
 
 in one of the last few betas the MetaPost instance
 mechanism broke.
 
 \defineMPinstance
  [myinstance]
  [metafun]
 
 \startuseMPgraphic{mympgraphic}
  fill fullsquare scaled 1cm withcolor blue;
 \stopuseMPgraphic
 
 \starttext\null
  \useMPgraphic{myinstance::mympgraphic}
 \stoptext


The problem lies in the \uniqueMPgraphic and \useMPgrpahic commands. There is a 
commented
line in each command which is the correct setting and the next line is wrong.

\def\meta_unique_page_graphic#1#2%
  {\meta_begin_graphic_group{#1}%
   \let\overlaystamp\overlaypagestamp
   \setupMPvariables[\m_meta_page_prefix:\currentMPgraphicname][#2]% prefix is 
new here
%\getvalue{\??mpgraphic\m_meta_page_prefix:\currentMPgraphicname}{}%
   \getvalue{\??mpgraphic\m_meta_page_prefix:#1}{}%
   \meta_end_graphic_group}

\def\meta_use_graphic#1#2%
  {\meta_begin_graphic_group{#1}%
   \doifsomething{#2}{\setupMPvariables[\currentMPgraphicname][#2]}%
  %\getvalue{\??mpgraphic\currentMPgraphicname}\empty
   \getvalue{\??mpgraphic#1}\empty
   \meta_end_graphic_group}

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost instance mechanism broken

2012-11-25 Thread Aditya Mahajan

On Sun, 25 Nov 2012, Marco Patzer wrote:


Hi,

in one of the last few betas the MetaPost instance
mechanism broke.

\defineMPinstance
 [myinstance]
 [metafun]

\startuseMPgraphic{mympgraphic}
 fill fullsquare scaled 1cm withcolor blue;
\stopuseMPgraphic

\starttext\null
 \useMPgraphic{myinstance::mympgraphic}
\stoptext


I am still using the old 2012.11.16 version, but now you have to specify 
the instance in the \startuseMPgraphic as well (Hans had announced this 
on the mailing list a few weeks ago):


\startuseMPgraphic{instance::mygraphic}
...
\stopuseMPgraphic


Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost instance mechanism broken

2012-11-25 Thread Marco Patzer
2012-11-25 Aditya Mahajan:


 I am still using the old 2012.11.16 version, but now you have to specify 
 the instance in the \startuseMPgraphic as well (Hans had announced this 
 on the mailing list a few weeks ago):

I missed that.

 \startuseMPgraphic{instance::mygraphic}
 ...
 \stopuseMPgraphic

This works. Thanks to both of you, Wolfgang and Aditya.


Marco

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] [NTG-Context] MetaPost capacity exceeded.

2012-11-15 Thread Alan BRASLAU

! MetaPost capacity exceeded, sorry [expansion depth=1].

I have come across this error previously
with run-away \dorecurse loops

I now have this message with a document that makes VERY heavy
use of MetaPost; I just have too many figures.

Is there some way to flush the running instance of MetaPost,
that is to force MPlib to respawn or something like that?
(Of course, I would then have to be careful not to rely on the
reuse of any previous MP instances...)

Alan 
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [NTG-Context] MetaPost capacity exceeded.

2012-11-15 Thread Hans Hagen

On 11/15/2012 12:27 PM, Alan BRASLAU wrote:


! MetaPost capacity exceeded, sorry [expansion depth=1].


this normally points to an error in mp code, not to instances


I have come across this error previously
with run-away \dorecurse loops

I now have this message with a document that makes VERY heavy
use of MetaPost; I just have too many figures.

Is there some way to flush the running instance of MetaPost,
that is to force MPlib to respawn or something like that?
(Of course, I would then have to be careful not to rely on the
reuse of any previous MP instances...)


yes:

\starttext

\defineMPinstance
  [myfun-a]
  [format=metafun]

\defineMPinstance
  [myfun-b]
  [format=metafun]

\startMPdefinitions{myfun-a}
color MyColor ; MyColor := (1,0,0) ;
\stopMPdefinitions

\startMPdefinitions{myfun-b}
color MyColor ; MyColor := (0,1,0) ;
\stopMPdefinitions

\startuseMPgraphic{myfun-a::test-1}
fill fullcircle scaled 1cm withcolor MyColor  ;
\stopuseMPgraphic

\startuseMPgraphic{myfun-a::test-2}
fill fullcircle scaled 1cm withcolor MyColor ;
\stopuseMPgraphic

\startuseMPgraphic{myfun-b::test-1}
fill fullcircle scaled 1cm withcolor MyColor  ;
\stopuseMPgraphic

\startuseMPgraphic{myfun-b::test-2}
fill fullcircle scaled 1cm withcolor MyColor ;
\stopuseMPgraphic

\useMPgraphic{myfun-a::test-1}
\useMPgraphic{myfun-b::test-1}
\useMPgraphic{myfun-a::test-2}
\useMPgraphic{myfun-b::test-2}

\stoptext

however, during some cleanup stage something got lost ... so you need to 
fix this:


\unprotect

\def\meta_use_graphic#1#2%
  {\meta_begin_graphic_group{#1}%
   \doifsomething{#2}{\setupMPvariables[\currentMPgraphicname][#2]}%
   \getvalue{\??mpgraphic#1}%
   \meta_end_graphic_group}

\protect

there are few more places where

   \getvalue{\??mpgraphic ...

needs a #1 (I'll fix it).

So indeed you can have multiple independent instances. For instance we 
could have one for the chemical stuff which then cannot be messed up by 
other instances.


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] metapost dashpattern (on 1) not shown in Mountain Lion Preview

2012-09-25 Thread Mojca Miklavec
On Tue, Sep 25, 2012 at 7:28 AM, Xiao-Yong Jin wrote:

 Dear all,

 I just upgrade to Mountain Lion and found out that dashed dashpattern (on
 1) no longer shows any line in Preview.  The attached file is a snapshot of
 the Preview window showing the pdf file generated by the following code.

 \starttext
 \startMPpage

 draw unitsquare scaled 4cm dashed dashpattern (on 1cm off 1cm) ;
 draw unitsquare scaled 4cm shifted (5cm,0) dashed dashpattern (on 1cm) ;
 draw unitsquare scaled 4cm shifted (10cm,0) dashed dashpattern (off 1cm) ;

 setbounds currentpicture to boundingbox currentpicture enlarged 0.1cm ;
 \stopMPpage
 \stoptext

 You can see, from the attached file, that the unitsquare which was
 supposed to appear in the middle does not show up in the Preview window.
 However the same file is displayed correctly in Acrobat Reader.

Awesome ;)

Just curious: what do you get if you try to draw the same plots with
PostScript terminal in gnuplot?

 I am not sure whether it is a context problem, or it is just a bug in
 Mountain Lion.  I found out this issue when I saw that all the pdf files I
 previously generated with gnuplot context term are showing up incorrectly
 under the Preview after upgrading to Mountain Lion.  I had to change the
 dash pattern in file metapost/context/third/gnuplot/mp-gnuplot.mp, so the
 pdf generated by gnuplot context term can be viewed correctly with Preview
 under Mountain Lion.

What modifications did you do exactly?

It seems that (on 1cm) generates
[28.34645 0 ] 0 setdash
and (off 1cm) generates
[] 0 setdash
in PostScript file.

What I had in mind when I was writing the code was for (on 1cm) to generate
[] 0 setdash
meaning a solid line. The other pattern (off 1cm) for linetype -3 is
described in gnuplot's README as follows:
An lt of -3 is solid and drawn with xor (for temporary interactive
annotations).
and I actually had no idea what to draw since PostScript cannot draw
XORed lines - I was most probably hoping to get an invisible line ;)

Thinking again about it, different transparency models in PDF are
actually able to do some weird transformations (color subtraction
etc.), but I'm not sure if I could get what I want.

Now, according to specification, the pattern
[28.34645 0 ] 0 setdash
should actually draw almost a solid line, or, to be mathematically
precise, a line composed of 1cm long segments with zero-width gaps.
The difference might be evident when drawing semi-transparent lines
and linecaps might overlap. If you ask me, it's definitely a bug in
Mountain Lion's renderer if it doesn't draw the line. On the other
hand, it probably makes sense to patch MetaPost to generate [] 0
setdash instead of [x 0 ] 0 setdash in case when it gets (on
x) as an argument. But then again, the original code should
probably call dashpattern() without any argument to get solid lines.

The argument (off 1cm) is weird anyway (my bug) and honestly I'm
not sure what would be the most appropriate behaviour in the eyes of
metapost. Maybe not drawing anything at all? Throwing an error?
Inserting (on 0pt) would be wrong as that actually draws dots. When
using (off 1cm on 0cm) it works as it should - it draws dots (when
using round linecaps).

I believe the best course of actions would be:
- Filing a bug to Apple with a minimal EPS example. (I can try to
prepare one.) But that won't help anyway. I've filed several bug
reports and the only time when they replied was with asking if it was
fixed when it wasn't. And 4 years have passed since, nothing happened.
- I will replace dashpattern(on 1cm) with dashpattern() for
linetype 0 and -2 in mp-gnuplot.mp. Can you please confirm if that
works?
- After ConTeXt Meeting/EuroTeX is over, we could discuss with Taco
what MetaPost should do when it gets (on 1cm) or (off 1cm) as an
argument. If nothing else, the manual should clearly describe the
behaviour. Are you willing to open a ticket at
http://tracker.luatex.org?

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] metapost dashpattern (on 1) not shown in Mountain Lion Preview

2012-09-25 Thread Xiao-Yong Jin

On Sep 25, 2012, at 5:45 PM, Mojca Miklavec mojca.miklavec.li...@gmail.com 
wrote:

 On Tue, Sep 25, 2012 at 7:28 AM, Xiao-Yong Jin wrote:
 
 Dear all,
 
 I just upgrade to Mountain Lion and found out that dashed dashpattern (on
 1) no longer shows any line in Preview.  The attached file is a snapshot of
 the Preview window showing the pdf file generated by the following code.
 
 \starttext
 \startMPpage
 
 draw unitsquare scaled 4cm dashed dashpattern (on 1cm off 1cm) ;
 draw unitsquare scaled 4cm shifted (5cm,0) dashed dashpattern (on 1cm) ;
 draw unitsquare scaled 4cm shifted (10cm,0) dashed dashpattern (off 1cm) ;
 
 setbounds currentpicture to boundingbox currentpicture enlarged 0.1cm ;
 \stopMPpage
 \stoptext
 
 You can see, from the attached file, that the unitsquare which was
 supposed to appear in the middle does not show up in the Preview window.
 However the same file is displayed correctly in Acrobat Reader.
 
 Awesome ;)
 
 Just curious: what do you get if you try to draw the same plots with
 PostScript terminal in gnuplot?

The PostScript terminal in gnuplot works fine.  However, if I wrap the metapost 
code in my previous message with begin/endfig and run it with mpost to 
generate postscript, Preview does not show lines with dashpattern (on 1) 
either.

 I am not sure whether it is a context problem, or it is just a bug in
 Mountain Lion.  I found out this issue when I saw that all the pdf files I
 previously generated with gnuplot context term are showing up incorrectly
 under the Preview after upgrading to Mountain Lion.  I had to change the
 dash pattern in file metapost/context/third/gnuplot/mp-gnuplot.mp, so the
 pdf generated by gnuplot context term can be viewed correctly with Preview
 under Mountain Lion.
 
 What modifications did you do exactly?

I simply changed on to off for line type -2 and 0.

 
 It seems that (on 1cm) generates
[28.34645 0 ] 0 setdash
 and (off 1cm) generates
[] 0 setdash
 in PostScript file.
 
 What I had in mind when I was writing the code was for (on 1cm) to generate
[] 0 setdash
 meaning a solid line. The other pattern (off 1cm) for linetype -3 is
 described in gnuplot's README as follows:
An lt of -3 is solid and drawn with xor (for temporary interactive
 annotations).
 and I actually had no idea what to draw since PostScript cannot draw
 XORed lines - I was most probably hoping to get an invisible line ;)
 
 Thinking again about it, different transparency models in PDF are
 actually able to do some weird transformations (color subtraction
 etc.), but I'm not sure if I could get what I want.
 
 Now, according to specification, the pattern
[28.34645 0 ] 0 setdash
 should actually draw almost a solid line, or, to be mathematically
 precise, a line composed of 1cm long segments with zero-width gaps.
 The difference might be evident when drawing semi-transparent lines
 and linecaps might overlap. If you ask me, it's definitely a bug in
 Mountain Lion's renderer if it doesn't draw the line. On the other
 hand, it probably makes sense to patch MetaPost to generate [] 0
 setdash instead of [x 0 ] 0 setdash in case when it gets (on
 x) as an argument. But then again, the original code should
 probably call dashpattern() without any argument to get solid lines.

Simply call dashpattern() works as expected.

 
 The argument (off 1cm) is weird anyway (my bug) and honestly I'm
 not sure what would be the most appropriate behaviour in the eyes of
 metapost. Maybe not drawing anything at all? Throwing an error?
 Inserting (on 0pt) would be wrong as that actually draws dots. When
 using (off 1cm on 0cm) it works as it should - it draws dots (when
 using round linecaps).
 
 I believe the best course of actions would be:
 - Filing a bug to Apple with a minimal EPS example. (I can try to
 prepare one.) But that won't help anyway. I've filed several bug
 reports and the only time when they replied was with asking if it was
 fixed when it wasn't. And 4 years have passed since, nothing happened.
 - I will replace dashpattern(on 1cm) with dashpattern() for
 linetype 0 and -2 in mp-gnuplot.mp. Can you please confirm if that
 works?
 - After ConTeXt Meeting/EuroTeX is over, we could discuss with Taco
 what MetaPost should do when it gets (on 1cm) or (off 1cm) as an
 argument. If nothing else, the manual should clearly describe the
 behaviour. Are you willing to open a ticket at
 http://tracker.luatex.org?

I'm not sure what to put in the ticket.  I guess it is more appropriate if you 
can open a ticket, since you know the details of the matter.

Best,
Xiaoyong

 Mojca
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http

[NTG-context] metapost dashpattern (on 1) not shown in Mountain Lion Preview

2012-09-24 Thread Xiao-Yong Jin
Dear all,I just upgrade to Mountain Lion and found out that "dashed dashpattern (on 1)" no longer shows any line in Preview. The attached file is a snapshot of the Preview window showing the pdf file generated by the following code.\starttext\startMPpagedraw unitsquare scaled 4cm dashed dashpattern (on 1cm off 1cm) ;draw unitsquare scaled 4cm shifted (5cm,0) dashed dashpattern (on 1cm) ;draw unitsquare scaled 4cm shifted (10cm,0) dashed dashpattern (off 1cm) ;setbounds currentpicture to boundingbox currentpicture enlarged 0.1cm ;\stopMPpage\stoptextYou can see, from the attached file, that the unitsquare which was supposed to appear in the middle does not show up in the Preview window. However the same file is displayed correctly in Acrobat Reader.I am not sure whether it is a context problem, or it is just a bug in Mountain Lion. I found out this issue when I saw that all the pdf files I previously generated with gnuplot context term are showing up incorrectly under the Preview after upgrading to Mountain Lion. I had to change the dash pattern in file "metapost/context/third/gnuplot/mp-gnuplot.mp", so the pdf generated by gnuplot context term can be viewed correctly with Preview under Mountain Lion.Best,Xiaoyong___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Sequence of MetaPost Pages

2012-09-09 Thread Troy Henderson
When I create animations using MetaPost, I typically do something like

for n=1 upto N:
   beginfig(n);
  some code
   endfig;
endfor;

and a sequence of figures are created.  How can I do this in ConTeXt using
\startMPpage ... \stopMPpage?

Troy Henderson
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Sequence of MetaPost Pages

2012-09-09 Thread Aditya Mahajan

On Sun, 9 Sep 2012, Troy Henderson wrote:


When I create animations using MetaPost, I typically do something like

for n=1 upto N:
  beginfig(n);
 some code
  endfig;
endfor;

and a sequence of figures are created.  How can I do this in ConTeXt using
\startMPpage ... \stopMPpage?


(untested)

\dorecurse{10}
   {\startMPpage
   label(btex On step \recurselevel etex, origin);
\stopMPpage}

(There is also \dostepwiserecurse if you need more control).

Aditya

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Sequence of MetaPost Pages

2012-09-09 Thread Troy Henderson
That works great.  Now I have defined a global numeric

N:=8;

in \startMPinclusions ... \stopMPinclusions at the be beginning of my
document.  All of my \startMPpage ... \stopMPpage environments understand
this N, but how do I reference this value as the start value for
\dostepwiserecurse?  That is, I would like to do something like

\dostepwiserecurse{N}{0}{-1}{ ... some code ... }

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Sequence of MetaPost Pages

2012-09-09 Thread Aditya Mahajan

That works great.  Now I have defined a global numeric

N:=8;

in \startMPinclusions ... \stopMPinclusions at the be beginning of my
document.  All of my \startMPpage ... \stopMPpage environments understand
this N, but how do I reference this value as the start value for
\dostepwiserecurse?  That is, I would like to do something like

\dostepwiserecurse{N}{0}{-1}{ ... some code ... }


For that, you'll need to work on the TeX end.

\edef\STEPS{8}

\dorecurse\STEPS{}

You can either use \STEPS instead of N everywhere in your code (and be 
careful on how TeX code is parsed, i.e., `a := \STEPS 0` will evaluate to 
`a := 80`), or use `N := \STEPS;` somewhere in the beginning of each 
`\MPpage` (the `N :\ \STEPS` can be hidden behind a macro like 
`\initializeAnimation`).


Aditya

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Sequence of MetaPost Pages

2012-09-09 Thread Troy Henderson

 label(decimal(n),origin);


Sorry.  I found the answer by wrapping the decimal() inside textext().
That is,

label(textext(decimal(n)),origin);

does what I want.

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Standalone MetaPost Graphics from ConTeXt

2012-08-30 Thread Troy Henderson
Is there a way to output several MetaPost PDF graphics from a single
ConTeXt source file.  For example,

\startMPpage
  draw fullcircle scaled 72;
\stopMPpage

\startMPpage
  draw unitsquare scaled 72;
\stopMPpage

and have a separate output PDF generated for each MPpage?  It seems that
this ConTeXt code generates a single PDF which contains only the first
graphic.  I would like to have either

1) two separate PDF's with each containing their own graphic
2) a single two page PDF where each page corresponds to the appropriate
graphic.

Of course, the holy grail would be to be able to compile a MetaPost
source file with ConTeXt.

Troy Henderson
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Standalone MetaPost Graphics from ConTeXt

2012-08-30 Thread luigi scarso
On Thu, Aug 30, 2012 at 10:57 PM, Troy Henderson thend...@gmail.com wrote:

 Is there a way to output several MetaPost PDF graphics from a single
 ConTeXt source file.  For example,

 \startMPpage
   draw fullcircle scaled 72;
 \stopMPpage

 \startMPpage
   draw unitsquare scaled 72;
 \stopMPpage

 and have a separate output PDF generated for each MPpage?  It seems that
 this ConTeXt code generates a single PDF which contains only the first
 graphic.  I would like to have either

 1) two separate PDF's with each containing their own graphic
 2) a single two page PDF where each page corresponds to the appropriate
 graphic.

 Of course, the holy grail would be to be able to compile a MetaPost
 source file with ConTeXt.


for 2)

save this in test.mkiv

\starttext
\startMPpage
  draw fullcircle scaled 72;
\stopMPpage

\startMPpage
  draw unitsquare scaled 72;
\stopMPpage
\stoptext

$context test.mkiv
-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Standalone MetaPost Graphics from ConTeXt

2012-08-30 Thread Aditya Mahajan

On Thu, 30 Aug 2012, Troy Henderson wrote:


Is there a way to output several MetaPost PDF graphics from a single
ConTeXt source file.  For example,


\starttext

\startMPpage
 draw fullcircle scaled 72;
\stopMPpage

\startMPpage
 draw unitsquare scaled 72;
\stopMPpage

\stoptext


and have a separate output PDF generated for each MPpage?  It seems that
this ConTeXt code generates a single PDF which contains only the first
graphic.  I would like to have either


If you add \starttext ... \stoptext, then ConTeXt generates a single PDF 
with all pages.



1) two separate PDF's with each containing their own graphic


You can use external tools like pdftk to split a pdf file into multiple 
files.



2) a single two page PDF where each page corresponds to the appropriate
graphic.


See above.


Of course, the holy grail would be to be able to compile a MetaPost
source file with ConTeXt.


(Relevant? http://article.gmane.org/gmane.comp.tex.context/78007)

With a recent beta, you can use:

   context file.mp

to compile a ConTeXt file.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Standalone MetaPost Graphics from ConTeXt

2012-08-30 Thread Troy Henderson
Thank you both!

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost Page height

2012-08-19 Thread Hans Hagen

On 18-8-2012 14:18, Troy Henderson wrote:

The follow code produces a PDF whose page height is too large (i.e., is not
tight enough around the graphic).  How can I get this the height to be as
tight as the width?

\startMPpage
bboxmargin:=0;
label(btex foo etex,origin);
\stopMPpage

Thanks in advance,


This is nedeed an annoying side effect. It has to do with the fact that 
a page gets a topskip (by default) and it happens that this text is  
topskip so it gets moved down in the page builder. I've added an option 
to the makeup commands ( location=top ). Mp pages are fitting pages and 
these are makeups. So, the next beta will behave better (for tex as well 
as mp pages).


In practice topskip will not kick in that often as MPpages are normally 
larger. Compare


\startMPpage
label(btex foo etex,origin) ysized 11pt ;
\stopMPpage

\startMPpage
label(btex foo etex,origin) ysized 10pt ;
\stopMPpage


\startMPpage
label(btex foo etex,origin) ysized 9pt ;
\stopMPpage



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost Page height

2012-08-19 Thread Troy Henderson
Thanks Hans.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] MetaPost Page height

2012-08-18 Thread Troy Henderson
The follow code produces a PDF whose page height is too large (i.e., is not
tight enough around the graphic).  How can I get this the height to be as
tight as the width?

\startMPpage
   bboxmargin:=0;
   label(btex foo etex,origin);
\stopMPpage

Thanks in advance,

Troy Henderson
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] [metapost] MetaPost transformation

2012-05-31 Thread Dan Luecking

At 07:56 PM 5/30/2012, Troy Henderson wrote:
Well then in case anyone needs such a transformation, I've 
constructed the (non-unique) transformation T


 t:=angle(f,e);
 q:=e++f;
 p:=(c*f-d*e)/q;
 s:=(c*e+d*f)/(q**2);
 transform T;
 T:=identity rotated t xscaled p yscaled q slanted s shifted (a,b);

This yields T=(a,b,c,d,e,f).


You can implement something like what you wanted directly
because, just as you can write equations for the parts of
a pair, you can also write equations for the parts of a
transform:
vardef mktransform (expr a,b,c,d,e,f) =
  save T_; transform T_;
  xpart  T_ = a;
  ypart  T_ = b;
  xxpart T_ = c;
  xypart T_ = d;
  yxpart T_ = e;
  yypart T_ = f;
  T_
enddef;

After this
  transform T;
  T := mktransform (1,2,3,4,5,6);
  show T;
produces:
 (1,2,3,4,5,6)

Regards,
Dan


Daniel H. Luecking
Department of Mathematical Sciences
Fayetteville, Arkansas
http://www-cs-faculty.stanford.edu/~knuth/iaq.html 


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost transformation

2012-05-31 Thread Albrecht Kauffmann

Hello Troy,

if you declare a transform variable (e.g., t), it works:

transform t;
t := identity rotated 270 yscaled 0.5;
show identity transformed t;

(0,0,0,1,-0.5,0)


Greetings
Albrecht

On Wed, 30 May 2012, Troy Henderson wrote:


I've encountered a MetaPost issue, and since many MetaPost users also use
ConTeXt (and vice-versa), I am posting this question on both lists.

The command


show identity rotated 270 yscaled 0.5;


outputs

(0,0,0,1,-0.5,0)

as expected, while the command


show identity transformed (0,0,0,1,-0.5,0);


errors with

---
! Missing `)' has been inserted.
to be read again
  ,
l.26 ^^Ishow identity transformed (0,0,0,1,
  -0.5,0);
---

I am using MetaPost 1.504, and the problem seems to be that MetaPost does
not like me using the sextuple (0,0,0,1,-0.5,0) directly, but this is the
most convenient method for me to describe my transformations.  Is this a
bug in MetaPost, or am I not allowed to use transformations directly with
sextuples?

Troy Henderson


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost transformation

2012-05-31 Thread Troy Henderson
Albrecht,

The issue was to be able to define the transform t using its six components.

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] MetaPost transformation

2012-05-30 Thread Troy Henderson
I've encountered a MetaPost issue, and since many MetaPost users also use
ConTeXt (and vice-versa), I am posting this question on both lists.

The command

 show identity rotated 270 yscaled 0.5;

outputs

(0,0,0,1,-0.5,0)

as expected, while the command

 show identity transformed (0,0,0,1,-0.5,0);

errors with

---
! Missing `)' has been inserted.
to be read again
   ,
l.26 ^^Ishow identity transformed (0,0,0,1,
   -0.5,0);
---

I am using MetaPost 1.504, and the problem seems to be that MetaPost does
not like me using the sextuple (0,0,0,1,-0.5,0) directly, but this is the
most convenient method for me to describe my transformations.  Is this a
bug in MetaPost, or am I not allowed to use transformations directly with
sextuples?

Troy Henderson
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaPost transformation

2012-05-30 Thread Hans Hagen

On 30-5-2012 23:10, Troy Henderson wrote:

I've encountered a MetaPost issue, and since many MetaPost users also use
ConTeXt (and vice-versa), I am posting this question on both lists.

The command


show identity rotated 270 yscaled 0.5;


outputs

(0,0,0,1,-0.5,0)

as expected, while the command


show identity transformed (0,0,0,1,-0.5,0);


errors with

---
! Missing `)' has been inserted.
to be read again
,
l.26 ^^Ishow identity transformed (0,0,0,1,
-0.5,0);
---

I am using MetaPost 1.504, and the problem seems to be that MetaPost does
not like me using the sextuple (0,0,0,1,-0.5,0) directly, but this is the
most convenient method for me to describe my transformations.  Is this a
bug in MetaPost, or am I not allowed to use transformations directly with
sextuples?


It looks like sextuples are no basic datatype. I think that the show is 
just a way to output the internal representation. Of course it would 
make sense to have sixtuples (I can even think of a generic n-tuple).


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost transformation

2012-05-30 Thread Troy Henderson
Well then in case anyone needs such a transformation, I've constructed the
(non-unique) transformation T

 t:=angle(f,e);
 q:=e++f;
 p:=(c*f-d*e)/q;
 s:=(c*e+d*f)/(q**2);
 transform T;
 T:=identity rotated t xscaled p yscaled q slanted s shifted (a,b);

This yields T=(a,b,c,d,e,f).

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] [metapost] MetaPost transformation

2012-05-30 Thread Troy Henderson
Thanks Dan.  This is much better than what I was doing.

Troy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Font for MetaPost graphics

2012-05-10 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

many thanks Marco for wikifying.

On Tue, 08 May 2012 21:57:04 +0200, Marco net...@lavabit.com wrote:


Thanks a lot Hans for implementing this.

Wikified:

http://wiki.contextgarden.net/Command/defineMPinstance
http://wiki.contextgarden.net/Command/setupMPinstance


Best wishes

Marco



With the permission, I tried to replace the tag texcode with context to get 
source and result.

context mode=mkiv source=yes text=Gives:
...
/context

Unfortunately, the result doesn't appear.

So, what to do to make the example work?

Will it work automatically once the Ctx/MP engine updates on wiki?

Best regards,

Lukas


--
Ing. Lukáš Procházka [mailto:l...@pontex.cz]
Pontex s. r. o.  [mailto:pon...@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Font for MetaPost graphics

2012-05-10 Thread Marco
On 2012-05-10 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote:

 With the permission, I tried to replace the tag texcode with context to
 get source and result.
 
 context mode=mkiv source=yes text=Gives:
 ...
 /context
 
 Unfortunately, the result doesn't appear.

The code is MkIV only and the wiki uses MkII.

 So, what to do to make the example work?

Find someone who has time to implement and administrate a working
MkIV wiki solution.

 Will it work automatically once the Ctx/MP engine updates on wiki?

*If* the engine gets updated someday, it will probably work, yes.


Marco


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Marco
On 2012-05-05 Hans Hagen pra...@wxs.nl wrote:

This code fails:

\defineMPinstance [mympinstance] [metafun] [textcolor=red]

\starttext

\startMPcode
draw textext(some text) ;
\stopMPcode

\startMPcode{mympinstance}
draw textext(some text) ;
\stopMPcode

\stoptext

Marco


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Hans Hagen

On 8-5-2012 19:01, Marco wrote:

On 2012-05-05 Hans Hagenpra...@wxs.nl  wrote:


Did I?


This code fails:

\defineMPinstance [mympinstance] [metafun] [textcolor=red]

\starttext

\startMPcode
draw textext(some text) ;
\stopMPcode

\startMPcode{mympinstance}
draw textext(some text) ;
\stopMPcode

\stoptext

Marco


It works here.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Marco
On 2012-05-08 Hans Hagen pra...@wxs.nl wrote:

 On 8-5-2012 19:01, Marco wrote:
  On 2012-05-05 Hans Hagenpra...@wxs.nl  wrote:
 
 Did I?

My bad ;)

  This code fails:
 
  \defineMPinstance [mympinstance] [metafun] [textcolor=red]
 
  \starttext
 
  \startMPcode
  draw textext(some text) ;
  \stopMPcode
 
  \startMPcode{mympinstance}
  draw textext(some text) ;
  \stopMPcode
 
  \stoptext
 
  Marco
 
 It works here.

Fails here, source and log are attached.

current version: 2012.05.08 13:45

Marco
\defineMPinstance [mympinstance] [metafun] [textcolor=red]

\starttext

\startMPcode
	draw textext(some text) ;
\stopMPcode

\startMPcode{mympinstance}
	draw textext(some text) ;
\stopMPcode

\stoptext
(g.tex

ConTeXt  ver: 2012.05.08 13:45 MKIV  fmt: 2012.5.8  int: english/english

system   cont-new.mkiv loaded
(/home/zewz/context/tex/texmf-context/tex/context/base/cont-new.mkiv
system   beware: some patches loaded from cont-new.mkiv
)
system   g.top loaded

system   options  start used options

used options % runtime options files (command line driven)
used options \unprotect
used options % feedback and basic job control
used options % handy for special styles
used options \startluacode
used options document = document or { }
used options document.arguments={
used options  [once]=true,
used options }
used options document.files={
used options  g,
used options }
used options \stopluacode
used options % process info
used options \setupsystem[inputfile=g]
used options \setupsystem[\c!n=3,\c!m=1]
used options \enabledirectives[system.runonce]
used options % modes
used options % options (not that important)
used options \startsetups *runtime:options
used options \stopsetups
used options % styles and modules
used options \startsetups *runtime:modules
used options \stopsetups
used options % done
used options \protect \endinput

system   options  stop used options

(g.top)
fontslatin modern fonts are not preloaded
languageslanguage en is active
{/home/zewz/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fontspreloading latin modern fonts (second stage)
fontstypescripts  unknown: library 'loc'
{/home/zewz/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/home/zewz/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fontsvirtual math  unable to resolve name mapsfromchar
fontsfallback modern rm 12pt is loaded
metapost initializing instance 'metafun' using format 'metafun'
metapost loading 'metafun': /home/zewz/context/tex/texmf-context/metapost/context/base/metafun.mpiv
metapost initializing instance 'mympinstance' using format 'metafun'
metapost loading 'metafun': /home/zewz/context/tex/texmf-context/metapost/context/base/metafun.mpiv
! terminal:  OverlayLineColor
 (0,0,0)
! Equation cannot be performed (numeric=color).
to be read again 
   ;
* ...ineWidth:=0pt  ; OverlayLineColor:=(0,0,0);
   OverlayColor:=(0,0,0); Ba...

 OverlayColor
 (0,0,0)
! Equation cannot be performed (numeric=color).
to be read again 
   ;
* ...yLineColor:=(0,0,0); OverlayColor:=(0,0,0);
   BaseLineSkip:=14.4816pt; ...


.

system   tex  error on line 11 in file g.tex: terminal:  OverlayLineColor
 (0,0,0)
! Equation cannot be performed (numeric=color).
to be read again 
   ;
* ...ineWidth:=0pt  ; OverlayLineColor:=(0,0,0);
   OverlayColor:=(0,0,0); Ba...

 OverlayColor
 (0,0,0)
! Equation cannot be performed (numeric=color).
to be read again 
   ;
* ...yLineColor:=(0,0,0); OverlayColor:=(0,0,0);
   BaseLineSkip:=14.4816pt; ...


 ...

 1 \defineMPinstance [mympinstance] [metafun] [textcolor=red]
 2 
 3 \starttext
 4 
 5 \startMPcode
 6 	draw textext(some text) ;
 7 \stopMPcode
 8 
 9 \startMPcode{mympinstance}
10 	draw textext(some text) ;
11   \stopMPcode
12 
13 \stoptext
14 

inserted text ...0;;]===], [===[;;]===], false)}
  
\meta_process_graphic ...!!es , \MPaskedfigure )}}
  \egroup \placeMPgraphic \m...
\meta_start_code_instance ..._process_graphic {#2}
  \meta_end_graphic_group 
l.11 \stopMPcode

? x

system   files  start used files

used files  1: filename=g | filetype=tex | foundname=g.tex | usedmethod=filesystem
used files  2: filename=cont-new.mkiv | filetype=tex | foundname=/home/zewz/context/tex/texmf-context/tex/context/base/cont-new.mkiv | usedmethod=database
used files

Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Hans Hagen

On 8-5-2012 19:19, Marco wrote:

On 2012-05-08 Hans Hagenpra...@wxs.nl  wrote:


On 8-5-2012 19:01, Marco wrote:

On 2012-05-05 Hans Hagenpra...@wxs.nl   wrote:


Did I?


My bad ;)


This code fails:

\defineMPinstance [mympinstance] [metafun] [textcolor=red]

\starttext

\startMPcode
draw textext(some text) ;
\stopMPcode

\startMPcode{mympinstance}
draw textext(some text) ;
\stopMPcode

\stoptext

Marco


It works here.


Fails here, source and log are attached.


ok, can you add this to cont-new.mkiv (after \unprotect):

\def\m_meta_colo_initializations{%
vardef OverlayLineColor=\MPcolor{\overlaylinecolor} enddef;
vardef OverlayColor=\MPcolor{\overlaycolor} enddef;
}

I have that in my local experimental code. It has to do with the fact 
that mp's color spaces are not compatible with each other. As I've used 
that patch for quite a while now I could probably move it to the core.


Maybe more users can test this.

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Marco
On 2012-05-08 Hans Hagen pra...@wxs.nl wrote:

 ok, can you add this to cont-new.mkiv (after \unprotect):
 
 \def\m_meta_colo_initializations{%
  vardef OverlayLineColor=\MPcolor{\overlaylinecolor} enddef;
  vardef OverlayColor=\MPcolor{\overlaycolor} enddef;
 }

That works.

 As I've used that patch for quite a while now I could probably
 move it to the core.

Since you use it for a while it seems to work ⇒ into the core

Thanks a lot Hans for implementing this.

Wikified:

http://wiki.contextgarden.net/Command/defineMPinstance
http://wiki.contextgarden.net/Command/setupMPinstance


Best wishes

Marco


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-07 Thread Mari Voipio
On Sun, May 6, 2012 at 4:52 PM, Hans Hagen pra...@wxs.nl wrote:
 You have seen this one, haven't you? Posted by Don Knuth:

 http://www.youtube.com/watch?v=YVuggGxeBVk

 So that's your next challenge.

Yes, I've seen it, had to watch the whole thing, it is so fascinating.

If I ever decide to invest in such a machine, it'll be an expensive
one that allows me to digitize my own graphics (not just ready-made
sets), preferably as vectors. In which case doing *that* isn't so much
of a challenge any more.

I've coveted one of those for a while, but currently cannot justifty
getting one, neither for fun nor for my tiny craft business as that
one is concentrated on the pre-steam era. However, I'm planning to use
MetaPost to create blackwork charts, I've got the feeling that it'll
give me neater results than any existing software. And I won't be
stuck with one OS, either. :-)


Mari
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread Mari Voipio
On Mon, Apr 23, 2012 at 9:04 PM, Hans Hagen pra...@wxs.nl wrote:
 beware, metapost is addictive once you get better in it,

It is. :-)

This one is to both you and Peter, because your snippets together
helped me adjust from WYSIWYG vector graphics to MetaPost - not that
I'm that far yet, but I understand a lot more than I did.

http://www.lucet.fi/textiles/


The fingerloop braiding patterns are still under construction, but I
think I now know a lot better what I need to do there. And my
fingerloop braiding suite idea was well received, so it looks like
ConTeXt will be present at Braids 2012 in August
(http://www.braidsociety.com/confer.htm); not as a talk, but as
finished materials, in poster form and, obviously, on my computer.


 (btw, a talk about this will fit nicely in the upcoming eurotex theme)

I think I already happened to promise that to Taco... I guess the
title of my talk is now TeXtile craft or TeXtiles or something
like that. You still time to make a wish or two. :-)


Definitely hooked on MetaPost,

Mari
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread Mari Voipio
PS. I got this link from a friend who'd struggled with an event
registration system, but it SO applies to my MetaPost project:

http://www.howtogeek.com/102420/geeks-versus-non-geeks-when-doing-repetitive-tasks-funny-chart/


(Scary, I seem to count as geeknow...)
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread luigi scarso
On Sun, May 6, 2012 at 10:53 AM, Mari Voipio mari.voi...@iki.fi wrote:
 http://www.lucet.fi/textiles/

ConTeXt, developed by the Dutch company Pragma Advanced Document
Engineering, is not open source software,

Hm, I'm not sure that it's correct.
-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread Wolfgang Schuster

Am 06.05.2012 um 11:16 schrieb luigi scarso:

 On Sun, May 6, 2012 at 10:53 AM, Mari Voipio mari.voi...@iki.fi wrote:
 http://www.lucet.fi/textiles/
 
 ConTeXt, developed by the Dutch company Pragma Advanced Document
 Engineering, is not open source software,
 
 Hm, I'm not sure that it's correct.

ConTeXt is licensed under the GPL, you can find the information in this 
document: http://pragma-ade.com/general/manuals/mreadme.pdf

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread luigi scarso
On Sun, May 6, 2012 at 11:56 AM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 06.05.2012 um 11:16 schrieb luigi scarso:

 On Sun, May 6, 2012 at 10:53 AM, Mari Voipio mari.voi...@iki.fi wrote:
 http://www.lucet.fi/textiles/
 
 ConTeXt, developed by the Dutch company Pragma Advanced Document
 Engineering, is not open source software,
 
 Hm, I'm not sure that it's correct.

 ConTeXt is licensed under the GPL, you can find the information in this 
 document: http://pragma-ade.com/general/manuals/mreadme.pdf
yes I know: another useful link is
http://en.wikipedia.org/wiki/Talk:ConTeXt

I think we can say that, at least today,
ConTeXt  is not open source software
is wrong,
but maybe there are  older versions for which this statement is  still true.

-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread Pontus Lurcock
On Sun 06 May 2012, Wolfgang Schuster wrote:

 
 Am 06.05.2012 um 11:16 schrieb luigi scarso:
 
  On Sun, May 6, 2012 at 10:53 AM, Mari Voipio mari.voi...@iki.fi wrote:
  http://www.lucet.fi/textiles/
  
  ConTeXt, developed by the Dutch company Pragma Advanced Document
  Engineering, is not open source software,
  
  Hm, I'm not sure that it's correct.
 
 ConTeXt is licensed under the GPL, you can find the information in this 
 document: http://pragma-ade.com/general/manuals/mreadme.pdf

There was previous discussion and clarification on this at
http://tex.stackexchange.com/questions/12431/using-context-commercially
and
http://archive.contextgarden.net/message/20110301.213750.c7a55835.en.html .

Pont
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread Hans Hagen

On 6-5-2012 13:33, Pontus Lurcock wrote:

On Sun 06 May 2012, Wolfgang Schuster wrote:



Am 06.05.2012 um 11:16 schrieb luigi scarso:


On Sun, May 6, 2012 at 10:53 AM, Mari Voipiomari.voi...@iki.fi  wrote:

http://www.lucet.fi/textiles/


ConTeXt, developed by the Dutch company Pragma Advanced Document
Engineering, is not open source software,

Hm, I'm not sure that it's correct.


ConTeXt is licensed under the GPL, you can find the information in this 
document: http://pragma-ade.com/general/manuals/mreadme.pdf


There was previous discussion and clarification on this at
http://tex.stackexchange.com/questions/12431/using-context-commercially
and
http://archive.contextgarden.net/message/20110301.213750.c7a55835.en.html .


In the past (previous century, first releases) there hqad been some 
restrictions (i've forgotten which) that had to do with the fact that a 
third party was using context for a project and that we got notice that 
lawyers of that company would claimed copyright of context because it 
had become part of their workflow ... so, we had to make sure that by 
making context public it could not be used against us (like: we take 
context, add a few lines, and now it's ours). Then someone convinced us 
that people who 'd do such things would probably get themselves outcast 
from any community anyway, i.e. that there is some protection is being 
part of the tex community.


I think that there are still some recomendations with respect to not 
using the same filenames for patched files (simply because tex is always 
a large file infrastructure and we don't want to be bothered with 
support for such patched). AFAIK that is not much different than with latex.


Anyhow, license discussions are mostly wasted on me.

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread Martin Schröder
2012/5/6 Hans Hagen pra...@wxs.nl:
 (btw, I always wonder if the gpl restrictions also apply to the makers too
 ... i.e. if I extend context for a project should I then also make those
 extensions public ... quite a hassle if that would be true.)

The copyright holders are free to use any license. So we have the
free ConTeXt used by anybody but Pragma and the non-free version
sold by Pragma to its customers.

https://en.wikipedia.org/wiki/Dual_license

Best
   Martin
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread Hans Hagen

On 6-5-2012 14:53, Martin Schröder wrote:

2012/5/6 Hans Hagenpra...@wxs.nl:

(btw, I always wonder if the gpl restrictions also apply to the makers too
... i.e. if I extend context for a project should I then also make those
extensions public ... quite a hassle if that would be true.)


The copyright holders are free to use any license. So we have the
free ConTeXt used by anybody but Pragma and the non-free version
sold by Pragma to its customers.

https://en.wikipedia.org/wiki/Dual_license


Ok. Not that we ever sold something (if needed we install it as part of 
a service). Of course we do make non public styles but I suppose that a 
'free' context user can do that as well.


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-06 Thread Mari Voipio
On Sun, May 6, 2012 at 3:47 PM, Hans Hagen pra...@wxs.nl wrote:
 http://www.lucet.fi/textiles/


 Best change that in:

 ConTeXt, developed by the Dutch company Pragma Advanced Document
 Engineering, is open source software and avaliable as stand alone
 distribution (www.contextgarden.net) and is also part of regular tex
 distributions (like texlive).


OK, done. And I added some more stuff that I forgot originally.

Don't know if I should split the page into smaller units - but somehow
I feel that those who'll be interested in it, are capable of reading
more than one screenful. We'll see what this turns into.
Today I used my new skills with frames and the Lucida OT Handwriting
to create insides for a Mother's Day card as I needed something that
is exactly the right size. :-D



Thank you,

Mari
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-05 Thread Hans Hagen

On 4-5-2012 13:09, Marco wrote:

On 2012-05-04 Aditya Mahajanadit...@umich.edu  wrote:


On Fri, 4 May 2012, Mojca Miklavec wrote:



But my guess is that the  argument goes into the opposite way. I
past (and still in MKII) one *had  to* set up fonts twice - once
for the main  document and once for MetaPost  since MetaPost did
its own processing of labels and MetaPost didn't see the ConTeXt
font setups. So  it was difficult to convince  MetaPost to use
the same font.


I agree, it's  a big step forward towards  usability and consistency
to have  MetaPost automatically inherit ConTeXts  settings. However,
it went out-of-control now.


well, you still get text and not something random, so out-of-control is 
a bit too strong


anyhow, we can do

\newconditional\MPLIBtextgetdone

\def\MPLIBsettext#1% #2%
  {\ifconditional\MPLIBtextgetdone
   \else
 \cldcontext{metapost.tex.get()}%
 \settrue\MPLIBtextgetdone % no \global needed
   \fi
   \dowithnextbox{\ctxlua{metapost.settext(\number\nextbox,#1)}}\hbox}

\def\MPLIBresettexts
  {\ctxlua{metapost.resettextexts()}%$
   \setfalse\MPLIBtextgetdone}

\starttext

Serif

\startMPcode
draw textext(\ss Sans) ;
\stopMPcode

Serif

\startMPenvironment
\ss
\stopMPenvironment

\startMPcode
draw textext(Sans) ;
\stopMPcode

Serif

\stoptext



A better alternative would to define

\setupMPtext
 [
  style=...,
  color=...,
  setups=...,
 ]

that can be used to set the style for metapost text.


this is ok for me, but then we mighe as well drop \startMPenviroment 
(and someone has to wikify that then)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-05 Thread Hans Hagen

On 4-5-2012 09:13, Aditya Mahajan wrote:

On Fri, 4 May 2012, Mojca Miklavec wrote:


I can think of many workarounds to this, but I agree that there is a
valid reason why
\startMPenvironment
(or some other command) should be able to change the font inside
metapost labels only.


A better alternative would to define

\setupMPtext
[
style=...,
color=...,
setups=...,
]

that can be used to set the style for metapost text.


As we already have instances, I've extended that mechanism, so one can say:

\startsetups mp:instance:one
indeed:\space
\stopsetups

\setupMPinstance
  [metafun]
  [textstyle=bold,
   textcolor=darkgreen,
   setups=mp:instance:one]

\defineMPinstance
  [mympinstance]
  [metafun]
  [textcolor=red]

\starttext

\startMPcode
draw textext(some text) ;
\stopMPcode

\startMPcode{mympinstance}
draw textext(some text) ;
\stopMPcode

\stoptext

 +1

 Marco

So .. we know who is going to wikify this ...

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-05 Thread Marco
On 2012-05-05 Hans Hagen pra...@wxs.nl wrote:

That means, MPenvironment will be dropped, right? But what is the
new interface, \setupMPtext or MPinstance?

   +1
  
   Marco
 
 So .. we know who is going to wikify this ...

You're welcome :)

Marco


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-05 Thread Aditya Mahajan

On Sat, 5 May 2012, Marco wrote:


On 2012-05-05 Hans Hagen pra...@wxs.nl wrote:

That means, MPenvironment will be dropped, right? But what is the
new interface, \setupMPtext or MPinstance?


\setupMPinstance

The advantage is that you can have multiple instances in parallel.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-04 Thread Mojca Miklavec
On Thu, May 3, 2012 at 3:13 AM, Marco wrote:

 The text in Metapost adapts to the text set in ConTeXt. But the font
 setup should *only* be set for MetaPost, not regular text.

 Does that mean, that MPenvironment is deprecated and does not work
 at all?

Please don't rely on my answer since I haven't been following the
development as closely as I used to in past.

But my guess is that the argument goes into the opposite way. I past
(and still in MKII) one *had to* set up fonts twice - once for the
main document and once for MetaPost since MetaPost did its own
processing of labels and MetaPost didn't see the ConTeXt font setups.
So it was difficult to convince MetaPost to use the same font.

Now (as Aditya explained) metapost automatically inherits font setups
from the main document and it might be that nobody ever thought of /
requested / needed to have a special setup for using different font
for MetaPost labels.

I can think of many workarounds to this, but I agree that there is a
valid reason why
\startMPenvironment
(or some other command) should be able to change the font inside
metapost labels only.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-04 Thread Aditya Mahajan

On Fri, 4 May 2012, Mojca Miklavec wrote:


I can think of many workarounds to this, but I agree that there is a
valid reason why
   \startMPenvironment
(or some other command) should be able to change the font inside
metapost labels only.


A better alternative would to define

\setupMPtext
   [
style=...,
color=...,
setups=...,
   ]

that can be used to set the style for metapost text.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font for MetaPost graphics

2012-05-04 Thread Marco
On 2012-05-04 Aditya Mahajan adit...@umich.edu wrote:

 On Fri, 4 May 2012, Mojca Miklavec wrote:

  But my guess is that the  argument goes into the opposite way. I
  past (and still in MKII) one *had  to* set up fonts twice - once
  for the main  document and once for MetaPost  since MetaPost did
  its own processing of labels and MetaPost didn't see the ConTeXt
  font setups. So  it was difficult to convince  MetaPost to use
  the same font.

I agree, it's  a big step forward towards  usability and consistency
to have  MetaPost automatically inherit ConTeXts  settings. However,
it went out-of-control now.

 A better alternative would to define
 
 \setupMPtext
 [
  style=...,
  color=...,
  setups=...,
 ]
 
 that can be used to set the style for metapost text.

+1

Marco


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


<    2   3   4   5   6   7   8   9   10   11   >