Re: [NTG-context] does metafun require texexec --final?

2006-09-24 Thread Taco Hoekwater
Mojca Miklavec wrote:
> On 9/23/06, Sanjoy Mahajan wrote:
> 
>>So maybe the best approach is to edit cont-sys.rme directly, then
>>merge changes (using a revision control system like mercurial or git)
>>that arrive with the new context distributions.
> 
> 
> Changes in cont-sys.rme don't happen that often. You can safely create
> cont-sys.tex, edit that one and check for changes once in a (long)
> while.

Changes to the .rme files are always explicitly flagged in the release
notes.

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


Re: [NTG-context] does metafun require texexec --final?

2006-09-24 Thread Mojca Miklavec
On 9/23/06, Sanjoy Mahajan wrote:
> So maybe the best approach is to edit cont-sys.rme directly, then
> merge changes (using a revision control system like mercurial or git)
> that arrive with the new context distributions.

Changes in cont-sys.rme don't happen that often. You can safely create
cont-sys.tex, edit that one and check for changes once in a (long)
while.

Here you can convince yourself that you aren't really missing anything
if your file is slightly older:
https://foundry.supelec.fr/plugins/scmsvn/viewcvs.php/tex/context/base/cont-sys.ori?root=contextrev&rev=128&view=log
https://foundry.supelec.fr/plugins/scmsvn/viewcvs.php/tex/context/user/cont-sys.rme?root=contextrev&rev=128&view=log

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


Re: [NTG-context] transparent metafun colors turn nearly black

2006-09-23 Thread Sanjoy Mahajan
These were the memory setting in the /etc/texmf/texmf.d/95NonPath.cnf
configlet that is part of Debian and Ubuntu:

main_memory = 100 % words of inimemory available; also applies to inimf&mp
main_memory.context = 150
main_memory.mpost = 150

I commented out the .mpost line (there was no separate metafun line,
which I guess was getting the main_memory value of 100),
regenerated the texmf.cnf with "update-texmf", then regenerated
metafun with "texexec --make metafun" and transparency worked.  So
thanks for the magic!

Have wikified the above in case anyone else runs into it
<http://wiki.contextgarden.net/Mpgraphic>.

(I wonder if the live context has been having the same problem?)

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
 --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] transparent metafun colors turn nearly black

2006-09-23 Thread Taco Hoekwater
Hi,

This all sounds like the 'missing specials' problem that is caused
by conflicting -progname= arguments when using the web2c version
of metapost.

Make sure you do not have conflicting memory settings for both
   main_memory.mpost
as well as
   main_memory.metafun

The best is to remove all trace of '.mpost' and '.metafun' memory
settings from your texmf.cnf, but at least make sure all the
'.mpost' and 'metafun' values are the same .

Then regenerate metafun using texexec --make, and all should be
well again.

Cheers, Taco



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


Re: [NTG-context] transparent metafun colors turn nearly black

2006-09-23 Thread Peter Rolf
Sanjoy Mahajan wrote:
>> Maybe you also need
>> \runMPTEXgraphicstrue (enabled in my cont-sys.tex)?
> 
> I just enabled that in cont-sys.rme, and I put it in the test file for
> good measure.
> 
>> your example works here (beta 17.09.). I also tried your example at
>> contextgarden (same beta) and it worked too (using Firefox).
> 
> Thanks for checking it both ways.  Now I'm really puzzled because I
> also use Firefox (on Linux).  I just ran the file below at
> contextgarden (same one as before but with the MPTEX addition), and it
> gives 'undefined' in a square where the figure should be.  And on my
> Ubuntu laptop with context 2006.08.08 it gives a large black circle.
> I also tried the old perl texexec in case that helped but no luck.
>
Mhh, I think Patrick is playing games with us ;)

Your examples (old and new one) doesn't work anymore at contextgarden
(black square with "unknown" text). The good news: it's still working
here. Maybe I should stop testing your examples, as long as my system
works ;)

Just tried your old example *without* \runMPgraphicstrue and it worked
again. This is really strange.

Peter

> The texexec log on contextgarden looks okay.  It generates
> texexec-mpgraph.1 and embeds one figure, so I'm guessing the figure is
> generated and inserted.  So I don't understand why the generated PDF
> file is not right.  To make sure it wasn't a caching problem, I added
> a bit of text to the end, to see whether the new PDF file had it (it
> did).
> 
> \runMPgraphicstrue
> \runMPTEXgraphicstrue
> \setupcolors[state=start]
> \starttext
> \startreusableMPgraphic{a}
> fill fullcircle scaled 10cm withcolor transparent(1,0.5,green) ;
> \stopreusableMPgraphic
> 
> \placefigure[force,none]{}{\reuseMPgraphic{a}}
> \stoptext
> 
> -Sanjoy
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

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


Re: [NTG-context] transparent metafun colors turn nearly black

2006-09-23 Thread Sanjoy Mahajan
> Maybe you also need
> \runMPTEXgraphicstrue (enabled in my cont-sys.tex)?

I just enabled that in cont-sys.rme, and I put it in the test file for
good measure.

> your example works here (beta 17.09.). I also tried your example at
> contextgarden (same beta) and it worked too (using Firefox).

Thanks for checking it both ways.  Now I'm really puzzled because I
also use Firefox (on Linux).  I just ran the file below at
contextgarden (same one as before but with the MPTEX addition), and it
gives 'undefined' in a square where the figure should be.  And on my
Ubuntu laptop with context 2006.08.08 it gives a large black circle.
I also tried the old perl texexec in case that helped but no luck.

The texexec log on contextgarden looks okay.  It generates
texexec-mpgraph.1 and embeds one figure, so I'm guessing the figure is
generated and inserted.  So I don't understand why the generated PDF
file is not right.  To make sure it wasn't a caching problem, I added
a bit of text to the end, to see whether the new PDF file had it (it
did).

\runMPgraphicstrue
\runMPTEXgraphicstrue
\setupcolors[state=start]
\starttext
\startreusableMPgraphic{a}
fill fullcircle scaled 10cm withcolor transparent(1,0.5,green) ;
\stopreusableMPgraphic

\placefigure[force,none]{}{\reuseMPgraphic{a}}
\stoptext

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


Re: [NTG-context] transparent metafun colors turn nearly black

2006-09-23 Thread Peter Rolf
Hi Sanjoy,

Sanjoy Mahajan wrote:
> Just for (meta)fun, I tried a few experiments with transparent colors.
> The example below gives a black circle instead of a red one.  Is it that
> transparent colors aren't part of metafun -- which I can easily live
> with since color printing is too expensive still, alas -- or have I
> omitted an essential command?
>
No, as your example works here (beta 17.09.). I also tried your example
at contextgarden (same beta) and it worked too (using Firefox).

Maybe you also need
\runMPTEXgraphicstrue (enabled in my cont-sys.tex)?

Greetings, Peter

>  cut here 
> \runMPgraphicstrue
> \setupcolors[state=start]
> \starttext
> \startreusableMPgraphic{a}
> % _inline_specials_ := true; % had hopes for this line, but no luck
> % next line taken as an example from mp-spec.mp
> fill fullcircle scaled 10cm withcolor transparent(8,.3,red);
> \stopreusableMPgraphic
> 
> \placefigure[force,none]{}{\reuseMPgraphic{a}}
> \stoptext
>  cut here 
>
> The metapost output (testfile-mpgraph.1) always contains the following
> color setting, no matter what arguments I pass to transparent() :
> 
>  0.123 0.003 0.001 setrgbcolor
> 
> Which is close to black.
> 
> (This is all with ConTeXt 2006.08.08.  The live ConTeXt gives a square
> saying "undefined".)
> 
> -Sanjoy
> 
> `A society of sheep must in time beget a government of wolves.'
>-- Bertrand de Jouvenal
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

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


Re: [NTG-context] does metafun require texexec --final?

2006-09-23 Thread Wolfgang Schuster
On Sat, 23 Sep 2006 17:46:56 +0100
Sanjoy Mahajan <[EMAIL PROTECTED]> wrote:

> Wolfgang,
> 
> Thanks for the pointer.  I don't have a cont-sys.tex, but cont-sys.rme
> has these lines
> 
> % \runMPgraphicstrue
> % \runMPTEXgraphicstrue
> 
> The .rme extension meant I'd missed it when I ran grep on the .tex
> files.  I'll uncomment them.
> 
> Oh, that's not a good idea, because the next context update will
> overwrite cont-sys.rme.  So I should copy cont-sys.rme to cont-sys.tex
> first, then uncomment the lines in cont-sys.tex.  But then a context
> update will overwrite cont-sys.rme, and the new version will be
> ignored because I have a cont-sys.tex.  
> 
> So maybe the best approach is to edit cont-sys.rme directly, then
> merge changes (using a revision control system like mercurial or git)
> that arrive with the new context distributions.
> 
> -Sanjoy
> 

You could make a copy of cont-sys.rme and save it as cont-sys.tex
without problems. 

The cont-sy.rme file is only loaded when ConTeXt can't find a
cont-sys.tex file on your system.

Don't bother about changes in the cont-sys.rme with a new ConTeXt
release, because the standalone Distribution for Windows comes with
both files and they have also differences. cont-sys.rme says
defaultencoding=ec and cont-sys.tex says defaultencoding=texnansi :-)

AFAIK this is somewhere mentioned in one of the manuals.

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


Re: [NTG-context] does metafun require texexec --final?

2006-09-23 Thread Sanjoy Mahajan
Wolfgang,

Thanks for the pointer.  I don't have a cont-sys.tex, but cont-sys.rme
has these lines

% \runMPgraphicstrue
% \runMPTEXgraphicstrue

The .rme extension meant I'd missed it when I ran grep on the .tex
files.  I'll uncomment them.

Oh, that's not a good idea, because the next context update will
overwrite cont-sys.rme.  So I should copy cont-sys.rme to cont-sys.tex
first, then uncomment the lines in cont-sys.tex.  But then a context
update will overwrite cont-sys.rme, and the new version will be
ignored because I have a cont-sys.tex.  

So maybe the best approach is to edit cont-sys.rme directly, then
merge changes (using a revision control system like mercurial or git)
that arrive with the new context distributions.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
 --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] does metafun require texexec --final?

2006-09-23 Thread Wolfgang Schuster
On Sat, 23 Sep 2006 15:03:57 +0100
Sanjoy Mahajan <[EMAIL PROTECTED]> wrote:

> [Hans: Feature suggestion for figure inclusion at the end...]
> 
> I wrote:
> > So, is --final a requirement when using metafun, or am I hacking
> > around a problem I've caused by leaving something out?
> 
> An answer is that I should set \runMPgraphicstrue.  I thought it was
> automatically set, half-remembering what Aditya said in the previous
> thread on metafun.  So the following works (changing the r changes the
> result right away without requiring --final or requiring two texexec
> runs):
> 
> = cut here ==
> \runMPgraphicstrue
> \starttext
> 
> \startreusableMPgraphic{a}
> r := 1cm;
> fill fullcircle scaled r;
> \stopreusableMPgraphic
> 
> \placefigure[force,none]{}{\reuseMPgraphic{a}}
> 
> the figure above should be a small circle
> 
> \stoptext
> = cut here ==
> 
> To see where and when \runMPgraphicstrue was done, I looked into the
> metafun interface code, and asked grep for help:
> 
> $ grep '\\runMPgraphicstrue' *.tex
> s-pre-02.tex:113:%D switch \type {\runMPgraphicstrue} to the local file \type
> supp-mps.tex:1195:%D \runMPgraphicstrue
> supp-mps.tex:1209:%D \type{\runMPgraphicstrue}, the \METAPOST\ scratch file
> supp-mps.tex:1653:%D \global\runMPgraphicstrue
> supp-mps.tex:1991:   \runMPgraphicstrue
> 
> So it's commented-in only at line 1991, which is part of a new (to me)
> method of figure inclusion: \startstaticMPgraphic, which says
> "Dedicated to Aditya Mahajan. See meta-ini for usage", so I see how
> Aditya would conclude that \runMPgraphicstrue is always true :-)
> 
> The following therefore also works to get instant updating, and is
> more efficient than reusable MP graphics in that it reruns metapost on
> included figures only when they change:
> 
> = cut here ==
> % no need to set \runMPgraphicstrue
> \starttext
> 
> % see how smart staticMPfigure is by changing r here but not
> % in the figure definition itself.  Will it re-metapost the graphic?
> % Answer: It's smart.
> \startMPinclusions
> r := 1cm;
> \stopMPinclusions
> 
> \startstaticMPfigure{a}
> fill fullcircle scaled r;
> \stopstaticMPfigure
> 
> \placefigure[force,none]{}{\usestaticMPfigure[a]}
> 
> the figure above should be a small or large circle
> 
> \stoptext
> = cut here ==
> 
> Which I just now see is on the Wiki page about metafun (I'd been
> working from the excellent metafun manual).
> 
> It's doubly smart in that changing the papersize (which changes the
> layout parameters, which are included in the metapost file) will rerun
> the graphic, even if r stays the same.  So the graphic can base itself
> on those parameters and be updated when needed.
> 
> Thanks, Hans and Aditya!
> 
> While experimenting with the methods of figure inclusion, I've been
> changing among \reuseMPgraphic, \usestaticMPfigure, \useMPgraphic, and
> \externalfigure to call up the figure.  Do all the figure labels live
> in the same namespace?  In which case (warning: feature suggestion!)
> when they are defined, e.g. with \useexternalfigure,
> \startstaticMPfigure, ..., could the label have associated with it the
> command that calls it up?  So one could do for all types:
> 
> \usefigure[thelabel]
> 
> and ConTeXt would figure out what kind of figure it is and turn
> \usefigure into the appropriate one (\reuseMPgraphic, ...).  
> 
> Then speaking purely hypothetically of course: If, after learning
> metafun, one decides to turn many external metapost figures into
> metafun figures (and then static figures instead of reusable figures),
> the figure placement commands don't have change.
> 
> -Sanjoy
> 

Hi Sanjoy,

you should also look in your cont-sys.tex if \runMPgraphicstrue is
enabled for every ConTeXt run. 

Wolfgang

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


[NTG-context] transparent metafun colors turn nearly black

2006-09-23 Thread Sanjoy Mahajan
Just for (meta)fun, I tried a few experiments with transparent colors.
The example below gives a black circle instead of a red one.  Is it that
transparent colors aren't part of metafun -- which I can easily live
with since color printing is too expensive still, alas -- or have I
omitted an essential command?

 cut here 
\runMPgraphicstrue
\setupcolors[state=start]
\starttext
\startreusableMPgraphic{a}
% _inline_specials_ := true; % had hopes for this line, but no luck
% next line taken as an example from mp-spec.mp
fill fullcircle scaled 10cm withcolor transparent(8,.3,red);
\stopreusableMPgraphic

\placefigure[force,none]{}{\reuseMPgraphic{a}}
\stoptext
 cut here 

The metapost output (testfile-mpgraph.1) always contains the following
color setting, no matter what arguments I pass to transparent() :

 0.123 0.003 0.001 setrgbcolor

Which is close to black.

(This is all with ConTeXt 2006.08.08.  The live ConTeXt gives a square
saying "undefined".)

-Sanjoy

`A society of sheep must in time beget a government of wolves.'
   -- Bertrand de Jouvenal
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] does metafun require texexec --final?

2006-09-23 Thread Sanjoy Mahajan
[Hans: Feature suggestion for figure inclusion at the end...]

I wrote:
> So, is --final a requirement when using metafun, or am I hacking
> around a problem I've caused by leaving something out?

An answer is that I should set \runMPgraphicstrue.  I thought it was
automatically set, half-remembering what Aditya said in the previous
thread on metafun.  So the following works (changing the r changes the
result right away without requiring --final or requiring two texexec
runs):

= cut here ==
\runMPgraphicstrue
\starttext

\startreusableMPgraphic{a}
r := 1cm;
fill fullcircle scaled r;
\stopreusableMPgraphic

\placefigure[force,none]{}{\reuseMPgraphic{a}}

the figure above should be a small circle

\stoptext
= cut here ==

To see where and when \runMPgraphicstrue was done, I looked into the
metafun interface code, and asked grep for help:

$ grep '\\runMPgraphicstrue' *.tex
s-pre-02.tex:113:%D switch \type {\runMPgraphicstrue} to the local file \type
supp-mps.tex:1195:%D \runMPgraphicstrue
supp-mps.tex:1209:%D \type{\runMPgraphicstrue}, the \METAPOST\ scratch file
supp-mps.tex:1653:%D \global\runMPgraphicstrue
supp-mps.tex:1991:   \runMPgraphicstrue

So it's commented-in only at line 1991, which is part of a new (to me)
method of figure inclusion: \startstaticMPgraphic, which says
"Dedicated to Aditya Mahajan. See meta-ini for usage", so I see how
Aditya would conclude that \runMPgraphicstrue is always true :-)

The following therefore also works to get instant updating, and is
more efficient than reusable MP graphics in that it reruns metapost on
included figures only when they change:

= cut here ==
% no need to set \runMPgraphicstrue
\starttext

% see how smart staticMPfigure is by changing r here but not
% in the figure definition itself.  Will it re-metapost the graphic?
% Answer: It's smart.
\startMPinclusions
r := 1cm;
\stopMPinclusions

\startstaticMPfigure{a}
fill fullcircle scaled r;
\stopstaticMPfigure

\placefigure[force,none]{}{\usestaticMPfigure[a]}

the figure above should be a small or large circle

\stoptext
= cut here ==

Which I just now see is on the Wiki page about metafun (I'd been
working from the excellent metafun manual).

It's doubly smart in that changing the papersize (which changes the
layout parameters, which are included in the metapost file) will rerun
the graphic, even if r stays the same.  So the graphic can base itself
on those parameters and be updated when needed.

Thanks, Hans and Aditya!

While experimenting with the methods of figure inclusion, I've been
changing among \reuseMPgraphic, \usestaticMPfigure, \useMPgraphic, and
\externalfigure to call up the figure.  Do all the figure labels live
in the same namespace?  In which case (warning: feature suggestion!)
when they are defined, e.g. with \useexternalfigure,
\startstaticMPfigure, ..., could the label have associated with it the
command that calls it up?  So one could do for all types:

\usefigure[thelabel]

and ConTeXt would figure out what kind of figure it is and turn
\usefigure into the appropriate one (\reuseMPgraphic, ...).  

Then speaking purely hypothetically of course: If, after learning
metafun, one decides to turn many external metapost figures into
metafun figures (and then static figures instead of reusable figures),
the figure placement commands don't have change.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
 --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] does metafun require texexec --final?

2006-09-22 Thread Sanjoy Mahajan
I was trying experiments with the file below, changing r from 1cm to
10cm or vice versa, then rerunning texexec and looking at the pdf.  But
the pdf changes only the second time that I run texexec (and each time,
texexec runs metafun for the embedded graphic).  However, the pdf
changes right away if I give --final to texexec.  

So, is --final a requirement when using metafun, or am I hacking around
a problem I've caused by leaving something out?

Oh, having heeded Aditya's earlier advice on the list: \write18 is
enabled.

=== cut here ==
\starttext

\startreusableMPgraphic{a}
r := 1cm;
fill fullcircle scaled r;
\stopreusableMPgraphic

\placefigure[force,none]{}{\reuseMPgraphic{a}}

the figure above should be a small circle

\stoptext
=== cut here ==

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


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-07 Thread Hans Hagen
Mojca Miklavec wrote:
> On 8/7/06, Taco Hoekwater wrote:
>   
>> Mojca Miklavec wrote:
>> 
>>> The "real problem" appears in the following figure where the first
>>> black is ignored and the second one is not, so it's rather
>>> inconsistent:
>>>   
>> It is not really inconsistent, the rule is very simple:
>>
>>all use of "withcolor " upto the first non-zero color
>>is ignored by metapost.
>> 
>
> OK, I "give up". I just have to reimplement the terminal to fist store
> everything and then write out the black stuff before anything else ;)
>   
i adapted context to default to black so don't worry

Hans

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

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


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-07 Thread Mojca Miklavec
On 8/7/06, Taco Hoekwater wrote:
>
> Mojca Miklavec wrote:
> >
> > The "real problem" appears in the following figure where the first
> > black is ignored and the second one is not, so it's rather
> > inconsistent:
>
> It is not really inconsistent, the rule is very simple:
>
>all use of "withcolor " upto the first non-zero color
>is ignored by metapost.

OK, I "give up". I just have to reimplement the terminal to fist store
everything and then write out the black stuff before anything else ;)

> > I can image a "fair solution" to draw "withcolor black" in black and
> > to let the parts with no explicit color and an empty drawoptions()
> > string to use the "default color" (perhaps with gsave/grestore). But
> > I'm not entitled to judge about it.
>
> Yes, that's what I thought. But I need to patch metapost for
> that, so that solution won't be available in a reliable way
> for quite some time yet.

I realise that and I'll try to implement in an independant way.

> > In any case I'll have to use a solution which will not depend on this
> > behaviour. Is there any chance to get "withcolor somecolor", where
> > "somecolor" is the color set with "textcolor=somecolor"?
>
> Maybe withcolor \MPcolor{textcolor} ? (I am guessing)

Something that seems to work after some trial-and-error:
\definecolor[textcolor][\@@cltextcolor]

But I'm guessing as well. Let's wait for the next bug in the module then ;)

I now used

\definecolor[textcolor][\@@cltextcolor]

% \MPextensions, should be specific to \startGNUPLOTgraphic
\startMPextensions
if unknown context_gplot: input mp-gnuplot.mp ; fi;
% overloading
gp_color_foreground := \MPcolor{textcolor};
gp_color_lt[-2] := gp_color_foreground;
\stopMPextensions

(because there's probably no way to put \MPcolor{textcolor} to *.mp file)

But now there's a minor problem. I have to initialize
"\setupcolors[textcolor=blue]" *before* loading the gnuplot module,
otherwise it's all black.

In contrast, if I use

\setupcolors[state=start,textcolor=blue]
\usemodule[gnuplot]

a graphic here will be blue
\setupcolors[textcolor=red]
a graphic here will be red, but text will still be blue

And

\usemodule[gnuplot]
\setupcolors[state=start,textcolor=blue]

a graphic here will be black
\setupcolors[textcolor=red]
a graphic here will be black, but text will still be blue


I suspect what's going on: as long as textcolor= is undefined,
\@@cltextcolor will expand to black and remain black even if I set
"textcolor=something" later. If it's initialised before loading the
module, it will expand to some color and if I change
"textcolor=someothercolor" later, the color will follow the new
definition.

What's the best remedy for it? (And sorry for way too many questions.)

Thanks,
Mojca

(some files to play with are under http://pub.mojca.org/gnuplot/temp/)
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-07 Thread Taco Hoekwater


Mojca Miklavec wrote:
> 
> The "real problem" appears in the following figure where the first
> black is ignored and the second one is not, so it's rather
> inconsistent:

It is not really inconsistent, the rule is very simple:

   all use of "withcolor " upto the first non-zero color
   is ignored by metapost.

> I can image a "fair solution" to draw "withcolor black" in black and
> to let the parts with no explicit color and an empty drawoptions()
> string to use the "default color" (perhaps with gsave/grestore). But
> I'm not entitled to judge about it.

Yes, that's what I thought. But I need to patch metapost for
that, so that solution won't be available in a reliable way
for quite some time yet.

> In any case I'll have to use a solution which will not depend on this
> behaviour. Is there any chance to get "withcolor somecolor", where
> "somecolor" is the color set with "textcolor=somecolor"?

Maybe withcolor \MPcolor{textcolor} ? (I am guessing)

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


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-07 Thread Mojca Miklavec
On 8/7/06, Hans Hagen wrote:
> Taco Hoekwater wrote:
> > Hi Mojca,
> >
> > Mojca Miklavec wrote:
> >
> >> But the other \sometxt was indeed red - withcolor seems to work, but
> >> only conditionally. And I have some weird examples of two texts one
> >> after another. In some cases (if something else is drawn inbetween and
> >> a color changed twice), then the second text will be black. But it's
> >> quite unpredictable (that one might even be bug in my code, so I don't
> >> want to complain before I have an example).
> >>
> >
> > Ok, I looked into this again, and I was definately wrong.
> >
> > The actual problem appears to be that metapost does not write a
> > color switch for 'black' when it appears at the start of a file,
> > it simply assumes the start color is black. This could be
> > considered a bug in MetaPost or a missing feature in ConTeXt
> > (i have not decided yet :-)).
> >
> > Quick fix: You can start your MP code with an explicit color
> > initialization.
> >
> >\startMPcode
> >   special "0 setgray";
> >   ..
> >\stopMPcode
> >
> >
> > A hack, I know. MetaPost should be able to distinguish between
> >draw p
> > and
> >draw p withcolor (0,0,0)
> > but currently it can't (because the structure is initialized
> > as (0,0,0)). It is not quite a bug either, because there may
> > well be MP code out there that depends on this.
> > In fact, probably code by Knuth, Hobby, Jacko, and Hans ;-)
> >
> >
> in meta-pdf.tex:
>
> \chardef\blackoutMPgraphic\plusone
>
> \def\finishMPgraphic
>   {\stopMPresources
>\egroup
>\setbox\scratchbox\vbox
>  {\forgetall
>   \hbox
> {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space 
> \MPyoffset\space cm}%
>  \ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi
>  \lower\MPyshift\box\scratchbox % unscaled shift
>  \PDFcode{Q}}}%
>\ht\scratchbox\MPheight
>\wd\scratchbox\MPwidth
>\dp\scratchbox\zeropoint\relax
>\dopackageMPgraphic\scratchbox
>\egroup
>\endinput}
>
>
> \starttext
>
> \color[red]{\startMPcode
> draw fullcircle scaled 5cm ;
> draw btex test etex ;
> \stopMPcode red}
>
> \startreusableMPgraphic{test}
> draw fullcircle scaled 5cm ;
> draw btex test etex ;
> \stopreusableMPgraphic
>
> \color[red]{red \reuseMPgraphic{test} red}
>
> \stoptext

Thanks! This indeed solves the problem. However, I'm not sure any more
whether blackoutMPgraphic should be true or false by default.

One of my old files (when I was learning metapost from the manual):

def star (expr size, n, pos) =
for a=0 step 360/n until round(360*(1-1/n)) :
draw (origin -- (size/2,0))
rotatedaround (origin,a) shifted pos ;
endfor ;
enddef ;

beginfig(803) ;
pickup pencircle scaled 2mm ; star(2cm,5,origin) ;
endfig ;



\useexternalfigure[pentastar][star.803][height=4cm]
\starttext
\placefigure
{A five||point star drawn by \METAPOST.}
{\color[green]{\externalfigure[pentastar]}} % I wanted it to be green
\stoptext



I tried that one once more because I remember that I was very happy to
be able to color the star from outside without modifying the figure
itself (I didn't use any explicit color to make it black though).

I don't mind it either way (now that I know how to switch it on or
off), but I'm not sure if there are not other people using the same
trick as well.



The "real problem" appears in the following figure where the first
black is ignored and the second one is not, so it's rather
inconsistent:

\setupcolors
[state=start,textcolor=blue]
\chardef\blackoutMPgraphic 0

\starttext
\startMPcode
draw \sometxt{blue} withcolor black;
draw \sometxt{red} shifted (1.5cm,0) withcolor red;
draw \sometxt{black} shifted (3cm,0) withcolor black;
\stopMPcode
\stoptext

I can image a "fair solution" to draw "withcolor black" in black and
to let the parts with no explicit color and an empty drawoptions()
string to use the "default color" (perhaps with gsave/grestore). But
I'm not entitled to judge about it.

In any case I'll have to use a solution which will not depend on this
behaviour. Is there any chance to get "withcolor somecolor", where
"somecolor" is the color set with "textcolor=somecolor"?

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


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-06 Thread Hans Hagen
Taco Hoekwater wrote:
> Hi Mojca,
>
> Mojca Miklavec wrote:
>   
>> But the other \sometxt was indeed red - withcolor seems to work, but
>> only conditionally. And I have some weird examples of two texts one
>> after another. In some cases (if something else is drawn inbetween and
>> a color changed twice), then the second text will be black. But it's
>> quite unpredictable (that one might even be bug in my code, so I don't
>> want to complain before I have an example).
>> 
>
> Ok, I looked into this again, and I was definately wrong.
>
> The actual problem appears to be that metapost does not write a
> color switch for 'black' when it appears at the start of a file,
> it simply assumes the start color is black. This could be
> considered a bug in MetaPost or a missing feature in ConTeXt
> (i have not decided yet :-)).
>
> Quick fix: You can start your MP code with an explicit color
> initialization.
>
>\startMPcode
>   special "0 setgray";
>   ..
>\stopMPcode
>
>
> A hack, I know. MetaPost should be able to distinguish between
>draw p
> and
>draw p withcolor (0,0,0)
> but currently it can't (because the structure is initialized
> as (0,0,0)). It is not quite a bug either, because there may
> well be MP code out there that depends on this.
> In fact, probably code by Knuth, Hobby, Jacko, and Hans ;-)
>
>   
in meta-pdf.tex:

\chardef\blackoutMPgraphic\plusone

\def\finishMPgraphic
  {\stopMPresources
   \egroup
   \setbox\scratchbox\vbox
 {\forgetall
  \hbox
{\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space 
\MPyoffset\space cm}%
 \ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi
 \lower\MPyshift\box\scratchbox % unscaled shift
 \PDFcode{Q}}}%
   \ht\scratchbox\MPheight
   \wd\scratchbox\MPwidth
   \dp\scratchbox\zeropoint\relax
   \dopackageMPgraphic\scratchbox
   \egroup
   \endinput}


\starttext

\color[red]{\startMPcode
draw fullcircle scaled 5cm ;
draw btex test etex ;
\stopMPcode red}

\startreusableMPgraphic{test}
draw fullcircle scaled 5cm ;
draw btex test etex ;
\stopreusableMPgraphic

\color[red]{red \reuseMPgraphic{test} red}

\stoptext


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

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


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-06 Thread Hans Hagen
Taco Hoekwater wrote:
> Quick fix: You can start your MP code with an explicit color
> initialization.
>
>\startMPcode
>   special "0 setgray";
>   ..
>\stopMPcode
>
>
> A hack, I know. MetaPost should be able to distinguish between
>draw p
> and
>draw p withcolor (0,0,0)
> but currently it can't (because the structure is initialized
> as (0,0,0)). It is not quite a bug either, because there may
> well be MP code out there that depends on this.
> In fact, probably code by Knuth, Hobby, Jacko, and Hans ;-)
>   
-)

i think that (given that in principle mp produces stand alone ps code) 
it should start out with black; when embedding as eps or when used as 
xform in pdf thsi probably is automatically taken care of

it makes sense to let mp do that for you; there are a few places where 
context forces the defaultcolor; we can make it an opion in the mp topdf 
converter as well

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

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


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-06 Thread Mojca Miklavec
On 8/6/06, Taco Hoekwater wrote:
> Hi Mojca,
>
> Mojca Miklavec wrote:
> >
> > But the other \sometxt was indeed red - withcolor seems to work, but
> > only conditionally. And I have some weird examples of two texts one
> > after another. In some cases (if something else is drawn inbetween and
> > a color changed twice), then the second text will be black. But it's
> > quite unpredictable (that one might even be bug in my code, so I don't
> > want to complain before I have an example).
>
> Ok, I looked into this again, and I was definately wrong.
>
> The actual problem appears to be that metapost does not write a
> color switch for 'black' when it appears at the start of a file,

What a pitty that metapost wasn't one of Knuth's programs ;)

> it simply assumes the start color is black. This could be
> considered a bug in MetaPost or a missing feature in ConTeXt
> (i have not decided yet :-)).
>
> Quick fix: You can start your MP code with an explicit color
> initialization.
>
>\startMPcode
>   special "0 setgray";
>   ..
>\stopMPcode
>
>
> A hack, I know. MetaPost should be able to distinguish between
>draw p
> and
>draw p withcolor (0,0,0)
> but currently it can't (because the structure is initialized
> as (0,0,0)). It is not quite a bug either, because there may
> well be MP code out there that depends on this.
> In fact, probably code by Knuth, Hobby, Jacko, and Hans ;-)

Well, now to be honest: color "zero" (not "0 setgray", but the first
color in Gnuplot) is not supposed to be black, but should be
"foreground color" according to the guidelines (not that other divices
are configurable in that respect, but anyway). So it might indeed make
more sense to inherit the "textcolor". What do you think?

I spotted the problem when I was using a dark background with white
text on it. I'm not sure if I indeed want black or not. I want to make
the colors configurable anyway (which they're currently not, but I
have to figure out how to do that first), probably with something like
\defineconversion[color set x][white,red,yellow,green]
\setupGNUPLOT[colorset=color set x]
% or perhaps even something like "foregroundcolor|maincolor=white"

So I actually liked the fact that the numbers on the plot were white
without having to configure anything (red and green were clearly seen
on the background), but the plot as a whole was useless since the
borders were still black & invisible and on some plots some text was
black as well (in a pseudo random way).

So rather than using that hack I would prefer to ask: which color
should I define in the module to make the border of the same color as
"textcolor"? Or (a question for later, it's not on the top priority
right now): how can I extract the color from
\setupGNUPLOT[foregroundcolor=yellow] and store it to a variable
"color gp_foregroundcolor;" defined in a module?

Any other thoughts about it?

> > A question for you or Hans: can please someone explain me in a few
> > words what's the main strategy/philosophy behind \sometxt. I don't
> > understand exactly how TeX processes it (and metapost
> > shrinks/expands/shifts/colors) it inline.
>
> TeX typesets the argument of the \sometxt macro in a hbox and
> writes its box dimensions to .
>
> To the metapost file, a zero-padded serial number is written
> instead, and MP uses the dimensions it finds in 
> for the positioning of that label.
>
> ConTeXt then replaces the metapost label number with the TeX material
> while interpreting the Metapost result.
>
> This is the short version, the actual situation is a little bit more
> complex (not a whole lot though). The actual code is in meta-tex.tex
> and mp-txts.mp

Thanks for the wonderful explanation!

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


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-06 Thread Taco Hoekwater
Hi Mojca,

Mojca Miklavec wrote:
> 
> But the other \sometxt was indeed red - withcolor seems to work, but
> only conditionally. And I have some weird examples of two texts one
> after another. In some cases (if something else is drawn inbetween and
> a color changed twice), then the second text will be black. But it's
> quite unpredictable (that one might even be bug in my code, so I don't
> want to complain before I have an example).

Ok, I looked into this again, and I was definately wrong.

The actual problem appears to be that metapost does not write a
color switch for 'black' when it appears at the start of a file,
it simply assumes the start color is black. This could be
considered a bug in MetaPost or a missing feature in ConTeXt
(i have not decided yet :-)).

Quick fix: You can start your MP code with an explicit color
initialization.

   \startMPcode
  special "0 setgray";
  ..
   \stopMPcode


A hack, I know. MetaPost should be able to distinguish between
   draw p
and
   draw p withcolor (0,0,0)
but currently it can't (because the structure is initialized
as (0,0,0)). It is not quite a bug either, because there may
well be MP code out there that depends on this.
In fact, probably code by Knuth, Hobby, Jacko, and Hans ;-)

> 
> A question for you or Hans: can please someone explain me in a few
> words what's the main strategy/philosophy behind \sometxt. I don't
> understand exactly how TeX processes it (and metapost
> shrinks/expands/shifts/colors) it inline.

TeX typesets the argument of the \sometxt macro in a hbox and
writes its box dimensions to .

To the metapost file, a zero-padded serial number is written
instead, and MP uses the dimensions it finds in 
for the positioning of that label.

ConTeXt then replaces the metapost label number with the TeX material
while interpreting the Metapost result.

This is the short version, the actual situation is a little bit more
complex (not a whole lot though). The actual code is in meta-tex.tex
and mp-txts.mp

Cheers, taco



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


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-06 Thread Mojca Miklavec
On 8/6/06, Taco Hoekwater wrote:
> Mojca Miklavec wrote:
> > Hello,
> >
> > Does anyone have any idea about what's going on here? I get blue text,
> > but a black square, although both are supposed to come out black (I
> > wouldn't mind so much, but the problem is that some text is blue and
> > some is black - I have some other testcases where this happens, but I
> > have to create a minimal example first).
>
> use \textext. \sometxt will use the text color, because it never
> reaches metapost (I assume it would be possible to intercept
> drawing options like withcolor, but that doesn't happen at the
> moment).

But the other \sometxt was indeed red - withcolor seems to work, but
only conditionally. And I have some weird examples of two texts one
after another. In some cases (if something else is drawn inbetween and
a color changed twice), then the second text will be black. But it's
quite unpredictable (that one might even be bug in my code, so I don't
want to complain before I have an example).

I while ago I also posted an interesting example with colored table
(withcolor colored only some of the cells), but that is alredy a very
complex example.

And I can't afford to use \textext. It's was too slow (approximately
factor 10) and it runs out of TeX memmory after 10 or 12 plots on
average.

Thanks,
Mojca

A question for you or Hans: can please someone explain me in a few
words what's the main strategy/philosophy behind \sometxt. I don't
understand exactly how TeX processes it (and metapost
shrinks/expands/shifts/colors) it inline.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-06 Thread Taco Hoekwater
Mojca Miklavec wrote:
> Hello,
> 
> Does anyone have any idea about what's going on here? I get blue text,
> but a black square, although both are supposed to come out black (I
> wouldn't mind so much, but the problem is that some text is blue and
> some is black - I have some other testcases where this happens, but I
> have to create a minimal example first).

use \textext. \sometxt will use the text color, because it never
reaches metapost (I assume it would be possible to intercept
drawing options like withcolor, but that doesn't happen at the
moment).

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


[NTG-context] metafun & \sometxt: should black be "black" or "textcolor"?

2006-08-05 Thread Mojca Miklavec
Hello,

Does anyone have any idea about what's going on here? I get blue text,
but a black square, although both are supposed to come out black (I
wouldn't mind so much, but the problem is that some text is blue and
some is black - I have some other testcases where this happens, but I
have to create a minimal example first).

\setupcolors
[state=start,textcolor=blue]

\starttext
\startMPcode
draw \sometxt{abc} withcolor black; % come out blue
draw \sometxt{def} shifted (3cm,0) withcolor red;
draw unitsquare xyscaled (3cm,2cm) withcolor black;
\stopMPcode
\stoptext

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


Re: [NTG-context] couple of metafun questions

2006-08-03 Thread Thomas A. Schmitz

On Aug 2, 2006, at 11:56 PM, Mojca Miklavec wrote:

> So you have to draw the path twice with different color and pattern
> (you can write a macro for it of course if you need it often).
>
> beginfig(1);
>   pickup pencircle scaled 2pt;
>   picture dp[];
>   dp[1] := dashpattern(on 2 off 6) scaled 3pt;
>   dp[2] := dashpattern(off 4 on 2 off 2) scaled 3pt;
>
>   path p; p := (origin .. (2,1) .. (3,-1) .. (5,0)) scaled 3cm;
>
>   draw p dashed dp[1] withcolor blue;
>   draw p dashed dp[2] withcolor red;
> endfig;
> end.
>
> Mojca


Mojca,

thanks so much, this works and does exactly what I want! For the rest  
of my questions: I've decided to go for an embedded staticMPfigure  
instead of MPpositiongraphic, so I can manage. But I'd still be  
curious if these things are possible or not. Anyways, thanks a lot!

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


Re: [NTG-context] couple of metafun questions

2006-08-02 Thread Mojca Miklavec
On 8/2/06, Thomas A. Schmitz wrote:
>
> 3. Is it possible to get a line/arrow dashed in two different colors,
> like red and blue?

Just out of curiosity I tried the following:

picture dp;
draw dashpattern(on 2 off 6) scaled 5pt withcolor blue;
draw dashpattern(off 4 on 2 off 2) scaled 5pt withcolor red;
dp := currentpicture;

draw origin--(5cm,0) dashed dp;

But of course "! Picture is too complicated to use as a dash pattern."
So you have to draw the path twice with different color and pattern
(you can write a macro for it of course if you need it often).

beginfig(1);
pickup pencircle scaled 2pt;
picture dp[];
dp[1] := dashpattern(on 2 off 6) scaled 3pt;
dp[2] := dashpattern(off 4 on 2 off 2) scaled 3pt;

path p; p := (origin .. (2,1) .. (3,-1) .. (5,0)) scaled 3cm;

draw p dashed dp[1] withcolor blue;
draw p dashed dp[2] withcolor red;
endfig;
end.

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


[NTG-context] couple of metafun questions

2006-08-02 Thread Thomas A. Schmitz
Hi all,

I'm experimenting with some metafun code and positional graphics to  
produce a nice illustration for an article. There's some basic  
questions I haven't been able to solve (and I remember that I  
couldn't solve them before but found workarounds, but this time it  
looks like I'm stuck):

1. Is it possible to have a MPpositiongraphics anchored to more than  
two positions? Like
draw position1 -- position2 .. position3 ?



2. Related to 1.: Is it right that you can't anchor more than 1  
MPpositiongraphic to one anchor? If I have:

drawsomething position1 -- position2

I can't then say

drawsomething position1 .. position3

but must work around by reversing

drawsomething position3 .. position1



3. Is it possible to get a line/arrow dashed in two different colors,  
like red and blue?

Sorry if these are silly questions, but I just dabble into metafun!

Thanks, and best

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


Re: [NTG-context] Metapost/Metafun/Tex/Context question

2006-07-19 Thread WN
[EMAIL PROTECTED] wrote:
> On Wed, 19 Jul 2006, WN wrote:
>
>   
>> Hi all,
>>
>> I am trying to do the following in Metapost but my new math symbol  is
>> not recognized.
>> Context knows about it but Tex does not.
>>
>> How can I make this work ?
>> 
>
> Hans and Taco have already explained the correct way to do this, so I 
> will not go into that. This is one place where you can use the new 
> sometxt feature.
>
>   
>> % = Test code 
>> \loadmapfile[original-youngryu-tx.map]
>> \definebodyfont [28pt,24pt,18pt,
>>  17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
>>  mc=txexa sa 1]
>>
>> \setupbodyfont [11pt]
>> \definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]
>>
>> \starttext
>> \startformula
>> \varointctrclockwise_{\gamma} f(z) \: dz = 0
>> \stopformula
>> \startMPcode
>>picture p ;
>>path q;
>>numeric u;
>>
>>u := 1cm;
>>
>>p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;
>> 
>
> Replace this by
>
>   p := \sometxt{$\varointctrclockwise_{\gamma} f(z) \: dz = 0$} ;
>
> and everything works!
>
>   
I was wondering about the \sometxt feature, I did not know exactly how 
to use it, but will certainly do
some experiments. Thanks Wim.


>
>   
>>p := p scaled 0.15cm;
>>draw p;
>> \stopMPcode
>> \stoptext
>>
>> 
> Aditya
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   

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


Re: [NTG-context] Metapost/Metafun/Tex/Context question

2006-07-19 Thread WN




[EMAIL PROTECTED] wrote:

  
Hans Hagen wrote:
  
  
make sure that mp knows about the definitions: 

- first extend the math collection (use decimen, since there is a linesplit bug with " here) 
- then load the times font 

  
  
Math family mc has to be txexa or something similar before the code
actually shows the integral instead  of a plus sign, but Wim can
figure that out himself, no doubt  :-)

  
  
- somehow display and inline math render differently; something for taco 

  
  
That is normal. One is with an operator with \limits, one without.

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

For those interested, this is what I did. Taco is right in saying you
have to load the txexa font first. 
The code works for me, but I am not sure it is the proper Context way
of doing things. 

Kind regards
Wim Neimeijer

% === some extra math symbols I need
=
\startenvironment layout04

\unprotect
%
% extra math symbols
%
\usetypescript[modern]
\usetypescript[times]

\definetypeface[MyFace][rm][serif][times][default][encoding=ec]
\definetypeface[MyFace][mm][math][modern][default][encoding=ec]
\setupbodyfont[MyFace,10pt]

\loadmapfile[original-youngryu-tx.map]
\definebodyfont [28pt,24pt,18pt,
  17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
  mc=txexa sa 1]

\setupbodyfont [11pt]

%%%
% txfonts
%%%

\definemathsymbol [oiint]   [op] [mc] ["08] [mc] ["09]
\definemathsymbol [oiiint]  [op] [mc] ["29] [mc] ["2a]
\definemathsymbol [ointctrclockwise]    [op] [mc] ["0A] [mc] ["0B]
\definemathsymbol [ointclockwise]   [op] [mc] ["0C] [mc] ["0D]
\definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]
\definemathsymbol [varointclockwise]    [op] [mc] ["2D] [mc] ["2E]

\definemathsymbol [iint]    [op] [mc] ["21] [mc] ["22]
\definemathsymbol [iiint]   [op] [mc] ["23] [mc] ["24]
\definemathsymbol [nt]  [op] [mc] ["25] [mc] ["26]
\definemathsymbol [idotsint]    [op] [mc] ["27] [mc] ["28]

\definemathsymbol [oiintctrclockwise]   [op] [mc] ["40] [mc] ["41]
\definemathsymbol [oiintclockwise]  [op] [mc] ["48] [mc] ["49]
\definemathsymbol [varoiintctrclockwise][op] [mc] ["4A] [mc] ["4B]
\definemathsymbol [varoiintclockwise]   [op] [mc] ["42] [mc] ["43]

\definemathsymbol [oiiintctrclockwise]  [op] [mc] ["44] [mc] ["45]
\definemathsymbol [oiiintclockwise] [op] [mc] ["4C] [mc] ["4D]
\definemathsymbol [varoiiintctrclockwise][op] [mc] ["4E] [mc] ["4F]
\definemathsymbol [varoiiintclockwise]  [op] [mc] ["46] [mc] ["47]

\protect

\stopenvironment



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


Re: [NTG-context] Metapost/Metafun/Tex/Context question

2006-07-19 Thread WN




[EMAIL PROTECTED] wrote:

  WN wrote:
  
  
Hi all,

I am trying to do the following in Metapost but my new math symbol  is 
not recognized.
Context knows about it but Tex does not.

How can I make this work ?

Kind regards
Wim Neimeijer

% = Test code 
\loadmapfile[original-youngryu-tx.map]
\definebodyfont [28pt,24pt,18pt,
  17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
  mc=txexa sa 1]

\setupbodyfont [11pt]
\definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]

\starttext
\startformula
\varointctrclockwise_{\gamma} f(z) \: dz = 0
\stopformula
\startMPcode
picture p ;
path q;
numeric u;

u := 1cm;

p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;
p := p scaled 0.15cm;
draw p;
\stopMPcode
\stoptext
  

  
  make sure that mp knows about the definitions: 

- first extend the math collection (use decimen, since there is a linesplit bug with " here) 
  

I will implement your suggestion, thanks

  - then load the times font 
- somehow display and inline math render differently; something for taco 

\startMPenvironment[global]

\startmathcollection [default]
\definemathsymbol [varointctrclockwise] [op] [mc] [43] [mc] [44]
\stopmathcollection
\usetypescript[times][ec]
\setupbodyfont[times,11pt]

\stopMPenvironment

\starttext

why the funny .15cm scale ... 
  

I was working on a titlepage and was learning the concept of using a
picture to setup my labels in Metapost. So
the .15cm is just a test case.

  
\startformula
\varointctrclockwise_{\gamma} f(z) \: dz = 0
\stopformula

$\varointctrclockwise_{\gamma} f(z) \: dz = 0$

\startMPcode
draw btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex scaled 0.15cm ;
\stopMPcode

\startMPcode
draw btex $\displaystyle \varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex scaled 0.15cm ;
\stopMPcode

\stoptext


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

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

Thanks Hans for the really quick reply.



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


Re: [NTG-context] Metapost/Metafun/Tex/Context question

2006-07-19 Thread Aditya Mahajan
On Wed, 19 Jul 2006, WN wrote:

> Hi all,
>
> I am trying to do the following in Metapost but my new math symbol  is
> not recognized.
> Context knows about it but Tex does not.
>
> How can I make this work ?

Hans and Taco have already explained the correct way to do this, so I 
will not go into that. This is one place where you can use the new 
sometxt feature.

> % = Test code 
> \loadmapfile[original-youngryu-tx.map]
> \definebodyfont [28pt,24pt,18pt,
>  17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
>  mc=txexa sa 1]
>
> \setupbodyfont [11pt]
> \definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]
>
> \starttext
> \startformula
> \varointctrclockwise_{\gamma} f(z) \: dz = 0
> \stopformula
> \startMPcode
>picture p ;
>path q;
>numeric u;
>
>u := 1cm;
>
>p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;

Replace this by

  p := \sometxt{$\varointctrclockwise_{\gamma} f(z) \: dz = 0$} ;

and everything works!



>p := p scaled 0.15cm;
>draw p;
> \stopMPcode
> \stoptext
>
Aditya
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Metapost/Metafun/Tex/Context question

2006-07-19 Thread Taco Hoekwater


Hans Hagen wrote:
> make sure that mp knows about the definitions: 
> 
> - first extend the math collection (use decimen, since there is a linesplit 
> bug with " here) 
> - then load the times font 

Math family mc has to be txexa or something similar before the code
actually shows the integral instead  of a plus sign, but Wim can
figure that out himself, no doubt  :-)

> - somehow display and inline math render differently; something for taco 

That is normal. One is with an operator with \limits, one without.

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


Re: [NTG-context] Metapost/Metafun/Tex/Context question

2006-07-19 Thread Hans Hagen
WN wrote:
> Hi all,
>
> I am trying to do the following in Metapost but my new math symbol  is 
> not recognized.
> Context knows about it but Tex does not.
>
> How can I make this work ?
>
> Kind regards
> Wim Neimeijer
>
> % = Test code 
> \loadmapfile[original-youngryu-tx.map]
> \definebodyfont [28pt,24pt,18pt,
>   17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
>   mc=txexa sa 1]
>
> \setupbodyfont [11pt]
> \definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]
>
> \starttext
> \startformula
> \varointctrclockwise_{\gamma} f(z) \: dz = 0
> \stopformula
> \startMPcode
> picture p ;
> path q;
> numeric u;
>
> u := 1cm;
>
> p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;
> p := p scaled 0.15cm;
> draw p;
> \stopMPcode
> \stoptext
>   
make sure that mp knows about the definitions: 

- first extend the math collection (use decimen, since there is a linesplit bug 
with " here) 
- then load the times font 
- somehow display and inline math render differently; something for taco 

\startMPenvironment[global]

\startmathcollection [default]
\definemathsymbol [varointctrclockwise] [op] [mc] [43] [mc] [44]
\stopmathcollection
\usetypescript[times][ec]
\setupbodyfont[times,11pt]

\stopMPenvironment

\starttext

why the funny .15cm scale ... 

\startformula
\varointctrclockwise_{\gamma} f(z) \: dz = 0
\stopformula

$\varointctrclockwise_{\gamma} f(z) \: dz = 0$

\startMPcode
draw btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex scaled 0.15cm 
;
\stopMPcode

\startMPcode
draw btex $\displaystyle \varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex 
scaled 0.15cm ;
\stopMPcode

\stoptext


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

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


[NTG-context] Metapost/Metafun/Tex/Context question

2006-07-19 Thread WN
Hi all,

I am trying to do the following in Metapost but my new math symbol  is 
not recognized.
Context knows about it but Tex does not.

How can I make this work ?

Kind regards
Wim Neimeijer

% = Test code 
\loadmapfile[original-youngryu-tx.map]
\definebodyfont [28pt,24pt,18pt,
  17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
  mc=txexa sa 1]

\setupbodyfont [11pt]
\definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]

\starttext
\startformula
\varointctrclockwise_{\gamma} f(z) \: dz = 0
\stopformula
\startMPcode
picture p ;
path q;
numeric u;

u := 1cm;

p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;
p := p scaled 0.15cm;
draw p;
\stopMPcode
\stoptext

=== Log file ==
 >texmfstart texexec --autopdf --pdf testvaroint.tex
TeXExec | processing document 'testvaroint.tex'
TeXExec | no ctx file found
TeXExec | tex processing method: context
TeXExec | TeX run 1
TeXExec | writing option file testvaroint.top
TeXExec | using randomseed 1260
TeXExec | tex engine: pdfetex
TeXExec | tex format: cont-en
TeXExec | progname: context
This is pdfeTeX, Version 3.141592-1.30.3-2.2 (Web2c 7.5.5)
 \write18 enabled.
 (f:\context\usr\local\context\tex\texmf-local/web2c/natural.tcx)
entering extended mode
(./testvaroint.tex

ConTeXt  ver: 2006.07.14 12:08  fmt: 2006.7.14  int: english  mes: english

language: language en is active

system  : cont-new loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-new.tex
systems : beware: some patches loaded from cont-new.tex
color   : palette rollover is available
)
system  : cont-old loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-old.tex
loading : Context Old Macros
)
system  : cont-fil loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-fil.tex
loading : Context File Synonyms
)
system  : cont-sys loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/user/cont-sys.tex)
bodyfont: 12pt rm is loaded
language: patterns nl->texnansi:texnansi->1->2:3 
nl->ec:ec->2->2:3 fr->
texnansi:texnansi->3->2:3 fr->ec:ec->4->2:3 
de->texnansi:texnansi->5->2:3 de->e
c:ec->6->2:3 it->texnansi:texnansi->7->2:3 it->ec:ec->8->2:3 
pt->texnansi:texna
nsi->9->2:3 pt->ec:ec->10->2:3 hr->ec:ec->11->2:3 pl->pl0:pl0->12->2:3 
pl->ec:e
c->13->2:3 pl->qx:qx->14->2:3 cz->il2:il2->15->2:3 cz->ec:ec->16->2:3 
sk->il2:i
l2->17->2:3 sk->ec:ec->18->2:3 sl->ec:ec->19->2:3 en->ec:ec->21->2:3 
uk->ec:ec-
 >22->2:3 us->ec:ec->23->2:3 agr->agr:agr->24->2:3 da->ec:ec->25->2:3 
sv->ec:ec-
 >26->2:3 af->ec:ec->27->2:3 no->ec:ec->28->2:3 deo->ec:ec->29->2:3 
es->ec:ec->3
0->2:3 ca->ec:ec->31->2:3 la->ec:ec->32->2:3 ro->ec:ec->33->2:3 
tr->ec:ec->34->
2:3 fi->ec:ec->36->2:3 hu->ec:ec->37->2:3 loaded
specials: tex,postscript,rokicki loaded
system  : testvaroint.top loaded
(./testvaroint.top
specials: loading definition file tpd
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/spec-tpd.tex
specials: loading definition file fdf
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/spec-fdf.tex)
specials: fdf loaded
)
specials: fdf,tpd loaded
)
systems : system commands are enabled
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/pdfr-ec.tex)
(./testvaroint.tuo) (./testvaroint.tuo) (./testvaroint.tuo) 
(./testvaroint.tuo)
(./testvaroint.tuo) (./testvaroint.tuo) (./testvaroint.tuo) 
(./testvaroint.tuo)
(./testvaroint.tuo) (./testvaroint.tuo)
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/sort-def.tex)
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/sort-lan.tex)
(./testvaroint.tuo) (./testvaroint.tuo)TeXExec | processing graphic 
'testvaroint-mpgraph'
TeXExec | using internal mptotex converter
TeXExec | processing document 'testvaroint-mpgraph-temp.tex'
TeXExec | no ctx file found
TeXExec | tex processing method: context
TeXExec | writing option file testvaroint-mpgraph-temp.top
TeXExec | using randomseed 447
TeXExec | tex engine: pdfetex
TeXExec | tex format: cont-en
TeXExec | progname: context
This is pdfeTeX, Version 3.141592-1.30.3-2.2 (Web2c 7.5.5)
 \write18 enabled.
 (f:\context\usr\local\context\tex\texmf-local/web2c/natural.tcx)
entering extended mode
(./testvaroint-mpgraph-temp.tex

ConTeXt  ver: 2006.07.14 12:08  fmt: 2006.7.14  int: english  mes: english

language: language en is active

system  : cont-new loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-new.tex
systems : beware: some patches loaded from cont-new.tex
color   : palette rollover is available
)
system  : cont-old loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-old.tex
loading : Context Old Macros
)
system  : cont-fil

Re: [NTG-context] metafun color broken?

2006-06-15 Thread Hans Hagen
Hans van der Meer wrote:
> I expect Hans or Taco to react soon with there usual speed and will  
> await for their comments first.
>   
as taco mentioned, it's in the mem values; mpost does not store them with the 
format (in the past this even could give segfaults and worse); tex does not 
have this problem 

Hans 


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

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


Re: [NTG-context] metafun color broken?

2006-06-15 Thread Hans Hagen
Taco Hoekwater wrote:
> Hi Hans,
>
> Hans van der Meer wrote:
>   
>> I expect Hans or Taco to react soon with there usual speed and will  
>> await for their comments first.
>> 
>
> Perhaps you missed the post below. The current problem is just
> a different symptom of the same problem.
>   

part of the problem is that when no progname is given, the format should 
determine the progname (at least that was the case soem tiem ago) but 
then, mpost is behaving weird with respect to mem vars anyway; the 
current (context) approach is 'use metafun everywhere a prognam eis 
needed' [a problem, at least in the past, is that there were tetex 
versions with no metafun entries in texmf.cnf so we went back to mpost 
as progname for a while]

> Greetings, Taco
>
> Taco Hoekwater wrote:
>  > Hans van der Meer wrote:
>  >
>  >> 2. The mpgraph.1 files differ only slightly, except for a few roundoff
>  >> differences:
>  >> new format extra lines: (but not a problem, I would guess)
>  >> %%MetaPostSpecials: 2.0 123 1000
>  >> %%HiResBoundingBox: -5.66927 -5.66927 359.9991 119.05481
>  >> %%MetaPostSpecial: 7 1 1 1 1 0.94118 1 3
>  >
>  >
>  > Believe it or not, but this is a known problem within web2c.
>  > It is triggered by an interaction between the new texexec
>  > and having two different entries in texmf.cnf for Metaposts
>  > memory size, for example like this:
>  >
>  >   main_memory.mpost= 50
>  >   main_memory.metafun  = 300
>  >
>  > Now, the metafun format is generated as "mpost", but the
>  > graphics are created as "metafun", and the different memory
>  > sizes make the specials go disappear.
>  >
>  > Strangely, I thought Hans and I had fixed by that a few weeks
>  > back by changing the mpost commandlines, but apparently we didn't.
>  >
>  > A workaround (while we sort this out) is to make sure that the
>  > .mpost and .metafun settings use the same (highest) number.
>  >
>  > Taco
>  >
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   


-- 

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

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


Re: [NTG-context] metafun color broken?

2006-06-15 Thread Taco Hoekwater

Hi Hans,

Hans van der Meer wrote:
> 
> I expect Hans or Taco to react soon with there usual speed and will  
> await for their comments first.

Perhaps you missed the post below. The current problem is just
a different symptom of the same problem.

Greetings, Taco

Taco Hoekwater wrote:
 > Hans van der Meer wrote:
 >
 >> 2. The mpgraph.1 files differ only slightly, except for a few roundoff
 >> differences:
 >> new format extra lines: (but not a problem, I would guess)
 >> %%MetaPostSpecials: 2.0 123 1000
 >> %%HiResBoundingBox: -5.66927 -5.66927 359.9991 119.05481
 >> %%MetaPostSpecial: 7 1 1 1 1 0.94118 1 3
 >
 >
 > Believe it or not, but this is a known problem within web2c.
 > It is triggered by an interaction between the new texexec
 > and having two different entries in texmf.cnf for Metaposts
 > memory size, for example like this:
 >
 >   main_memory.mpost= 50
 >   main_memory.metafun  = 300
 >
 > Now, the metafun format is generated as "mpost", but the
 > graphics are created as "metafun", and the different memory
 > sizes make the specials go disappear.
 >
 > Strangely, I thought Hans and I had fixed by that a few weeks
 > back by changing the mpost commandlines, but apparently we didn't.
 >
 > A workaround (while we sort this out) is to make sure that the
 > .mpost and .metafun settings use the same (highest) number.
 >
 > Taco
 >
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metafun color broken?

2006-06-15 Thread Hans van der Meer
After posting this problem I did probe a lot further in this and a  
similar problem.
As I reported shortly, the problem goes away when solely replacing in  
supp-mps.tex the line
\ifx\TEXEXECcommand \undefined \def\TEXEXECcommand{texmfstart  
texexec} \fi
by
\ifx\TEXEXECcommand \undefined \def\TEXEXECcommand{texexec} \fi
This gives me the impression it might not be in context itself,  
especially since to my (inexperienced) eye there are no or few  
changes between the working and nonworking versions that might  
explain the problem.
It might be the change from the perl to the ruby scripts with a  
problem in one of the latter.

I expect Hans or Taco to react soon with there usual speed and will  
await for their comments first.

Hans van der Meer


On Jun 15, 2006, at 17:52, Mojca Miklavec wrote:

> Replying off-list since I have no place to test anything and no  
> time righ now:
>
> I know that Hans has played with transparency at the beginning of May
> in order to enable it in XeTeX (but that should happen/break already
> earlier then), but I can't help you any further. Normar "with color
> transparent" worked a couple of days ago as far as I can remember, but
> I might have had an older version installed (from May).
>
>
> However: I would like to ask you to commit such examples (you have
> much more bug reports everywhere) to "contexttest" suite, see

I usually do this when in doubt if my code is right.
But in this case formerly perfectly working code is suddenly broken.
And of course I need to run my production and development runs on my  
own machine, so I have to solve it for that one.

> http://wiki.contextgarden.net/Test.
>
> Mojca
>
>
> On 6/13/06, Hans van der Meer  wrote:
>>
>> I used to draw in transparent color in MetaFun with:
>>
>>newinternal tfill_mode; tfill_mode := 1; % transparency mode  
>> for inside
>>newinternal tfill_fact; tfill_fact := 1; % transparency factor  
>> for inside
>>def withFillColor = withcolor transparent(tfill_mode, tfill_fact,
>> fillcolor_) enddef;
>>fill somepath withFillColor;
>>
>> Suddenly (since the june update I guess) this fails.
>> Because
>>
>>fill somepath withcolor fillcolor_;
>>
>> is still working I wonder if something has done to this transparency
>> business.
>> If there was a change, why? It brings me trouble.
>>
>>
>> Hans van der Meer



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


[NTG-context] metafun color broken?

2006-06-15 Thread Hans van der Meer
I used to draw in transparent color in MetaFun with:   newinternal tfill_mode; tfill_mode := 1;	% transparency mode for inside   newinternal tfill_fact;	tfill_fact := 1;	% transparency factor for inside   def withFillColor = withcolor transparent(tfill_mode, tfill_fact, fillcolor_) enddef;   fill somepath withFillColor;Suddenly (since the june update I guess) this fails.Because   fill somepath withcolor fillcolor_;is still working I wonder if something has done to this transparency business.If there was a change, why? It brings me trouble. Hans van der Meer ___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \MetaFun

2006-06-09 Thread andrea valle
Ah, ok, that's exactly what I need to know.

I was thinking that maybe there was some kind of special look for the 
\MetaFun word: I was supposing that calling \MetaFun I would have 
obtained the (nice) "shaken" metafun logo of the manuals.

Thanks

-a-


On 9 Jun 2006, at 16:55, Taco Hoekwater wrote:

>
>
> andrea valle wrote:
>> Thanks Hans
>>
>> This is what I obtain.
>>
>> http://www.semiotiche.it/andrea/membrana/metafun.zip
>
> I may be missing something, but this is the output I would
> expect. cont-log.tex contains only this simple definition:
>
>\unexpanded\def\MetaFun
>  {MetaFun}
>
> Cheers,
> Taco
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
>
Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
[EMAIL PROTECTED]

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


Re: [NTG-context] \MetaFun

2006-06-09 Thread Taco Hoekwater


andrea valle wrote:
> Thanks Hans
> 
> This is what I obtain.
> 
> http://www.semiotiche.it/andrea/membrana/metafun.zip

I may be missing something, but this is the output I would
expect. cont-log.tex contains only this simple definition:

   \unexpanded\def\MetaFun
 {MetaFun}

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


Re: [NTG-context] \MetaFun

2006-06-09 Thread andrea valle
Thanks Hans

This is what I obtain.

http://www.semiotiche.it/andrea/membrana/metafun.zip

?

Best

-a-

PS: Console and log follow.

Here console:

  TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

fixing engine variable : pdfetex
 executable : pdfetex
 format : cont-en
  inputfile : metafun
 output : pdftex
  interface : en
   current mode : none
TeX run : 1

This is pdfeTeX, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
  (/usr/local/teTeX/share/texmf.local/web2c/natural.tcx)
entering extended mode
(./metafun.tex

ConTeXt  ver: 2006.02.03 21:03  fmt: 2006.3.13  int: english  mes:  
english

language: language en is active

system  : cont-new loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-new.tex
systems : beware: some patches loaded from cont-new.tex
color   : palette rollover is available
)
system  : cont-old loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-old.tex
loading : Context Old Macros
)
system  : cont-fil loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-fil.tex
loading : Context File Synonyms
)
system  : cont-sys.rme loaded
(/usr/local/teTeX/share/texmf.local/tex/context/user/cont-sys.rme
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-exa.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-syn.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-enc.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-siz.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-map.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-spe.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-akb.tex))
bodyfont: 12pt rm is loaded
language: patterns nl->texnansi:texnansi->1->2:3  
nl->ec:ec->2->2:3 fr->
texnansi:texnansi->3->2:3 fr->ec:ec->4->2:3  
de->texnansi:texnansi->5->2:3 de->e
c:ec->6->2:3 it->texnansi:texnansi->7->2:3 it->ec:ec->8->2:3  
pt->texnansi:texna
nsi->9->2:3 pt->ec:ec->10->2:3 hr->ec:ec->11->2:3 pl->pl0:pl0->12->2:3  
pl->ec:e
c->13->2:3 pl->qx:qx->14->2:3 cz->il2:il2->15->2:3 cz->ec:ec->16->2:3  
sk->il2:i
l2->17->2:3 sk->ec:ec->18->2:3 sl->il2:il2->19->2:3 sl->ec:ec->20->2:3  
en->ec:e
c->22->2:3 uk->ec:ec->23->2:3 us->ec:ec->24->2:3 da->ec:ec->25->2:3  
sv->ec:ec->
26->2:3 af->ec:ec->27->2:3 no->ec:ec->28->2:3 deo->ec:ec->29->2:3  
es->ec:ec->30
->2:3 ca->ec:ec->31->2:3 la->ec:ec->32->2:3 ro->ec:ec->33->2:3  
tr->ec:ec->34->2
:3 fi->ec:ec->36->2:3 hu->ec:ec->37->2:3 loaded
specials: tex,postscript,rokicki loaded
system  : metafun.top loaded
(./metafun.top
specials: loading definition file tpd
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-tpd.tex
specials: loading definition file fdf
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-fdf.tex)
specials: fdf loaded
)
specials: fdf,tpd loaded
)
color   : system rgb is global activated
fonts   : resetting map file list
fonts   : using map file: original-base
fonts   : using map file: ec-public-lm
fonts   : using map file: ec-base
fonts   : using map file: 8r-base
fonts   : using map file: t5-base
fonts   : using map file: original-ams-base
fonts   : using map file: original-ams-euler
fonts   : using map file: original-public-lm
(/usr/local/teTeX/share/texmf.local/tex/context/base/pdfr-ec.tex)  
[1.1{/usr/loc
al/teTeX/share/texmf.local/fonts/map/pdftex/context/original- 
empty.map}{/usr/lo
cal/teTeX/share/texmf.local/fonts/map/pdftex/context/original- 
base.map}{/usr/lo
cal/teTeX/share/texmf.local/fonts/map/pdftex/context/ec-public- 
lm.map}{/usr/loc
al/teTeX/share/texmf.local/fonts/map/pdftex/context/ec-base.map}{/usr/ 
local/teT
eX/share/texmf.local/fonts/map/pdftex/context/8r-base.map}{/usr/local/ 
teTeX/sha
re/texmf.local/fonts/map/pdftex/context/t5-base.map}{/usr/local/teTeX/ 
share/tex
mf.local/fonts/map/pdftex/context/original-ams-base.map}{/usr/local/ 
teTeX/share
/texmf.local/fonts/map/pdftex/context/original-ams-euler.map}{/usr/ 
local/teTeX/
share/texmf.local/fonts/map/pdftex/context/original-public-lm.map}]
systems : end file metafun at line 1
   
){/usr/local/teTeX/share/texmf.tetex/fonts/enc/dvips/lm/lm-ec.enc}
Output written on metafun.pdf (1 page, 22275 bytes).
Transcript written on metafun.log.

return code : 0
   run time : 6 seconds
   sorting and checking : running texutil

  TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004

 action : p

Re: [NTG-context] \MetaFun

2006-06-09 Thread Hans Hagen
andrea valle wrote:
> As I made a presentation concerning typesetting I used the "magic 
> symbols" \TeX, \LaTex, \ConTeXt, \MetaFont, \MetaPost.
> I also used \MetaFun: no error (so it's a recognized command,  I 
> guess), but not special output, \MetaFun = MetaFun.  I was hoping to 
> have the nice MetaFun "shaked" logo...
>   What am I missing?
>
>   
\setupcolors[state=start] \MetaFun \end

should work ok; maybe some problem with your metafun run? 

Hans 

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

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


[NTG-context] \MetaFun

2006-06-08 Thread andrea valle
As I made a presentation concerning typesetting I used the "magic 
symbols" \TeX, \LaTex, \ConTeXt, \MetaFont, \MetaPost.
I also used \MetaFun: no error (so it's a recognized command,  I 
guess), but not special output, \MetaFun = MetaFun.  I was hoping to 
have the nice MetaFun "shaked" logo...
  What am I missing?


Thanks

-a-



Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
[EMAIL PROTECTED]
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Metafun - Metapost capacity exceeded

2006-04-05 Thread Taco Hoekwater


Hans Hagen wrote:
> Thomas Engel wrote:
> 
>>Hello Hans,
>>
>>
>>this is the message I got after running texexec pro_mcc_a3.tex.
>>As you can see I have increased the memory size for mp.
>>I have attached the two tex-files.
>>Maybe there is a mistake in the mp-code. A pdf-file will be produced,
>>but if you check the output you will see, that one cubicle is missing!
>>  
> 
> i run out of tex memory (8 meg) while converting the big last one 

Oh yeah, it needs 14.5 MB of memory or so for the conversion.

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


Re: [NTG-context] Metafun - Metapost capacity exceeded

2006-04-05 Thread Hans Hagen
Thomas Engel wrote:
> Hello Hans,
>
>
> this is the message I got after running texexec pro_mcc_a3.tex.
> As you can see I have increased the memory size for mp.
> I have attached the two tex-files.
> Maybe there is a mistake in the mp-code. A pdf-file will be produced,
> but if you check the output you will see, that one cubicle is missing!
>   
ok, i stripped down the sample to one image and coul dgenerate a page 

(btw \twodigitMPoutput will make mem usage less but also the quality) 

now, the problem is in the way you define your graphic: 

def Whatever () = 
  save SomePicture ; 
  picture SomePicture ; 
  lots of draws
  SomePicture := currentpicture ;
  SomePicture % return value
end 

here you *never* erase the currentpicture, so graphic keeps accumulating, and 
each SomePicture has all previous draws

you can see that on the screen: acrobat takes ages to draw the simple graphic 
and you can also see it from the mp output (a couple of 100K lines). 

solution: 

def Whatever () = 
  save SomePicture ; 
  picture SomePicture ; 
  lots of draws
  SomePicture := currentpicture ;
  currentpicture := nullpicture ; % ADDED
  SomePicture % return value
end 

or just 

def Whatever () = 
  image ( 
  lots of draws
  ) 
end 

So ... 

Hans 

  

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

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


Re: [NTG-context] Metafun - Metapost capacity exceeded

2006-04-05 Thread Hans Hagen
Thomas Engel wrote:
> Hello Hans,
>
>
> this is the message I got after running texexec pro_mcc_a3.tex.
> As you can see I have increased the memory size for mp.
> I have attached the two tex-files.
> Maybe there is a mistake in the mp-code. A pdf-file will be produced,
> but if you check the output you will see, that one cubicle is missing!
>   
i run out of tex memory (8 meg) while converting the big last one 

btw: 

\definelayer[s1]
\defineoverlay[s1][\composedlayer{s1}]
\setupbackgrounds[page][background=s1]

you can omit the second lin ethere (automatically done) 

\definelayer[s1]
\setupbackgrounds[page][background=s1]

also, there is no need for \starttext .. \stoptext inside a \startproject .. 
\stopproject 

Hans 




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

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


Re: [NTG-context] Metafun - Metapost capacity exceeded

2006-04-04 Thread Thomas Engel
Hello Hans,


this is the message I got after running texexec pro_mcc_a3.tex.
As you can see I have increased the memory size for mp.
I have attached the two tex-files.
Maybe there is a mistake in the mp-code. A pdf-file will be produced,
but if you check the output you will see, that one cubicle is missing!

Thanks for your help!

Thomas




 TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

  metapost : pro_mcc_a3-mpgraph
format : metafun
This is MetaPost, Version 0.901 (Web2C 7.5.3)
(/home/thomas/texmf/web2c/natural.tcx)
(pro_mcc_a3-mpgraph.mp [1] [2] [3] [4] [5] [6] [7] [8] [9]
! MetaPost capacity exceeded, sorry [main memory size=200].
 ;

l.2277 ...aw he_zehn ((1.75),(5.6), (0.2),(17.5));

9 output files written: pro_mcc_a3-mpgraph.1 .. pro_mcc_a3-mpgraph.9
Transcript written on pro_mcc_a3-mpgraph.log.
 error in metapost run : pro_mcc_a3-mpgraph.mp:2277

total run time : 0 seconds
  sorting and checking : running texutil

 TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004

action : processing commands, lists and registers
option : sorting IJ under Y
option : converting high ASCII values
input file : pro_mcc_a3.tui
   output file : pro_mcc_a3.tuo
   passed commands : 18
 remapped keys : 0
  register entries : 0 -> 0 entries 0 references
   synonym entries : 0 -> 0 entries
embedded files : 2

total run time : 7 seconds



\startproduct prd_mcc_a3
\project pro_mcc_a3
\setuppapersize[A3, landscape][A3, landscape]


\startMPenvironment
  \setupbodyfont[pos]
\stopMPenvironment

\startuseMPgraphic{fra}

   StartPage ;
   u:=10mm;
 draw Page enlarged -1cm;
 draw Page enlarged -0.80cm;
 draw (1u,2u)--(41u,2u)--cycle;
   StopPage ;

\stopuseMPgraphic



\startuniqueMPgraphic{bottomline}
  draw bottomboundary OverlayBox
  leftenlarged 6pt rightenlarged 6pt
  shifted (0,.75HeaderHeight) ;
  setbounds currentpicture to OverlayBox ; % forces dimensions
\stopuniqueMPgraphic

\startuseMPgraphic{ruler}
u:=5mm;
draw(0,0)--(78u,0)--(0,0);
defaultfont:="cmr5";
draw (0,0)--(0,-0.5u);
label(decimal 0,(0,-1u+4));
for n=1 upto 77:
   draw (1u*n,0)--(1u*n,-0.5u);
endfor
for n=1 upto 38.5 :
   defaultfont:="cmr5";
   label(decimal (2n*100),(1u*2n,-1u+4));
  % draw (2u*n,0)--(2u*n,-0.5u);
  % defaultfont:="cmr5";
   label(decimal (2n*100-100),(1u*2n-1u,-1.1u));
endfor
\stopuseMPgraphic

\startuseMPgraphic{vruler}
u:=5mm;
draw(0,0)--(0,24u)--(0,0);
defaultfont:="cmr5";
draw (0,0)--(-0.5u,0);
label(decimal 0,(-1u+4,0));
for n=1 upto 24:
   draw (0,1u*n)--(-0.5u,1u*n);
endfor
for n=1 upto 24 :
   defaultfont:="cmr5";
   label(decimal (n*100),(-1.2u,1u*n));
endfor
\stopuseMPgraphic







\setupMPvariables[mcc1000][e1=0,e2=0,e3=0,e4=0,e5=0,e6=0,e7=0,e8=0,e9=0]
\startuseMPgraphic{mcc1000}{e1,e2,e3,e4,e5,e6,e7,e8,e9}
  vardef he_eins (expr h, b, ho, vo) =
 save Panel, z;
 picture Panel;
 path s[] ;
 u:=5mm;
 s1 := (0,0)--(b*u,0)--(b*u,h*u)--(0,h*u)--cycle;
 s2 := (0.2u,0.1u)--(0.2u,(h-0.05)*u);
 s3 := ((b-0.2)*u,0.1u)--((b-0.2)*u,(h-0.05)*u);
 s4 := (4.8u,0.3u)--(4.8u,0.7u);
 draw s1 shifted (ho*u,vo*u);
 pickup pencircle scaled 1;
 draw s2 shifted (ho*u,vo*u);
 draw s3 shifted (ho*u,vo*u);
 pickup pencircle scaled 0.5;
%%Simocode
 draw unitsquare xscaled 1.4u yscaled 0.6u shifted ((ho+0.4)*u,(vo+h-0.8)*u) ;
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+0.5)*u,(vo+h-0.7)*u);
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+0.8)*u,(vo+h-0.7)*u);
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+1.1)*u,(vo+h-0.7)*u);
%%Schalter
draw unitsquare xscaled 0.6u yscaled 0.6u shifted ((ho+4.5)*u,(vo+0.2)*u);
draw fullcircle scaled 0.45u shifted  ((ho+4.8)*u,(vo+0.5)*u);
draw fullcircle scaled 0.3u shifted  ((ho+4.8)*u,(vo+0.5)*u);
pickup pencircle scaled 1;
draw s4 shifted (ho*u,vo*u) ;
   pickup pencircle scaled 0.5;
   Panel:=currentpicture;
   Panel
enddef;

  vardef he_zehn (expr h, b, ho, vo) =
 save Panel, z;
 picture Panel;
 path s[] ;
 u:=5mm;
 s1 := (0,0)--(b*u,0)--(b*u,h*u)--(0,h*u)--cycle;
 s2 := (0.2u,0.1u)--(0.2u,(h-0.05)*u);
 s3 := ((b/2+0.2)*u,0.1u)--((b/2+0.2)*u,(h-0.05)*u);
 s4 := (4.8u,0.3u)--(4.8u,0.7u);
 s5 := (2u,0.3u)--(2u,0.7u);
 s6 := (2.8u,0)--(2.8u,1.75u);
draw s1 shifted (ho*u,vo*u);
pickup pencircle scaled 1;
draw s2 shifted (ho*u,vo*u);
pickup pencircle scaled 0.5;
%%Simocode
 draw unitsquare xscaled 1.4u yscaled 0.6u shifted ((ho+0.4)*u,(vo+h-0.8)*u) ;
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+0.5)*u,(vo+h-0.7)*u);
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+0.8)*u,(vo+h-0.7)*u);
draw unitsquare xscaled 0.2u yscaled 0.2u shifted ((ho+1.1)*u,(vo+h-0.7)*u);
%%Schalter
draw unitsquare 

Re: [NTG-context] Metafun - Metapost capacity exceeded

2006-04-04 Thread Taco Hoekwater
Thomas Engel wrote:
> Hello Hans,
> 
> 
> this is the message I got after running texexec pro_mcc_a3.tex.
> As you can see I have increased the memory size for mp.
> I have attached the two tex-files.
> Maybe there is a mistake in the mp-code. A pdf-file will be produced,
> but if you check the output you will see, that one cubicle is missing!

No problems here. It uses 2351976 words of memory, though.

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


Re: [NTG-context] Metafun - Metapost capacity exceeded

2006-04-03 Thread Hans Hagen
Thomas Engel wrote:
> Hello,
>
> I'm doing my first work with metafun to generate a switchgear layout
> from  a cvs file.
> During the run (texexec ) I get the message -  Metapost capacity
> exceeded  and a part of the drawing is missing.
>
> I followed the thread  -TeX capacity exceeded with metafun-
> and increased the memory size in texmf.cnf but this is not the solution!
>
> Any suggestion what's going wrong?
>   
texmfstart bin:scite.exe kpse:texmf.cnf

(or another editor)

will open the used texmf.cnf file, which may giv eyou a clue about the 
memory values
> btw.
> it is allowed to send the tex file to the list?
>   
sure

Hans 

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

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


[NTG-context] Metafun - Metapost capacity exceeded

2006-04-03 Thread Thomas Engel
Hello,

I'm doing my first work with metafun to generate a switchgear layout
from  a cvs file.
During the run (texexec ) I get the message -  Metapost capacity
exceeded  and a part of the drawing is missing.

I followed the thread  -TeX capacity exceeded with metafun-
and increased the memory size in texmf.cnf but this is not the solution!

Any suggestion what's going wrong?

btw.
it is allowed to send the tex file to the list?

Thanks

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


Re: [NTG-context] TeX capacity exceeded with metafun

2006-03-14 Thread Hans Hagen
andrea valle wrote:
> Console is extremely slow in processing the file including the  
>   
that is an os issue (maybe choose another font for your console)

i have no speed problems on the windows and linux boxes 

Hans  


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

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


Re: [NTG-context] TeX capacity exceeded with metafun

2006-03-13 Thread andrea valle
Thanks Hans,
I made some tweaking with values (quasi-randomly...).
Console is extremely slow in processing the file including the  
MPGraphic (I thought many times it hanged, then letting it run without  
looking I discovered some minutes after that it was still working).
Looking at the the terminal (from TeXShop), it seemed that the process  
was not finished, so I killed it, but the pdf is complete.
In any case now I have my drawing of 10,000 squares.

Best and thanks a lot

-a-

PS:
Here you have my algorithmic hommage à Boetti  
(http://www.artfacts.net/index.php/pageType/exhibitionInfo/exhibition/ 
5797/lang/3):
http://www.semiotiche.it/andrea/membrana/alternando.pdf



On 13 Mar 2006, at 09:24, Hans Hagen wrote:

> andrea valle wrote:
>> Thanks Hans
>>
>> So:
>> 1. If I understand, I have to edit context.cnf, right?
>>
> no, texmf.cnf ; context.tmf is an example of what i use here; (you can
> try copying context.fmf to you texmf-local/web2c path)
>
>> 2. It may work, but non necessarily. It is thus possible that I cannot
>> solve definitively the problem. How do I choose a clever number to  
>> set?
>>
> locate the texmf,cnf files used and just change the numbers; going from
> 2 meg to 4 meg is no problem, but in your case of adding a zero, going
> to 20 meg is more that tex can offer
>> 3. Ehm... No, I haven't regenerated the format. How can I do it?
>>
> texexec --make --all
>
> Hans
>
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>  | www.pragma-pod.nl
> -
>
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
>
Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
[EMAIL PROTECTED]

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


Re: [NTG-context] TeX capacity exceeded with metafun

2006-03-13 Thread Hans Hagen
andrea valle wrote:
> Thanks Hans
>
> So:
> 1. If I understand, I have to edit context.cnf, right?
>   
no, texmf.cnf ; context.tmf is an example of what i use here; (you can 
try copying context.fmf to you texmf-local/web2c path)
 
> 2. It may work, but non necessarily. It is thus possible that I cannot 
> solve definitively the problem. How do I choose a clever number to set?
>   
locate the texmf,cnf files used and just change the numbers; going from 
2 meg to 4 meg is no problem, but in your case of adding a zero, going 
to 20 meg is more that tex can offer
> 3. Ehm... No, I haven't regenerated the format. How can I do it?
>   
texexec --make --all 

Hans 


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

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


Re: [NTG-context] TeX capacity exceeded with metafun

2006-03-12 Thread andrea valle
I edited the file doubling the 3 values


 But in context.cnf I have:
 main_memory.context  = 200
 main_memory.mpost= 300
 main_memory.metafun  = 300


>> did you regenerate the formats?
>>
>>


Then I ran:

texexec --make

(right?)

But nothing changed

Best

-a-

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


Re: [NTG-context] TeX capacity exceeded with metafun

2006-03-12 Thread andrea valle
Thanks Hans

So:
1. If I understand, I have to edit context.cnf, right?
2. It may work, but non necessarily. It is thus possible that I cannot 
solve definitively the problem. How do I choose a clever number to set?
3. Ehm... No, I haven't regenerated the format. How can I do it?

Thanks

Best
-a-


>>> But in context.cnf I have:
>>> main_memory.context  = 200
>>> main_memory.mpost= 300
>>> main_memory.metafun  = 300
>>>
>>> Now, I added one 0 to all these params, thus decuplicating the 
>>> values,
>>> but nothing changes.
>>>
> did you regenerate the formats?
>
> (btw adding a 0 will not work, duplicating may)
>
> Hans
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>  | www.pragma-pod.nl
> -
>
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
>
Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
[EMAIL PROTECTED]

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


Re: [NTG-context] TeX capacity exceeded with metafun

2006-03-12 Thread Hans Hagen
andrea valle wrote:
> Now, as far as I understand it seems that I have to edit texmf.cnf.
>
> In any case, I do not know in which way...
>
>
> Thanks!
>
> -a-
>
>
>
>
>
>
> On 12 Mar 2006, at 11:19, andrea valle wrote:
>
>   
>> Hi to all,
>>
>> I'm plotting 10,000 little squares thus exceeding TeX capacity. I was
>> going to modify context.cnf (everything works with 5,000 squares).
>>
>>
>> In particular, I'm  on macosx 10.3 with Gerben's distro. I am editing
>> this file:
>>   /usr/local/teTeX/share/texmf.local/web2c/context.cnf
>>
>> 1. is it correct?
>> 2. Above all, I'am obtaining:
>> ! TeX capacity exceeded, sorry [main memory size=800].
>>
>> Here's the log:
>>
>> If you really absolutely need more capacity,
>> you can ask a wizard to enlarge me.
>>
>>
>> Here is how much of TeX's memory you used:
>>   1108 strings out of 60272
>>   18484 string characters out of 602115
>>   801 words of memory out of 800
>>   38234 multiletter control sequences out of 1+5
>>   75018 words of font info for 37 fonts, out of 200 for 2000
>>   192 hyphenation exceptions out of 5000
>>   36i,2n,31p,223b,477s stack positions out of
>> 5000i,500n,6000p,20b,4s
>> PDF statistics:
>>   0 PDF objects out of 30
>>   0 named destinations out of 131072
>>   1 words of extra memory for PDF output out of 1
>> No pages of output.
>>
>>
>>
>> But in context.cnf I have:
>> main_memory.context  = 200
>> main_memory.mpost= 300
>> main_memory.metafun  = 300
>>
>> Now, I added one 0 to all these params, thus decuplicating the values,
>> but nothing changes.
>> 
did you regenerate the formats? 

(btw adding a 0 will not work, duplicating may) 

Hans 

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

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


Re: [NTG-context] TeX capacity exceeded with metafun

2006-03-12 Thread andrea valle
Now, as far as I understand it seems that I have to edit texmf.cnf.

In any case, I do not know in which way...


Thanks!

-a-






On 12 Mar 2006, at 11:19, andrea valle wrote:

> Hi to all,
>
> I'm plotting 10,000 little squares thus exceeding TeX capacity. I was
> going to modify context.cnf (everything works with 5,000 squares).
>
>
> In particular, I'm  on macosx 10.3 with Gerben's distro. I am editing
> this file:
>   /usr/local/teTeX/share/texmf.local/web2c/context.cnf
>
> 1. is it correct?
> 2. Above all, I'am obtaining:
> ! TeX capacity exceeded, sorry [main memory size=800].
>
> Here's the log:
>
> If you really absolutely need more capacity,
> you can ask a wizard to enlarge me.
>
>
> Here is how much of TeX's memory you used:
>   1108 strings out of 60272
>   18484 string characters out of 602115
>   801 words of memory out of 800
>   38234 multiletter control sequences out of 1+5
>   75018 words of font info for 37 fonts, out of 200 for 2000
>   192 hyphenation exceptions out of 5000
>   36i,2n,31p,223b,477s stack positions out of
> 5000i,500n,6000p,20b,4s
> PDF statistics:
>   0 PDF objects out of 30
>   0 named destinations out of 131072
>   1 words of extra memory for PDF output out of 1
> No pages of output.
>
>
>
> But in context.cnf I have:
> main_memory.context  = 200
> main_memory.mpost= 300
> main_memory.metafun  = 300
>
> Now, I added one 0 to all these params, thus decuplicating the values,
> but nothing changes.
>
> ?
>
> Many thanks as usual for any hints
>
> Best
>
> -a-
>
> Andrea Valle
> DAMS - Facoltà di Scienze della Formazione
> Università degli Studi di Torino
> http://www.semiotiche.it/andrea
> [EMAIL PROTECTED]
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
>
Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
[EMAIL PROTECTED]

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


[NTG-context] TeX capcity excedeed with metafun

2006-03-12 Thread andrea valle
Hi to all,

I'm plotting 10,000 little squares thus exceeding TeX capacity. I was 
going to modify context.cnf (everything works with 5,000 squares).


In particular, I'm  on macosx 10.3 with Gerben's distro. I am editing 
this file:
  /usr/local/teTeX/share/texmf.local/web2c/context.cnf

1. is it correct?
2. Above all, I'am obtaining:
! TeX capacity exceeded, sorry [main memory size=800].

Here's the log:

If you really absolutely need more capacity,
you can ask a wizard to enlarge me.


Here is how much of TeX's memory you used:
  1108 strings out of 60272
  18484 string characters out of 602115
  801 words of memory out of 800
  38234 multiletter control sequences out of 1+5
  75018 words of font info for 37 fonts, out of 200 for 2000
  192 hyphenation exceptions out of 5000
  36i,2n,31p,223b,477s stack positions out of 
5000i,500n,6000p,20b,4s
PDF statistics:
  0 PDF objects out of 30
  0 named destinations out of 131072
  1 words of extra memory for PDF output out of 1
No pages of output.



But in context.cnf I have:
main_memory.context  = 200
main_memory.mpost= 300
main_memory.metafun  = 300

Now, I added one 0 to all these params, thus decuplicating the values, 
but nothing changes.

?

Many thanks as usual for any hints

Best

-a-

Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
[EMAIL PROTECTED]
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metafun "boxes"

2006-03-02 Thread Renaud AUBIN

Hi Adita,

I have already seen metaobj in the past... but I have forgotten it... ;-)

Thank you very much for the example !

Cheers,

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


Re: [NTG-context] metafun "boxes"

2006-03-02 Thread Aditya Mahajan
<--- On Mar 2, Renaud AUBIN wrote --->

>
> Hi all,
>
> Yesterday, I have tried to put "\input boxes" within a MPgraphic. As a
> result, I obtain errors at compilation. After discussing this issue with
> Taco on #context, it appears that boxes.mp and metafun interaction is
> not safe at all.

Shouldn't  that be input boxes; in a MPinclusions?

> X. others solutions I don't know yet... (feel free to add yours !)

Have a look at metaobj.
> My thought is to finally obtain in metafun:
> 1. Nodes with text (multiline text!)

Place inside a framed

> and a collection of "simple" shapes to use like box, circle, box 
> with rounded corner...

Metaobj provides all basic shapes

> 2. Nodes must be placed freely accroding to the metapost coordinate 
> system

Metaobj provides a better interface to placement. You can specify the 
distance and alignment between the nodes.

> 3. Connections between nodes (using boundaries of each nodes +
> possibility to give angles from...to for each connections)

Has all of that

> See http://renolab.lrv.uvsq.fr/perso/ConTeXt/sample.png to have an idea

See the example below. metaobj has some bugs and limitations, but 
works as expected most of the time.

\starttext

\startMPenvironment
   \setupbodyfont[8pt]
   \setupframed[width=3cm, align=center, frame=off]
\stopMPenvironment

\startMPinclusions
   input metaobj;
   setObjectDefaultOption("Ellipse")("fit")(false)
   setCurveDefaultOption("arcangleA",15);
   setCurveDefaultOption("arcangleB",15);
\stopMPinclusions

\startMPpage
   % Metaobj provides a Circle command. But there seems to be
   % a bug in the interaction of Circle and Matix. So using Ellipse with
   % fit=false
   newEllipse.N1(btex \framed{Mise Sous Tension} etex) ;
   newEllipse.N2(btex \framed{Mesure du point zéro méchaique} etex) ;
   newEllipse.N3(btex \framed{Régalage des paramèters de contrôle} etex) ;
   newEllipse.N4(btex \framed{Envoi du contenu de l'\cap{EEPROM}} etex) ;
   newEllipse.N5(btex \framed{{\bf Mode stop|/| réglage}
 Attente de commande} etex) ;
   newEllipse.N6(btex \framed{\bf Mode freins libres} etex) ;
   newEllipse.N7(btex \framed{Le contenu de l'\cap{EEPROM} a changé} etex) ;
   newEllipse.N8(btex \framed{Ëcriture du contenu de la
 \cap{RAM} vers l'\cap{EEPROM}} etex);
   newEllipse.N9(btex \framed{{\bf Mode  Contrôle} La valeur
 de la commande est rafraîchie à chaque cycle} etex) ;

   newMatrix.diagram(3,3)(N1,N2,N3,N4,N5,N6,N7,N8,N9)
 "hsep(1.5cm)", "vsep(1.5cm)";
   diagram.c = origin ;
   drawObj(diagram) ;
   ncline(N1)(N5) ;
   for i = 2,3,4,6,7,8,9:
 ncarc(N[i])(N[5]) ;
 ncarc(N[5])(N[i]) ;
   endfor
   nccircle(N6) "angleA(-120)" ;
   nccircle(N9) "angleA(-120)" ;

   % Labels can be added. See metaobj manual

\stopMPpage

\stoptext





-- 
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] metafun "boxes"

2006-03-02 Thread Renaud AUBIN

Hi all,

Yesterday, I have tried to put "\input boxes" within a MPgraphic. As a
result, I obtain errors at compilation. After discussing this issue with
Taco on #context, it appears that boxes.mp and metafun interaction is
not safe at all.
Ok, but since my needs remain the same, solutions are :
1. just do it, but manually (not smart at all)
2. use metapost then include the result in my document through ps or pdf
files (this solution needs the user takes care of fonts + manually
metaposting -> not "really" smart)
3. use charts (but depends on what you want achieve -> ok, but not for
all purposes)
4. define some metafun macros (time consuming at  the beginning but it's
best to invest for the long term)
X. others solutions I don't know yet... (feel free to add yours !)

My thought is to finally obtain in metafun:
1. Nodes with text (multiline text!) and a collection of "simple" shapes
to use like box, circle, box with rounded corner... 2. Nodes must be
placed freely accroding to the metapost coordinate system
3. Connections between nodes (using boundaries of each nodes +
possibility to give angles from...to for each connections)

PSTricks can do that but it can be nice if metafun can provide this kind
of features.
See http://renolab.lrv.uvsq.fr/perso/ConTeXt/sample.png to have an idea
(nodes are aligned in this figure but it is a particular case)...

Maybe a solution exists, but since I don't know it, I send this post:
1. Are other people interested ?
2. What is the best solution to implement this feature in metafun ?

My idea is to use \framed + shapes + path + ...

Feel free to give your opinion/need/contribution/whateveryouwant ;-)

Cheers,

Renaud


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


Re: [NTG-context] metafun: problems, problems & problems again

2006-02-21 Thread Hans Hagen
Mojca Miklavec wrote:
>
> went away when I removed \setupoutput[pdf] from cont-sys.tex (but I'm
> stil confused since there are two cont-sys files, one .rme and one
> .ori. Which one should be used? They are identical, but why would one
> want to have the same file at two places?)
>   
because that way you still have an original when you mess up your local 
cont-sys.tex file; when no cont-sys.tex file is present (not in the 
distribution because it's not to be overwritten) context will load the 
rme file; the rme file also shows the latest greatest options that make 
sense to go there

btw, setupoutput[pdf] is not supposed to be in the cont-sys.tex file; 
newtexec defaults to pdf output anyway

Hans

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

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


Re: [NTG-context] metafun: problems, problems & problems again

2006-02-21 Thread Mojca Miklavec
On 2/20/06, Hans Hagen wrote:
> Mojca Miklavec wrote:
> > But I still get no figures at all under MikTeX and "undefined" labels
> > with the standalone.
> >
> that normally means that no tex subruns take place (or wrong ones)
>
> (maybe the system command is not executed, in the log you can see what
> write 18 does)
>
> you can try (on a mp file):
>
> texexec --mptex somefile.mp
>
> and see what is reported

I traced the problem of getting annoying "\loadfontfilesoncetrue
undefined" messages down to the line 2936 in texexec.pl, sub RunMPX:
   if ( ( $Format eq '' ) || ( $Format =~ /^cont.*/io ) ) {
  RunConTeXtFile( $MpTmp, "tex" );
   } else {
  RunSomeTeXFile( $MpTmp, "tex" );
   }

The first subroutine (RunConTeXtFile) is executed (as it should be),
but it calls TeX instead of "ConTeXt" (format) and I have no idea how
to change this behaviour. That's why all ConTeXt commands are
undefined.

The same is true for tex.rb, line 1442:
   if context then
  ok = RunConTeXtFile(mptex)
   else
  ok = RunSomeTeXFile(mptex)
   end

It goes into the first part of the if sentence, but it nevertheless
runs (plain) tex. Except that in this time it was far from evident for
me where this RunConTeXtFile came from (I didn't see the definition
anywhere except if it calls Perl at that place).

On 2/20/06, Taco Hoekwater wrote:
> Mojca Miklavec wrote:
> > Is there any way to explore why the crash would happen? I get "An
> > unhandled win32 exception occured in pdfetex.exe [2384]", 3164, 812,
> > 1752, 2776, ...
>
> A (likely) candidate is an (software-ignored) attempt to write to
> a file that is still in use by another application. It is quite
> possible that this is the result of an I/O timing error that is in
> itself caused by a misconfigured win32 install (harddisks in ms-dos
> compatility mode, for example, or soundcard that share interrupts
> with the harddisk controller.

Might be. I also heard from some latex people that they had problems
with pdflatex on some disks. It happened to me on two different
computers on two different distros (MikTeX, standalone). Some crashing
went away when I removed \setupoutput[pdf] from cont-sys.tex (but I'm
stil confused since there are two cont-sys files, one .rme and one
.ori. Which one should be used? They are identical, but why would one
want to have the same file at two places?)

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


Re: [NTG-context] metafun: problems, problems & problems again

2006-02-20 Thread Taco Hoekwater
Mojca Miklavec wrote:

> Is it OK that those mpx314 files end with \end{document}?

Yes, that is 'normal': plain TeX (and thereby ConTeXt) only sees the
\end command, and LaTeX/SliTeX sees the whole \end{document} (this
stuff was written before ConTeXt became popular).

> Is there any way to explore why the crash would happen? I get "An
> unhandled win32 exception occured in pdfetex.exe [2384]", 3164, 812,
> 1752, 2776, ...

A (likely) candidate is an (software-ignored) attempt to write to
a file that is still in use by another application. It is quite
possible that this is the result of an I/O timing error that is in
itself caused by a misconfigured win32 install (harddisks in ms-dos
compatility mode, for example, or soundcard that share interrupts
with the harddisk controller.

The crash information means absolutely nothing to me, sorry.

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


Re: [NTG-context] metafun: problems, problems & problems again

2006-02-20 Thread Mojca Miklavec
On 2/20/06, Hans Hagen wrote:
> > 4. I have problems with \loadfontfilesoncetrue. I searched through
> >
> hm, loadfontfilesonce is not there (any more)

But it's in all my -mpgraph.mp documents. Anyhow, other ConTeXt
commands aren't recognized either.

I reinstalled ConTeXt/MikTeX for the second or the third time and now
it doesn't crash any more (but now I get complaints about all the
ConTeXt-specific commands).

However, I discovered something strange in the log files in temporary
folder (they were left there while I stil had the crashing version of
pdfTeX). Log files about processing mpx314.tex files have "preloaded
format=plain" in them. Is it possible that they are processed with the
wrong switch for MikTeX (with its own specifics)? This might explain
the "loadfontfileonce" and other errors. There's usually no chance to
see those log files (if pdfTeX didn't crash, I wouldn't see them).
PdfTeX in standalone ConTeXt crashes before that, so it just manages
to create some trash empty directory which is deleted again after I
click "no, don't report that error to Microsoft, please".

> > mailing list archives and found out that that problems was already
> > present in 2002 and that someone solved it by deleting all ConTeXt
> > files from MikTeX. I don't understand why since I have fresh MikTeX
> > distribution on the computer, but I'll try that.
> >
> maybe some old cont-sys.tex file?

Which one I just realized that there are actually two cont-sys.
One from user/cont-sys.rme and the other one from base/cont-sys.ori.
They are (almost) identical.

I have overwritten the MikTeX dir with files from cont-tfm.zip. And
now MikTeX crashes (crashed, I'm writing this mail in non-cronological
order) with the sample mentioned below as well. (OK, there were two
minor mistakes in the sample files I've put online, but no reason why
pdfTeX should crash on it. pdfTeX crashes approximately on the moment
when mpx files are generated.)

I used MikTeX on another computer and during playing with those
cont-sys.tex and cont-usr.tex, refreshing & remaking formats, the
behaviour changed from non-crashing into the crashing one, but I don't
manage to repeat that behaviour on my computer. Since I came back, it
doesn't crash any more. Mist.

[again one paragraph that should be written in past tense] But on my
computer I simply don't manage to change anything. Keeps crashing
while processing those mpx files and after that it complains that
context-specific commands are unknown (seems as if everything between
btex ... etex would be processed with latex). Is it OK that those
mpx314 files end with \end{document}?

Is there any way to explore why the crash would happen? I get "An
unhandled win32 exception occured in pdfetex.exe [2384]", 3164, 812,
1752, 2776, ...

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


Re: [NTG-context] metafun: problems, problems & problems again

2006-02-20 Thread Taco Hoekwater


Mojca Miklavec wrote:
> 
> 5. I hoped to be able to use gnuplot with context terminal, but the
> file I produced crashes pdfetex 1.30.3--2.2 (in stand-alone distro).
> 1.21a under MikTeX doesn't crash, but since there is no output it
> might be that the older version never gets to the point where it would
> crash. A very rare event. The files that make the pdftex crash are
> located here: http://pub.mojca.org/gnuplot/pdftex-crash/

Mojca,

What commandline do I have to run to get a crash? (as opposed to
a TeX error message)

Cheers, Taco

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


Re: [NTG-context] metafun: problems, problems & problems again

2006-02-20 Thread Hans Hagen
Mojca Miklavec wrote:
> Hello,
>
> This metafun will soon drive me crazy.
>
> 1. I can't make textext work
>
> Once upon a time I only had problems in MikTeX, now standone is
> causing me problems as well. I have:
> - write18 / -shell-escape enabled
> - \runMPgraphicstrue
>   \runMPTEXgraphicstrue
>   \useMETAFUNformattrue
>   \protectbufferstrue
>   enabled (I don't know where to look further).
> But I still get no figures at all under MikTeX and "undefined" labels
> with the standalone.
>   
that normally means that no tex subruns take place (or wrong ones)

(maybe the system command is not executed, in the log you can see what 
write 18 does)

you can try (on a mp file):

texexec --mptex somefile.mp

and see what is reported


> 2. mptopdf doesn't work under MikTeX (as already mentioned), but
> that's not so critical since I can still use texmfstart or write my
> own .bat file to run it
>   
forget about something mptopdf.exe, the bat method using texmfstart is 
the way to go
> 3. metafun reformats the whole metapost source (including that in
> verbatin) and so you can never predict what will come out; often the
> TeX commands fail to work and while it's possible to easily debug
> plain metapost sources, metafun swallows most of the error warnings
> somehow, so you don't get any output, but no error reports either.
>   
there is normally a -mpgraph.log file
> 4. I have problems with \loadfontfilesoncetrue. I searched through
>   
hm, loadfontfilesonce is not there (any more)
> mailing list archives and found out that that problems was already
> present in 2002 and that someone solved it by deleting all ConTeXt
> files from MikTeX. I don't understand why since I have fresh MikTeX
> distribution on the computer, but I'll try that.
>   
maybe some old cont-sys.tex file?
> 5. I hoped to be able to use gnuplot with context terminal, but the
> file I produced crashes pdfetex 1.30.3--2.2 (in stand-alone distro).
> 1.21a under MikTeX doesn't crash, but since there is no output it
> might be that the older version never gets to the point where it would
> crash. A very rare event. The files that make the pdftex crash are
> located here: http://pub.mojca.org/gnuplot/pdftex-crash/
>   
Hans 

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

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


[NTG-context] metafun: problems, problems & problems again

2006-02-19 Thread Mojca Miklavec
Hello,

This metafun will soon drive me crazy.

1. I can't make textext work

Once upon a time I only had problems in MikTeX, now standone is
causing me problems as well. I have:
- write18 / -shell-escape enabled
- \runMPgraphicstrue
  \runMPTEXgraphicstrue
  \useMETAFUNformattrue
  \protectbufferstrue
  enabled (I don't know where to look further).
But I still get no figures at all under MikTeX and "undefined" labels
with the standalone.

2. mptopdf doesn't work under MikTeX (as already mentioned), but
that's not so critical since I can still use texmfstart or write my
own .bat file to run it

3. metafun reformats the whole metapost source (including that in
verbatin) and so you can never predict what will come out; often the
TeX commands fail to work and while it's possible to easily debug
plain metapost sources, metafun swallows most of the error warnings
somehow, so you don't get any output, but no error reports either.

4. I have problems with \loadfontfilesoncetrue. I searched through
mailing list archives and found out that that problems was already
present in 2002 and that someone solved it by deleting all ConTeXt
files from MikTeX. I don't understand why since I have fresh MikTeX
distribution on the computer, but I'll try that.

5. I hoped to be able to use gnuplot with context terminal, but the
file I produced crashes pdfetex 1.30.3--2.2 (in stand-alone distro).
1.21a under MikTeX doesn't crash, but since there is no output it
might be that the older version never gets to the point where it would
crash. A very rare event. The files that make the pdftex crash are
located here: http://pub.mojca.org/gnuplot/pdftex-crash/

Thanks a lot for any help & suggestions,
Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] using symbols in MetaFun

2006-02-15 Thread Mojca Miklavec
Thank you very much to both of you! This works perfectly and just the
way I wanted.

I have some other questions, but I have to write exact specification(s) first.

(The whole documentation for implementing 3D features is approximately
"read the cryptic implementation in PostScript, figure out what it
does and implement it that way in your terminal". I hate that, but
I'll try to come through it. I'll report as soon as there will be
something functional available.)

Thanks a lot for all the help,
Mojca


On 2/13/06, Hans Hagen wrote:
> Mojca Miklavec wrote:
> > Hello,
> >
> > I have a "conversion" defined in the following way:
> >
> > \usesymbols[jmn]
> > \defineconversion
> >[gnuplot]
> >[$\bullet$,
> > $\circ$,
> > $\star$,
> > x,
> > {\symbol[navigation 1][NextJump]}]
> >
> > I would like to use these symbols in a macro
> > draw_symbol(x,y,number)
> > so that
> > draw_symbol(0,0,3)
> > would draw a star in the origin.
> >
> > The problem is that I don't know:
> > - how to use symbol sets inside MetaFun (verbatimtex \usesymbols[jmn]
> > etex doesn't work here)
> > - how to enable
> > label(btex \convertnumber{gnuplot}{5} etex, (x,y))
> >   to work properly in metafun (no luck with verbatimtex ... etex again)
> >
> > Any hints would be appreciated.
> >
>  test.tex 
>
> \starttext
>
> \startMPenvironment [global]
>
> \readfile{test-gnuplot}{}{}
>
> \stopMPenvironment
>
> \setupcolors[state=start]
>
> \startMPcode
> def the_symbol(expr n) =
> textext("\GnuPlotSymbol{" & decimal n & "}")
> enddef ;
> def draw_symbol(expr x, y, n) =
> draw the_symbol(n) shifted (x,y)
> enddef ;
>
> for i=1 upto 10 :
> draw_symbol(i*10,i*10,i) withcolor red ;
> endfor ;
> \stopMPcode
>
> \stoptext
>
>
> === test-gnuplot.tex 
>
> \defineconversion
>   [gnuplot]
>   [$\bullet$,
>$\circ$,
>$\star$,
>x,
>   {\symbol[navigation 1][NextJump]}]
>
> \unexpanded\def\GnuPlotSymbol#1%
>   {\convertnumber{gnuplot}{#1}}
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] using symbols in MetaFun

2006-02-13 Thread Hans Hagen
Taco Hoekwater wrote:
> I could not figure out how to use a 'verbatimtex' preamble either,
> so this loads the myenv definition file for each label. Ugly, but
> the best I can manage with my current knowledge.
>   
ha, we reached similar solutions -) 

the solution for the inclusion is in

\startMPenvironment
\stopMPenvironment 

when this becomes a module, one can best append the code loading to 

  \everyMPTEXgraphic

as in 

\appendtoks 
  \usemodule[...]% 
\to \everyMPTEXgraphic 

so that it will not clash with user defined environments and/or inclusions 

Hans 

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

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


Re: [NTG-context] using symbols in MetaFun

2006-02-13 Thread Hans Hagen
Mojca Miklavec wrote:
> Hello,
>
> I have a "conversion" defined in the following way:
>
> \usesymbols[jmn]
> \defineconversion
>[gnuplot]
>[$\bullet$,
> $\circ$,
> $\star$,
> x,
> {\symbol[navigation 1][NextJump]}]
>
> I would like to use these symbols in a macro
> draw_symbol(x,y,number)
> so that
> draw_symbol(0,0,3)
> would draw a star in the origin.
>
> The problem is that I don't know:
> - how to use symbol sets inside MetaFun (verbatimtex \usesymbols[jmn]
> etex doesn't work here)
> - how to enable
> label(btex \convertnumber{gnuplot}{5} etex, (x,y))
>   to work properly in metafun (no luck with verbatimtex ... etex again)
>
> Any hints would be appreciated.
>   
 test.tex  

\starttext

\startMPenvironment [global]

\readfile{test-gnuplot}{}{}

\stopMPenvironment

\setupcolors[state=start]

\startMPcode
def the_symbol(expr n) =
textext("\GnuPlotSymbol{" & decimal n & "}")
enddef ;
def draw_symbol(expr x, y, n) =
draw the_symbol(n) shifted (x,y)
enddef ;

for i=1 upto 10 :
draw_symbol(i*10,i*10,i) withcolor red ;
endfor ;
\stopMPcode

\stoptext


=== test-gnuplot.tex  

\defineconversion
  [gnuplot]
  [$\bullet$,
   $\circ$,
   $\star$,
   x,
  {\symbol[navigation 1][NextJump]}]

\unexpanded\def\GnuPlotSymbol#1%
  {\convertnumber{gnuplot}{#1}}


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

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


Re: [NTG-context] using symbols in MetaFun

2006-02-12 Thread Taco Hoekwater
Mojca Miklavec wrote:
> The problem is that I don't know:
> - how to use symbol sets inside MetaFun (verbatimtex \usesymbols[jmn]
> etex doesn't work here)
> - how to enable
> label(btex \convertnumber{gnuplot}{5} etex, (x,y))
>   to work properly in metafun (no luck with verbatimtex ... etex again)
> 
> Any hints would be appreciated.

I am very much a beginner at metafun, so the following is probably
garbage, but to its defence I can say that it actually achieves the
goal :)

There are two files:

% myenv.tex: contains the symbol definition
\usesymbols[jmn]
\defineconversion
[gnuplot]
[$\bullet$,
 $\circ$,
 $\star$,
 x,
 {\symbol[navigation 1][NextJump]}]
% end

% sym.tex: the main file
\environment myenv

\startMPinclusions
def draw_symbol(expr X, Y, Number) =
   label(textext(char 92 & "input myenv " &
 char 92 & "convertnumber{gnuplot}{" &
decimal Number & "}"),(X,Y))
enddef
\stopMPinclusions

\starttext
\startuseMPgraphic
draw_symbol(0,0,3);
\stopuseMPgraphic
\useMPgraphic
\stoptext
% end

I could not figure out how to use a 'verbatimtex' preamble either,
so this loads the myenv definition file for each label. Ugly, but
the best I can manage with my current knowledge.

Cheers,
Taco


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


[NTG-context] using symbols in MetaFun

2006-02-10 Thread Mojca Miklavec
Hello,

I have a "conversion" defined in the following way:

\usesymbols[jmn]
\defineconversion
   [gnuplot]
   [$\bullet$,
$\circ$,
$\star$,
x,
{\symbol[navigation 1][NextJump]}]

I would like to use these symbols in a macro
draw_symbol(x,y,number)
so that
draw_symbol(0,0,3)
would draw a star in the origin.

The problem is that I don't know:
- how to use symbol sets inside MetaFun (verbatimtex \usesymbols[jmn]
etex doesn't work here)
- how to enable
label(btex \convertnumber{gnuplot}{5} etex, (x,y))
  to work properly in metafun (no luck with verbatimtex ... etex again)

Any hints would be appreciated.

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


Re: [NTG-context] Metafun example doesn't work

2005-12-18 Thread Hans Hagen

Taco Hoekwater wrote:


Hi David,

To me it looks like it does work, but perhaps I am not looking
at it correctly. Here is what I compiled:

  \setupcolors[state=start]
  \setupoutput[pdftex]
  \starttext
  \startMPgraphic
  draw unitsquare
xscaled 5cm yscaled 1cm
withpen pencircle scaled 2mm
withcolor .625 red;
  \stopMPgraphic
  \hbox\bgroup
  \loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic\quad
  \loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic\egroup
  \stoptext

And I get a red outline around two rectangles next to eachother.


i will change that example (or maybe some other low level code -)

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


Re: [NTG-context] Metafun example doesn't work

2005-12-18 Thread Hans Hagen

Taco Hoekwater wrote:


David Arnold wrote:

It compiles, but the figures should not be identical according to 
the  Metafun manual, page 201.



Ah, I see now.  The second argument is dropped, because it was
assumed that it was never actually used. See the two disjunct
definitions of \insertMPfile in supp-mps.tex (the version documented
in the metafun manual) versus the one in in meta-ini.tex (the
version that is actually used).


indeed, a substantial speed optimization -)

so ... i need to change the metafun example to use scaling instead

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


Re: [NTG-context] Metafun example doesn't work

2005-12-18 Thread Taco Hoekwater

David Arnold wrote:
It compiles, but the figures should not be identical according to the  
Metafun manual, page 201.


Ah, I see now.  The second argument is dropped, because it was
assumed that it was never actually used. See the two disjunct
definitions of \insertMPfile in supp-mps.tex (the version documented
in the metafun manual) versus the one in in meta-ini.tex (the
version that is actually used).


Taco




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


Re: [NTG-context] Metafun example doesn't work

2005-12-18 Thread David Arnold
It compiles, but the figures should not be identical according to the  
Metafun manual, page 201.


On Dec 18, 2005, at 1:01 AM, Taco Hoekwater wrote:


Hi David,

To me it looks like it does work, but perhaps I am not looking
at it correctly. Here is what I compiled:

  \setupcolors[state=start]
  \setupoutput[pdftex]
  \starttext
  \startMPgraphic
  draw unitsquare
xscaled 5cm yscaled 1cm
withpen pencircle scaled 2mm
withcolor .625 red;
  \stopMPgraphic
  \hbox\bgroup
  \loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic\quad
  \loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic\egroup
  \stoptext

And I get a red outline around two rectangles next to eachother.
Does it crash for you?

Taco

David Arnold wrote:

All,
I've always wondered why this Metafun manual example doesn't work.
\startMPgraphic
  draw unitsquare
xscaled 5cm yscaled 1cm
withpen pencircle scaled 2mm
withcolor .625 red;
\stopMPgraphic
\hbox\bgroup
\loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic\quad
\loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic\egroup
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


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


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


Re: [NTG-context] Metafun example doesn't work

2005-12-18 Thread Taco Hoekwater

Hi David,

To me it looks like it does work, but perhaps I am not looking
at it correctly. Here is what I compiled:

  \setupcolors[state=start]
  \setupoutput[pdftex]
  \starttext
  \startMPgraphic
  draw unitsquare
xscaled 5cm yscaled 1cm
withpen pencircle scaled 2mm
withcolor .625 red;
  \stopMPgraphic
  \hbox\bgroup
  \loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic\quad
  \loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic\egroup
  \stoptext

And I get a red outline around two rectangles next to eachother.
Does it crash for you?

Taco

David Arnold wrote:

All,

I've always wondered why this Metafun manual example doesn't work.

\startMPgraphic
  draw unitsquare
xscaled 5cm yscaled 1cm
withpen pencircle scaled 2mm
withcolor .625 red;
\stopMPgraphic

\hbox\bgroup
\loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic\quad
\loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic\egroup
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


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


[NTG-context] Metafun example doesn't work

2005-12-17 Thread David Arnold

All,

I've always wondered why this Metafun manual example doesn't work.

\startMPgraphic
  draw unitsquare
xscaled 5cm yscaled 1cm
withpen pencircle scaled 2mm
withcolor .625 red;
\stopMPgraphic

\hbox\bgroup
\loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic\quad
\loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic\egroup
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Drawing oriented paths in MetaFun

2005-11-16 Thread Hans Hagen

Giuseppe Bilotta wrote:


Wednesday, November 16, 2005 Giuseppe Bilotta wrote:

 


Does MetaFun provide some macro to draw oriented paths? I
would like it to basically add a small arrow *in the middle*
of the path? Such a macro
   



 


draworiented somepath somespecs ;
   



 


would have to act like
   



 


drawarrow firsthalf(somepath) somespecs ;
draw secondhalf(somepath) somespecs ;
   



 


Is it available already, or should I roll my own?
   




Hm. I came up with

def draworiented expr c =
 path _c_ ; _c_ := c ;
 do_draworiented
enddef ;

def do_draworiented text t =
 draw _c_ t ;
 drawarrow subpath(0, length(_c_)/2) of _c_ ;
enddef;

which works, although I have to do

draworiented (reverse p1)

Is there an easy way to have it work with

draworiented reverse p1 ?

 

add another step (do_do_) , first pick up 'reverse p1' as expression, 
save that in a path variable, and then pick up the text


Hans

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


Re: [NTG-context] Drawing oriented paths in MetaFun

2005-11-16 Thread Hans Hagen

Giuseppe Bilotta wrote:


Does MetaFun provide some macro to draw oriented paths? I
would like it to basically add a small arrow *in the middle*
of the path? Such a macro

draworiented somepath somespecs ;

would have to act like

drawarrow firsthalf(somepath) somespecs ;
draw secondhalf(somepath) somespecs ;

Is it available already, or should I roll my own?

 


it's there; watch out, i just added a scaling option

\starttext

\setupcolors[state=start]

\startMPpage

vardef arrowheadonpath (expr p, s) =
 save autoarrows ; boolean autoarrows ; autoarrows := true ;
 set_ahlength(scaled ahfactor) ; % added
 arrowhead p if s<1 : cutafter (point (s*arclength(p)+.5ahlength) on p) fi
enddef ;

path p ; p := (0,0)--(10cm,10cm) ;

draw p withcolor red ;
ahfactor := 5 ; % default is 2.5
fill arrowheadonpath(p,.5) withcolor blue ; % try .25

currentpicture := currentpicture xsized (10cm) ;
\stopMPpage

\stoptext

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


Re[2]: [NTG-context] Drawing oriented paths in MetaFun

2005-11-16 Thread Giuseppe Bilotta
Wednesday, November 16, 2005 Giuseppe Bilotta wrote:

> Wednesday, November 16, 2005 Giuseppe Bilotta wrote:

>> Does MetaFun provide some macro to draw oriented paths? I
>> would like it to basically add a small arrow *in the middle*
>> of the path? Such a macro

>> draworiented somepath somespecs ;

>> would have to act like

>> drawarrow firsthalf(somepath) somespecs ;
>> draw secondhalf(somepath) somespecs ;

>> Is it available already, or should I roll my own?


> Hm. I came up with

> def draworiented expr c =
>   path _c_ ; _c_ := c ;
>   do_draworiented
> enddef ;

> def do_draworiented text t =
>   draw _c_ t ;
>   drawarrow subpath(0, length(_c_)/2) of _c_ ;
> enddef;
 
> which works, although I have to do

> draworiented (reverse p1)

> Is there an easy way to have it work with

> draworiented reverse p1 ?


Oh sorry it works ... however, it traces half of the curve
twice. So I came up with the next:

def draworiented expr c =
  path _c_ ; _c_ := c ;
  do_draworiented
enddef ;

def do_draworiented text t =
  drawarrow subpath(0, length(_c_)/2) of _c_ t ;
  draw subpath(length(_c_)/2, length(_c_)) of _c_ t ;
enddef;
 
This still isn't perfect, but it works. It needs a little
tuning so that the arrow is more centered, and of course it
could be improved to put the arrow at any arbitrary point on
the path.

-- 
Giuseppe "Oblomov" Bilotta

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


Re: [NTG-context] Drawing oriented paths in MetaFun

2005-11-16 Thread Giuseppe Bilotta
Wednesday, November 16, 2005 Giuseppe Bilotta wrote:

> Does MetaFun provide some macro to draw oriented paths? I
> would like it to basically add a small arrow *in the middle*
> of the path? Such a macro

> draworiented somepath somespecs ;

> would have to act like

> drawarrow firsthalf(somepath) somespecs ;
> draw secondhalf(somepath) somespecs ;

> Is it available already, or should I roll my own?


Hm. I came up with

def draworiented expr c =
  path _c_ ; _c_ := c ;
  do_draworiented
enddef ;

def do_draworiented text t =
  draw _c_ t ;
  drawarrow subpath(0, length(_c_)/2) of _c_ ;
enddef;
 
which works, although I have to do

draworiented (reverse p1)

Is there an easy way to have it work with

draworiented reverse p1 ?

-- 
Giuseppe "Oblomov" Bilotta

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


[NTG-context] Drawing oriented paths in MetaFun

2005-11-16 Thread Giuseppe Bilotta
Does MetaFun provide some macro to draw oriented paths? I
would like it to basically add a small arrow *in the middle*
of the path? Such a macro

draworiented somepath somespecs ;

would have to act like

drawarrow firsthalf(somepath) somespecs ;
draw secondhalf(somepath) somespecs ;

Is it available already, or should I roll my own?

-- 
Giuseppe "Oblomov" Bilotta

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


Re: function plotting (was: Re: [NTG-context] Q: about \externalfile from metafun-p.pdf)

2005-10-04 Thread Alexander Lazic

On Die 04.10.2005 19:48, Mojca Miklavec wrote:


I use gnuplot which makes graphs of superb visual quality and has
extensive support for many different function manipulations and weird
stuff that you want to do with it. 


I have also think on gnuplot, but wasn't sure that i can use the ps/pdf
into my context doc.


and then "\input file" inside of the main LaTeX file. Gnuplot cannot
make output in ConTeXt (yet), but perhaps you can include the resulting
PDFs in your ConTeXt source. (Gnuplot is one of the very few examples
where I still use LaTeX.) You can also output the (ConTeXt-friendly)
metapost (with set terminal), but you lose on quality.


Well i will also try with gnuplot.

How much bad is 'lose quality' in %?

greetings

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


Re: function plotting (was: Re: [NTG-context] Q: about \externalfile from metafun-p.pdf)

2005-10-04 Thread Mojca Miklavec
Alexander Lazic wrote:
> On Mon 03.10.2005 19:26, Christopher Creutzig wrote:
> >
> > MetaPost is not really a function plotter.  So, yes, you have to use
> >some sort of loop, although there may be some predefined macros hiding
> >them.
>
> Is there a better way in ConTeXt/tex for this?!
>
> Should i use some external Programms for this?
>
> al ;-)

I use gnuplot which makes graphs of superb visual quality and has
extensive support for many different function manipulations and weird
stuff that you want to do with it. I do something like:

set terminal latex
set output "file.tex"
set title '\bf My wonderful function $sin(\omega t)$'
set xlabel '$t\ \rm[s]$'
set ylabel '$A$'
plot sin(x)

and then "\input file" inside of the main LaTeX file. Gnuplot cannot
make output in ConTeXt (yet), but perhaps you can include the
resulting PDFs in your ConTeXt source. (Gnuplot is one of the very few
examples where I still use LaTeX.) You can also output the
(ConTeXt-friendly) metapost (with set terminal), but you lose on
quality.

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


function plotting (was: Re: [NTG-context] Q: about \externalfile from metafun-p.pdf)

2005-10-04 Thread Alexander Lazic

On Mon 03.10.2005 19:26, Christopher Creutzig wrote:


MetaPost is not really a function plotter.  So, yes, you have to use
some sort of loop, although there may be some predefined macros hiding
them.


Is there a better way in ConTeXt/tex for this?!

Should i use some external Programms for this?

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


Re: [NTG-context] Q: about \externalfile from metafun-p.pdf

2005-10-03 Thread Christopher Creutzig
Alexander Lazic wrote:
>>>\stopreusableMPgraphic{sin}
>>
>>This {sin} at the end is wrong; it's interpreted as text.
> 
> 
> This  have i understand ;-)
> I called it sin, sorry for confusion.

 The name is unimportant – my point is that the \stop... commands don't
get arguments.

> Thanx.
> Have i right understand, if i want to draw a sinuscurve i must use a
> for-loop?

 MetaPost is not really a function plotter.  So, yes, you have to use
some sort of loop, although there may be some predefined macros hiding them.


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


Re: [NTG-context] Q: about \externalfile from metafun-p.pdf

2005-10-03 Thread Alexander Lazic

On Son 02.10.2005 22:36, Christopher Creutzig wrote:

Alexander Lazic wrote:


2.) i have try

\startreusableMPgraphic{sin}

  sin (1);
\stopreusableMPgraphic{sin}


This {sin} at the end is wrong; it's interpreted as text.


This  have i understand ;-)
I called it sin, sorry for confusion.


What you can do is something like

   drawdot(10*x, 10*sin(x)) withpen pencircle scaled 1pt;


Thanx.
Have i right understand, if i want to draw a sinuscurve i must use a
for-loop?


I think it really helps with MP programming to understand this type of
loops.


Well i think i must learn mp before context, if i want to draw some
mathemathics functions ;-)

Thanx again for help.

greetings

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


Re: [NTG-context] Q: about \externalfile from metafun-p.pdf

2005-10-02 Thread Christopher Creutzig
Alexander Lazic wrote:
> Oh btw: i have see in the syntax-diagramm sin.
> 
> 1.) is this the sinus function?

 Sure.  (The sine function as used by mathematicians.  If you want the
sine of an angle expressed in degrees, I believe you want sind.)

> 2.) i have try
> 
> ---
> \startreusableMPgraphic{sin}
> 
>   sin (1);
> \stopreusableMPgraphic{sin}

 This {sin} at the end is wrong; it's interpreted as text.

> 
> \reuseMPgraphic{sin}
> ---
> 
> and get:
> 
> Isolated expression.
> 
> Do you know what's going wrong?

 It's the same error as trying to “plot” the MP code

 1;

MetaPost is confused since it has no idea what to do with that number
and tells you so.  Since MP can handle more than just numbers, you get a
slightly more general error message that talks about an “expression”
rather than a “number.”


 What you can do is something like

\starttext

\startusableMPgraphic{sin}
  for x := 0 step 0.6282 until 6.282:
drawdot(10*x, 10*sin(x)) withpen pencircle scaled 1pt;
  endfor
\stopusableMPgraphic

\useMPgraphic{sin}

\stoptext


Or, you can use the fact that in MetaPost you can build up an expression
within a for loop as follows:


\starttext

\startusableMPgraphic{sin}
  draw (0,0)
  for x := 0 step 0.2 until 6.282: ..(10*x, 10*sin(x)) endfor;
\stopusableMPgraphic

\useMPgraphic{sin}

\stoptext


 I think it really helps with MP programming to understand this type of
loops.


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


Re: [NTG-context] Q: about \externalfile from metafun-p.pdf

2005-10-02 Thread Alexander Lazic

On Son 02.10.2005 19:54, Christopher Creutzig wrote:


Probably a typo in metafun-p.pdf; try \externalfigure instead.


Thanx this works ;-)

Oh btw: i have see in the syntax-diagramm sin.

1.) is this the sinus function?
2.) i have try

---
\startreusableMPgraphic{sin}

 sin (1);
\stopreusableMPgraphic{sin}

\reuseMPgraphic{sin}
---

and get:

Isolated expression.

Do you know what's going wrong?

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


Re: [NTG-context] Q: about \externalfile from metafun-p.pdf

2005-10-02 Thread Christopher Creutzig
Alexander Lazic wrote:
> i'm starting to learn context and therefore i have copied some examples
> from metafun-p.pdf and get the following error:
> 
> ---
> ! Undefined control sequence.
> l.42 \externalfile
>   [mprun.21][width=5cm]

 Probably a typo in metafun-p.pdf; try \externalfigure instead.


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


[NTG-context] Q: about \externalfile from metafun-p.pdf

2005-10-02 Thread Alexander Lazic

Hi,

i'm starting to learn context and therefore i have copied some examples
from metafun-p.pdf and get the following error:

---
! Undefined control sequence.
l.42 \externalfile
 [mprun.21][width=5cm]
---
---
texexec  --version

TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

  texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
  texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
  tex : pdfeTeX, 3.141592-1.30.3-2.2 (Web2C 7.5.5)
  context : ver: 2005.07.27
  cont-en : ver: 2005.07.27  fmt: 2005.10.1  mes: english

   total run time : 2 seconds
---
The context code:

---
\language[de]

\setupcolors[state=start]
\setupoutput[pdftex]
\setuppapersize[A4][A4]

\setuppagenumbering[location={footer,right}]
\setupfootertexts[][{Seite \pagenumber{} von \totalnumberofpages}]

\starttext
% in the metapost_test is the code from page 118 => beginfig(21) ;...
\startMPrun
 input metapost_test;
\stopMPrun

\externalfile[mprun.21][width=5cm]

\showsetups
\showlayout
\stoptext
---

Please can any body help, thx.

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


Re: [NTG-context] puzzling metafun graphics

2005-09-13 Thread Hans Hagen

Thomas A. Schmitz wrote:


OK, I'm back on OS X and checked:

1. created file 01_01_01.tex with this content:
\starttext

\startuseMPgraphic{circle}

draw fullcircle scaled 10 cm ;

\stopuseMPgraphic

\useMPgraphic{circle}

\stoptext

compiled fine; circle was there.

2. copied file to 01.01.01.tex. Compilation does not give errors, but  
there is no visible output.


3. Treid setting allow_multiple_suffixes = t in texmf.cnf - no  
difference.


Puzzled

Thomas


it's a tricky thins: 

in order to determine a suffix programs/scripts assume that in 01.01.01 the last 01 is the suffix (there is no rule that tex is the suffix, it's just the built in fallback); 


someprogram 01.01.01
someprogram 01.01.01.tex 

is different. The multiple suffixes always test for a tex file first but that results in two file searches each time (slows down). 

texexec 01.01.01.tex works ok 
texexec 01.01.01 fails 

newtexexec fails in both cases (i will look into that) 


It's kind of tricky to auto append tex since nowadasy we have xml and other 
variants ..

Hans 





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

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


Re: [NTG-context] puzzling metafun graphics

2005-09-13 Thread Thomas A. Schmitz

OK, I'm back on OS X and checked:

1. created file 01_01_01.tex with this content:
\starttext

\startuseMPgraphic{circle}

draw fullcircle scaled 10 cm ;

\stopuseMPgraphic

\useMPgraphic{circle}

\stoptext

compiled fine; circle was there.

2. copied file to 01.01.01.tex. Compilation does not give errors, but  
there is no visible output.


3. Treid setting allow_multiple_suffixes = t in texmf.cnf - no  
difference.


Puzzled

Thomas


On Sep 13, 2005, at 11:26 AM, Adam Lindsay wrote:


Hang on, could this have to do with the following web2c setting?
 allow_multiple_suffixes = f

(as seen in minstall.pdf...)


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


Re: [NTG-context] puzzling metafun graphics

2005-09-13 Thread Thomas A. Schmitz
Hmm -- this is getting curioser and curioser... 
I just verified on my linux partition, and I can confirm that 
I don't have the problem there; it's only in OS X. (I'm having 
different problems with my linux install, but that'll be 
another post...). So Adam's educated guess that it must be some
 setting in a config file is more  than probably right. I'll 
keep you posted about this.

On Tue, 2005-09-13 at 10:26 +0100, Adam Lindsay wrote:
> Hans Hagen said this at Mon, 12 Sep 2005 19:38:25 +0200:
> 
> >Thomas A. Schmitz wrote:
> >
> >> OK, I'm answering my own post. The plot thickens. It looks like this  
> >> has something to do with file names. It only happens when I have a  
> >> name with a period in it.
> >>
> >> Bug or feature? You decide, Hans!
> >
> >bug; but does this mean that the old texexec works ok? 
> 
> Hang on, could this have to do with the following web2c setting?
>  allow_multiple_suffixes = f
> 
> (as seen in minstall.pdf...)

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


Re: [NTG-context] puzzling metafun graphics

2005-09-13 Thread Adam Lindsay
Hans Hagen said this at Mon, 12 Sep 2005 19:38:25 +0200:

>Thomas A. Schmitz wrote:
>
>> OK, I'm answering my own post. The plot thickens. It looks like this  
>> has something to do with file names. It only happens when I have a  
>> name with a period in it.
>>
>> Bug or feature? You decide, Hans!
>
>bug; but does this mean that the old texexec works ok? 

Hang on, could this have to do with the following web2c setting?
 allow_multiple_suffixes = f

(as seen in minstall.pdf...)
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
 Lancaster University, InfoLab21+44(0)1524/510.514
 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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


Re: [NTG-context] puzzling metafun graphics

2005-09-12 Thread Hans Hagen

Thomas A. Schmitz wrote:

Well, at least the old texexec processes the file. However, the  
problem with metafun graphics I described occurs in the old texexec  
(I'm not at all sure if the two problems are related).


can you make me a smal test file? 

Hans 


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

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


Re: [NTG-context] puzzling metafun graphics

2005-09-12 Thread Thomas A. Schmitz
Well, at least the old texexec processes the file. However, the  
problem with metafun graphics I described occurs in the old texexec  
(I'm not at all sure if the two problems are related).


Thomas

On Sep 12, 2005, at 7:38 PM, Hans Hagen wrote:


bug; but does this mean that the old texexec works ok?
Hans



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


<    5   6   7   8   9   10   11   12   >