[NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread CuriousLearn
Hi,

Is it possible to break labels in two lines if needed? 

For example, suppose I have

label.rt(textext(Do you see this label text. Quite long. Need to break it 
across lines),(3,5));

Can I have it appear in the figure as

Do you see this label text.
Quite long. Need to break 
it across lines.


Thank you in advance for your help.




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

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


Re: [NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread Aditya Mahajan

On Fri, 27 Mar 2009, CuriousLearn wrote:


Hi,

Is it possible to break labels in two lines if needed?

For example, suppose I have

label.rt(textext(Do you see this label text. Quite long. Need to break it
across lines),(3,5));


label.rt(textext(\framed[frame=no,width=5cm]{}, (3,5)) ;

Aditya



Can I have it appear in the figure as

Do you see this label text.
Quite long. Need to break
it across lines.


Thank you in advance for your help.




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

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


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

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


Re: [NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread CuriousLearn
Aditya Mahajan adityam at umich.edu writes:


  For example, suppose I have
 
  label.rt(textext(Do you see this label text. Quite long. Need to break it
  across lines),(3,5));
 
 label.rt(textext(\framed[frame=no,width=5cm]{}, (3,5)) ;
 
 Aditya
 

Thanks Aditya. Sorry but that does not work. The text line just starts shifting
to the left for me. It spills outside the frame.

I tried with both MKIV and MKII. The MKIV version I tried with is 

ConTeXt  ver: 2009.03.18 21:58 MKIV 

Any ideas why it may not be working for me? 

Thanks.

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

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


Re: [NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread Aditya Mahajan

On Fri, 27 Mar 2009, CuriousLearn wrote:


Aditya Mahajan adityam at umich.edu writes:



For example, suppose I have

label.rt(textext(Do you see this label text. Quite long. Need to break it
across lines),(3,5));


label.rt(textext(\framed[frame=no,width=5cm]{}, (3,5)) ;

Aditya



Thanks Aditya. Sorry but that does not work. The text line just starts shifting
to the left for me. It spills outside the frame.

I tried with both MKIV and MKII. The MKIV version I tried with is

ConTeXt  ver: 2009.03.18 21:58 MKIV

Any ideas why it may not be working for me?


Because I did not test before posting :)

Try \framed[align=normal, width=5cm, frame=no]{}

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

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


Re: [NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread CuriousLearn
Aditya Mahajan adityam at umich.edu writes:


 
  Any ideas why it may not be working for me?
 
 Because I did not test before posting :)
 
 Try \framed[align=normal, width=5cm, frame=no]{}
 
 Aditya

Awesome! That works great. Before asking I tried searching a lot in metafun
manual and on the web but could not find anything. I am not yet clear about the
logic. When I saw that I could color labels using the \color[red]{red} command
by putting it between btex...etex, it seemed to me that any context command
would work if put in there. So I tried \crlf to get a linebreak and that did not
work. So I thought maybe only very few specific commands work. Now after seeing
your solution, again I am wondering, what determines which commands work and
which do not. Anyhow, I am not asking for an explanation, because it will most
probably beyond me and may be a long one for someone to explain. But I
appreciate the solution.

Thanks again.


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

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


Re: [NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread Aditya Mahajan

On Sat, 28 Mar 2009, CuriousLearn wrote:


Aditya Mahajan adityam at umich.edu writes:




Any ideas why it may not be working for me?


Because I did not test before posting :)

Try \framed[align=normal, width=5cm, frame=no]{}

Aditya


Awesome! That works great. Before asking I tried searching a lot in metafun
manual and on the web but could not find anything. I am not yet clear about the
logic. When I saw that I could color labels using the \color[red]{red} command
by putting it between btex...etex, it seemed to me that any context command
would work if put in there. So I tried \crlf to get a linebreak and that did not
work. So I thought maybe only very few specific commands work. Now after seeing
your solution, again I am wondering, what determines which commands work and
which do not. Anyhow, I am not asking for an explanation, because it will most
probably beyond me and may be a long one for someone to explain. But I
appreciate the solution.


Here is a simplified picture. Basically, anything inside btex ... etex (or 
textext(...) or \sometxt{...}) is in what is known as TeX's horizontal 
mode. Think of this as what you will get if you put the same argument in a 
\hbox (see the TeXbook or TeX for the impatient for details). To get 
multiple lines you need tex to be in the vertical mode, a \vbox. A vanilla 
\framed is like a \hbox. Framed with align=normal is like a \vbox. So, for 
most purposes you can you \framed. There are some commands that need to 
know the width of the box (like \start stop formula). In those cases you 
need to specify width=something to \framed.


Of course, certain objects like floats, footnotes, marginpars, will never 
work inside metapost. (I think you can get floats and footnotes to work, 
but that will require some hackery)


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

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


Re: [NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread Wolfgang Schuster


Am 28.03.2009 um 01:33 schrieb Aditya Mahajan:

Of course, certain objects like floats, footnotes, marginpars, will  
never work inside metapost. (I think you can get floats and  
footnotes to work, but that will require some hackery)


You could use streams and local footnotes.

Wolfgang

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

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


Re: [NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread CuriousLearn
Aditya Mahajan adityam at umich.edu writes:


 Here is a simplified picture. Basically, anything inside btex ... etex (or 
 textext(...) or \sometxt{...}) is in what is known as TeX's horizontal 
 mode. Think of this as what you will get if you put the same argument in a 
 \hbox (see the TeXbook or TeX for the impatient for details). To get 
 multiple lines you need tex to be in the vertical mode, a \vbox. A vanilla 
 \framed is like a \hbox. Framed with align=normal is like a \vbox. So, for 
 most purposes you can you \framed. There are some commands that need to 
 know the width of the box (like \start stop formula). In those cases you 
 need to specify width=something to \framed.
 
 Of course, certain objects like floats, footnotes, marginpars, will never 
 work inside metapost. (I think you can get floats and footnotes to work, 
 but that will require some hackery)
 
 Aditya

Thanks very much for the explanation. Now I understand much better. I remember
reading about the importance of horizontal mode and vertical mode in the Seroul
and Levy's book I think.





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

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


Re: [NTG-context] Linebreak in Metapost/Metafun Label

2009-03-27 Thread Aditya Mahajan

On Sat, 28 Mar 2009, Wolfgang Schuster wrote:



Am 28.03.2009 um 01:33 schrieb Aditya Mahajan:

Of course, certain objects like floats, footnotes, marginpars, will never 
work inside metapost. (I think you can get floats and footnotes to work, 
but that will require some hackery)


You could use streams and local footnotes.


As always, Hans has already done the hackery.

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

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


Re: [NTG-context] Command show in Metapost/Metafun

2009-03-12 Thread Hans Hagen

Aditya Mahajan wrote:

On Thu, 12 Mar 2009, Curious Learn wrote:


Hi,

I am trying to learn Metapost using Context. I tried a few examples 
for drawing
things and they worked well. But the show command does not seem to 
work. For

example, the code

\startuseMPgraphic{GridDots}
u=1cm;
pickup pencircle scaled 8pt
for i = 0 upto 2:
for j = 0 upto 2: draw (i*u,j*u); endfor
endfor
\stopuseMPgraphic
\useMPgraphic{GridDots}

from John Hobby's manual works great.

However, the following code gives no output in the PDF file. Am I doing
something wrong?

\startuseMPgraphic{LinearEq}
  a+b = 2a - b = 3;
  show a,b;
\stopuseMPgraphic
\useMPgraphic{LinearEq}

I am using the following version from Texlive
ConTeXt  ver: 2008.05.21 15:21 MKII  fmt: 2008.10.1  int: english/english


The output of show goes to the terminal and the log file. Look for the 
values in filename-mpgraph.log.


\ctxlua{metapost.showlog = true}


-
  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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Command show in Metapost/Metafun

2009-03-12 Thread Aditya Mahajan

On Thu, 12 Mar 2009, Hans Hagen wrote:


\ctxlua{metapost.showlog = true}


Can you make this default?

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

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


[NTG-context] Command show in Metapost/Metafun

2009-03-11 Thread Curious Learn
Hi,

I am trying to learn Metapost using Context. I tried a few examples for drawing
things and they worked well. But the show command does not seem to work. For
example, the code 

\startuseMPgraphic{GridDots}
u=1cm;
pickup pencircle scaled 8pt
for i = 0 upto 2:
for j = 0 upto 2: draw (i*u,j*u); endfor
endfor 
\stopuseMPgraphic  
\useMPgraphic{GridDots}  

from John Hobby's manual works great. 

However, the following code gives no output in the PDF file. Am I doing
something wrong?

\startuseMPgraphic{LinearEq}
   a+b = 2a - b = 3;
   show a,b;
\stopuseMPgraphic  
\useMPgraphic{LinearEq}  

I am using the following version from Texlive
ConTeXt  ver: 2008.05.21 15:21 MKII  fmt: 2008.10.1  int: english/english

Thanks for your help.

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

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


[NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Thomas A. Schmitz
Hi Hans and Taco,

it looks like mplib is broken in the latest beta. Simple file:

\starttext

\startuseMPgraphic{test}
draw fullcircle scaled 5cm ;
\stopuseMPgraphic

\useMPgraphic{test}

\stoptext

produces no output. I tested on several different computers, so it  
doesn't look like a misconfiguration. My Macbook compiled the file  
fine with a context version from last week; after updating, a get an  
empty pdf.

All best

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

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


Re: [NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Hans Hagen
Thomas A. Schmitz wrote:
 Hi Hans and Taco,
 
 it looks like mplib is broken in the latest beta. Simple file:

indeed, we're experimenting with a couple of nasty bugs and in the 
process mess aroudn with beta's; sorry ...

i'll upload a new one (new bins later)

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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Thomas A. Schmitz

On May 28, 2008, at 4:33 PM, Hans Hagen wrote:

 indeed, we're experimenting with a couple of nasty bugs and in the
 process mess aroudn with beta's; sorry ...

 i'll upload a new one (new bins later)

 Hans

Hi Hans,

new beta does indeed produce output, but every MP graphic is centered  
(which doesn't look too good with my presentation backgrounds :-)

All best

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

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


Re: [NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Hans Hagen
Thomas A. Schmitz wrote:
 On May 28, 2008, at 4:33 PM, Hans Hagen wrote:
 
 indeed, we're experimenting with a couple of nasty bugs and in the
 process mess aroudn with beta's; sorry ...

 i'll upload a new one (new bins later)

 Hans
 
 Hi Hans,
 
 new beta does indeed produce output, but every MP graphic is centered  
 (which doesn't look too good with my presentation backgrounds :-)

hm i wonder why ... maybe you use raggedcenter?

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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Thomas A. Schmitz

On May 28, 2008, at 11:41 PM, Hans Hagen wrote:

 hm i wonder why ... maybe you use raggedcenter?

 Hans

Just try the minimal example I sent this afternoon and compile it with  
mkii and mkiv and you'll see the difference.

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

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


Re: [NTG-context] Weird behavior about metafun

2008-01-09 Thread Wolfgang Schuster
On Jan 8, 2008 6:04 PM, Hans Hagen [EMAIL PROTECTED] wrote:
 Zhichu Chen wrote:
  Hi,
 
  On Jan 7, 2008 11:52 PM, Aditya Mahajan [EMAIL PROTECTED] wrote:
 
 
  Something like this:
  http://www.fauskes.net/media/pgftikzexamples/PDF/todo-notes.pdf
 
  It will be nice to have a ConTeXt module that can do this.
 
 
  I've made a test file which is somewhat like what it shows, but I
  still have many problems so it's far from perfect.

 stacking is already present



 \setupcolors   [state=start]
 \definecolor   [marginback] [darkcyan]

 \startMPpositiongraphic{mypos:underline}
initialize_box(\MPpos{\MPvar{self}}) ;
path p ; p := (llxy--lrxy) shifted (0,dxy) ;
pickup pencircle scaled 1pt ;
draw p withcolor .75red ;
anchor_box(\MPanchor{\MPvar{self}}) ;
 \stopMPpositiongraphic

 \startMPpositiongraphic{mypos:ulcorner}
initialize_box(\MPpos{\MPvar{self}}) ;
path p ; p := llxy--ulxy--urxy ;
pickup pencircle scaled 1pt ;
draw p withcolor .75red ;
anchor_box(\MPanchor{\MPvar{self}}) ;
 \stopMPpositiongraphic

 \startMPpositiongraphic{mypos:torightmargin}
path pa, pb, pab ; numeric na, nb ; pair bxya, lxyb ;
initialize_box(\MPpos{\MPvar{from}}) ;
na := nxy ; pa := (llxy--lrxy) shifted (0,dxy) ; bxya := (center pa)
 - (0 , \the\baselineskip/4) ;
initialize_box(\MPpos{\MPvar{to}}) ;
nb := nxy ; lxyb := .5[llxy , ulxy] - (\the\rightmargindistance/2 ,
 0) ; pb := llxy--ulxy ;
if na=nb :
  pab := center pa -- bxya -- (xpart lxyb , ypart bxya) -- lxyb --
 center pb;
  pickup pencircle scaled 1pt ;
  draw pab withcolor transparent(1,.5,.625yellow) ;
  anchor_box(\MPanchor{\MPvar{from}}) ;
fi ;
 \stopMPpositiongraphic

 \defineoverlay [margingraphics] [\positionoverlay{margingraphics}]

 \setupbackgrounds
[page]
[background=margingraphics]

 \starttext

 \setupinmargin[stack=yes]

 \defineframedtext
  [marginframe]
  [background=color,
 %  backgroundcolor=marginback,
   offset=.25ex,
   frame=off,
   width=\the\rightmarginwidth,
   foregroundstyle=\bfx]

 \def\marginstuff#1#2%
{\doglobal\increment\currentmarginstuff
 \startpositionoverlay{margingraphics}%
% can be drawn in one graphic which is more efficient
\setMPpositiongraphic{mstuff:t\currentmarginstuff}{mypos:underline}%
\setMPpositiongraphic{mstuff:m\currentmarginstuff}{mypos:ulcorner}%

 \expanded{\setMPpositiongraphic{mstuff:t\currentmarginstuff}{mypos:torightmargin}{to=mstuff:m\currentmarginstuff}}%
 \stoppositionoverlay

 \hpos{mstuff:t\currentmarginstuff}{#1}\inright{\hpos{mstuff:m\currentmarginstuff}{\marginframe{#2

 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 This overlay can be attached to some overlay layer, like, in our
 case, the page. We define four small circles. These are drawn
 as soon as the page overlay is typeset. Because they are located
 in the background, they don't cover the text, while the lines do.
 The previous paragraph was typeset by saying:

 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 This overlay can be attached to some overlay layer, like, in our
 case, the page. We define four small circles. These are drawn
 as soon as the page overlay is typeset. Because they are located
 in the background, they don't cover the text, while the lines do.
 The previous paragraph was typeset by saying:

 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 This overlay can be attached to some overlay layer, like, in our
 case, the page. We define four small circles. These are drawn
 as soon as the page overlay is typeset. Because they are located
 in the background, they don't cover the text, while the lines do.

 The previous paragraph was typeset by saying:
 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 This overlay can be attached to some overlay layer, like, in our
 case, the page. We define four small circles. These are drawn
 as soon as the page overlay is typeset. Because they are located
 in the background, they don't cover the text, while the lines do.
 The previous paragraph was typeset by saying:

 \stoptext

Hi Hans,

could you wrap this into a macro to define different commands
for marginstuff, could be usefull to write margintexts for more
users in different colors etc.

For example:

\definecomment[chen][color=blue,frame=on|off,...]
\definecomment[hans][color=red,frame=on|off,...]

\starttext

The previous paragraph was typeset 

Re: [NTG-context] Weird behavior about metafun

2008-01-08 Thread Zhichu Chen
Hi,

On Jan 7, 2008 11:52 PM, Aditya Mahajan [EMAIL PROTECTED] wrote:



 Something like this:
 http://www.fauskes.net/media/pgftikzexamples/PDF/todo-notes.pdf

 It will be nice to have a ConTeXt module that can do this.


I've made a test file which is somewhat like what it shows, but I
still have many problems so it's far from perfect.




 Aditya

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

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

 ___




-- 
Best Regards
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn



FancyMarginTest.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Weird behavior about metafun

2008-01-08 Thread Arthur Reutenauer
 I've made a test file which is somewhat like what it shows, but I
 still have many problems so it's far from perfect.

  Could you still make the test file available?

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

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


Re: [NTG-context] Weird behavior about metafun

2008-01-08 Thread Hans Hagen
Zhichu Chen wrote:
 Hi,
 
 On Jan 7, 2008 11:52 PM, Aditya Mahajan [EMAIL PROTECTED] wrote:
 

 Something like this:
 http://www.fauskes.net/media/pgftikzexamples/PDF/todo-notes.pdf

 It will be nice to have a ConTeXt module that can do this.
 
 
 I've made a test file which is somewhat like what it shows, but I
 still have many problems so it's far from perfect.

stacking is already present



\setupcolors   [state=start]
\definecolor   [marginback] [darkcyan]

\startMPpositiongraphic{mypos:underline}
   initialize_box(\MPpos{\MPvar{self}}) ;
   path p ; p := (llxy--lrxy) shifted (0,dxy) ;
   pickup pencircle scaled 1pt ;
   draw p withcolor .75red ;
   anchor_box(\MPanchor{\MPvar{self}}) ;
\stopMPpositiongraphic

\startMPpositiongraphic{mypos:ulcorner}
   initialize_box(\MPpos{\MPvar{self}}) ;
   path p ; p := llxy--ulxy--urxy ;
   pickup pencircle scaled 1pt ;
   draw p withcolor .75red ;
   anchor_box(\MPanchor{\MPvar{self}}) ;
\stopMPpositiongraphic

\startMPpositiongraphic{mypos:torightmargin}
   path pa, pb, pab ; numeric na, nb ; pair bxya, lxyb ;
   initialize_box(\MPpos{\MPvar{from}}) ;
   na := nxy ; pa := (llxy--lrxy) shifted (0,dxy) ; bxya := (center pa) 
- (0 , \the\baselineskip/4) ;
   initialize_box(\MPpos{\MPvar{to}}) ;
   nb := nxy ; lxyb := .5[llxy , ulxy] - (\the\rightmargindistance/2 , 
0) ; pb := llxy--ulxy ;
   if na=nb :
 pab := center pa -- bxya -- (xpart lxyb , ypart bxya) -- lxyb -- 
center pb;
 pickup pencircle scaled 1pt ;
 draw pab withcolor transparent(1,.5,.625yellow) ;
 anchor_box(\MPanchor{\MPvar{from}}) ;
   fi ;
\stopMPpositiongraphic

\defineoverlay [margingraphics] [\positionoverlay{margingraphics}]

\setupbackgrounds
   [page]
   [background=margingraphics]

\starttext

\setupinmargin[stack=yes]

\defineframedtext
 [marginframe]
 [background=color,
%  backgroundcolor=marginback,
  offset=.25ex,
  frame=off,
  width=\the\rightmarginwidth,
  foregroundstyle=\bfx]

\def\marginstuff#1#2%
   {\doglobal\increment\currentmarginstuff
\startpositionoverlay{margingraphics}%
   % can be drawn in one graphic which is more efficient
   \setMPpositiongraphic{mstuff:t\currentmarginstuff}{mypos:underline}%
   \setMPpositiongraphic{mstuff:m\currentmarginstuff}{mypos:ulcorner}%
 
\expanded{\setMPpositiongraphic{mstuff:t\currentmarginstuff}{mypos:torightmargin}{to=mstuff:m\currentmarginstuff}}%
\stoppositionoverlay
 
\hpos{mstuff:t\currentmarginstuff}{#1}\inright{\hpos{mstuff:m\currentmarginstuff}{\marginframe{#2

First we have defined an \marginstuff {overlay}
{Just a test in a margin that could be multiple lines.}.
This overlay can be attached to some overlay layer, like, in our
case, the page. We define four small circles. These are drawn
as soon as the page overlay is typeset. Because they are located
in the background, they don't cover the text, while the lines do.
The previous paragraph was typeset by saying:

First we have defined an \marginstuff {overlay}
{Just a test in a margin that could be multiple lines.}.
First we have defined an \marginstuff {overlay}
{Just a test in a margin that could be multiple lines.}.
This overlay can be attached to some overlay layer, like, in our
case, the page. We define four small circles. These are drawn
as soon as the page overlay is typeset. Because they are located
in the background, they don't cover the text, while the lines do.
The previous paragraph was typeset by saying:

First we have defined an \marginstuff {overlay}
{Just a test in a margin that could be multiple lines.}.
First we have defined an \marginstuff {overlay}
{Just a test in a margin that could be multiple lines.}.
This overlay can be attached to some overlay layer, like, in our
case, the page. We define four small circles. These are drawn
as soon as the page overlay is typeset. Because they are located
in the background, they don't cover the text, while the lines do.

The previous paragraph was typeset by saying:
First we have defined an \marginstuff {overlay}
{Just a test in a margin that could be multiple lines.}.
First we have defined an \marginstuff {overlay}
{Just a test in a margin that could be multiple lines.}.
This overlay can be attached to some overlay layer, like, in our
case, the page. We define four small circles. These are drawn
as soon as the page overlay is typeset. Because they are located
in the background, they don't cover the text, while the lines do.
The previous paragraph was typeset by saying:

\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
-
___
If 

Re: [NTG-context] Weird behavior about metafun

2008-01-08 Thread Zhichu Chen
Pretty cool! I knew ConTeXt can do it and thank you Hans
for teaching me so much.

Hi Arthur, I'm suffering a network problem so sometimes
mails may no be delivered correctly. But ignore my test
file and get Hans' one.

On Jan 9, 2008 1:04 AM, Hans Hagen [EMAIL PROTECTED] wrote:

 Zhichu Chen wrote:
  Hi,
 
  On Jan 7, 2008 11:52 PM, Aditya Mahajan [EMAIL PROTECTED] wrote:
 
 
  Something like this:
  http://www.fauskes.net/media/pgftikzexamples/PDF/todo-notes.pdf
 
  It will be nice to have a ConTeXt module that can do this.
 
 
  I've made a test file which is somewhat like what it shows, but I
  still have many problems so it's far from perfect.

 stacking is already present



 \setupcolors   [state=start]
 \definecolor   [marginback] [darkcyan]

 \startMPpositiongraphic{mypos:underline}
   initialize_box(\MPpos{\MPvar{self}}) ;
   path p ; p := (llxy--lrxy) shifted (0,dxy) ;
   pickup pencircle scaled 1pt ;
   draw p withcolor .75red ;
   anchor_box(\MPanchor{\MPvar{self}}) ;
 \stopMPpositiongraphic

 \startMPpositiongraphic{mypos:ulcorner}
   initialize_box(\MPpos{\MPvar{self}}) ;
   path p ; p := llxy--ulxy--urxy ;
   pickup pencircle scaled 1pt ;
   draw p withcolor .75red ;
   anchor_box(\MPanchor{\MPvar{self}}) ;
 \stopMPpositiongraphic

 \startMPpositiongraphic{mypos:torightmargin}
   path pa, pb, pab ; numeric na, nb ; pair bxya, lxyb ;
   initialize_box(\MPpos{\MPvar{from}}) ;
   na := nxy ; pa := (llxy--lrxy) shifted (0,dxy) ; bxya := (center pa)
 - (0 , \the\baselineskip/4) ;
   initialize_box(\MPpos{\MPvar{to}}) ;
   nb := nxy ; lxyb := .5[llxy , ulxy] - (\the\rightmargindistance/2 ,
 0) ; pb := llxy--ulxy ;
   if na=nb :
 pab := center pa -- bxya -- (xpart lxyb , ypart bxya) -- lxyb --
 center pb;
 pickup pencircle scaled 1pt ;
 draw pab withcolor transparent(1,.5,.625yellow) ;
 anchor_box(\MPanchor{\MPvar{from}}) ;
   fi ;
 \stopMPpositiongraphic

 \defineoverlay [margingraphics] [\positionoverlay{margingraphics}]

 \setupbackgrounds
   [page]
   [background=margingraphics]

 \starttext

 \setupinmargin[stack=yes]

 \defineframedtext
 [marginframe]
 [background=color,
 %  backgroundcolor=marginback,
  offset=.25ex,
  frame=off,
  width=\the\rightmarginwidth,
  foregroundstyle=\bfx]

 \def\marginstuff#1#2%
   {\doglobal\increment\currentmarginstuff
\startpositionoverlay{margingraphics}%
   % can be drawn in one graphic which is more efficient
   \setMPpositiongraphic{mstuff:t\currentmarginstuff}{mypos:underline}%
   \setMPpositiongraphic{mstuff:m\currentmarginstuff}{mypos:ulcorner}%


 \expanded{\setMPpositiongraphic{mstuff:t\currentmarginstuff}{mypos:torightmargin}{to=mstuff:m\currentmarginstuff}}%
\stoppositionoverlay


 \hpos{mstuff:t\currentmarginstuff}{#1}\inright{\hpos{mstuff:m\currentmarginstuff}{\marginframe{#2

 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 This overlay can be attached to some overlay layer, like, in our
 case, the page. We define four small circles. These are drawn
 as soon as the page overlay is typeset. Because they are located
 in the background, they don't cover the text, while the lines do.
 The previous paragraph was typeset by saying:

 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 This overlay can be attached to some overlay layer, like, in our
 case, the page. We define four small circles. These are drawn
 as soon as the page overlay is typeset. Because they are located
 in the background, they don't cover the text, while the lines do.
 The previous paragraph was typeset by saying:

 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 This overlay can be attached to some overlay layer, like, in our
 case, the page. We define four small circles. These are drawn
 as soon as the page overlay is typeset. Because they are located
 in the background, they don't cover the text, while the lines do.

 The previous paragraph was typeset by saying:
 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 First we have defined an \marginstuff {overlay}
 {Just a test in a margin that could be multiple lines.}.
 This overlay can be attached to some overlay layer, like, in our
 case, the page. We define four small circles. These are drawn
 as soon as the page overlay is typeset. Because they are located
 in the background, they don't cover the text, while the lines do.
 The previous paragraph was typeset by saying:

 \stoptext


 -
   Hans Hagen | PRAGMA ADE

[NTG-context] Weird behavior about metafun

2008-01-07 Thread Zhichu Chen
Hi Hans and Wolfgang,

I'm just trying to make some illustrations about the Chinese typesetting
features. So I choose the way which is described in Chapter 5 of the metafun
manual. And I wanna draw a line from the text I wanna comment on to the
marginal notes which my comments lay on.

To highlight them, I drew an underline below the contexts which is to be
commented
and put a square around the comments. Everything is under control except
I put \fpos and \tpos around the comments, the framed box is not exactly
what
I want. It seems that metafun still thought it's in the main text so it drew
the bounding
around the body.

I found the mpos:par was defined in core-pgr.tex and it used show_par or
draw_par which
are defined in mp-core.mp. I don't think it's a good way to define another
MPpositiongraphic
called like mpos:marginpar to match my case. Do you think it's possible to
change
some of the core codes to make metafun recognize where she is.


-- 
Best Regards
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn

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

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


Re: [NTG-context] Weird behavior about metafun

2008-01-07 Thread Hans Hagen
Zhichu Chen wrote:
 Oh, by the way, if I put \fpos at the beginning of a paragraph,
 it adds an extra blank line. I have to force it to the
 horizontal mode like:
 \leavevmode\fpos{A-1} . . . \tpos{A-1}

\dontleavehmode \fpos ...

 So is it safe to change the definition of \fpos to add
 \leavevmode at the beginning of the macro?

no, that could happen in the macro that uses \fpos, not in \fpos itself

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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Weird behavior about metafun

2008-01-07 Thread Zhichu Chen
Oh, by the way, if I put \fpos at the beginning of a paragraph,
it adds an extra blank line. I have to force it to the
horizontal mode like:
\leavevmode\fpos{A-1} . . . \tpos{A-1}
So is it safe to change the definition of \fpos to add
\leavevmode at the beginning of the macro?


On Jan 7, 2008 10:45 AM, Zhichu Chen [EMAIL PROTECTED] wrote:

 Hi Hans and Wolfgang,

 I'm just trying to make some illustrations about the Chinese typesetting
 features. So I choose the way which is described in Chapter 5 of the
 metafun
 manual. And I wanna draw a line from the text I wanna comment on to the
 marginal notes which my comments lay on.

 To highlight them, I drew an underline below the contexts which is to be
 commented
 and put a square around the comments. Everything is under control except
 I put \fpos and \tpos around the comments, the framed box is not exactly
 what
 I want. It seems that metafun still thought it's in the main text so it
 drew the bounding
 around the body.

 I found the mpos:par was defined in core-pgr.tex and it used show_par or
 draw_par which
 are defined in mp-core.mp. I don't think it's a good way to define another
 MPpositiongraphic
 called like mpos:marginpar to match my case. Do you think it's possible to
 change
 some of the core codes to make metafun recognize where she is.


 --
 Best Regards
 Chen
 

  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn
 




-- 
Best Regards
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn

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

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


Re: [NTG-context] Weird behavior about metafun

2008-01-07 Thread Zhichu Chen
On Jan 7, 2008 9:41 PM, Hans Hagen [EMAIL PROTECTED] wrote:

 Zhichu Chen wrote:
  Oh, by the way, if I put \fpos at the beginning of a paragraph,
  it adds an extra blank line. I have to force it to the
  horizontal mode like:
  \leavevmode\fpos{A-1} . . . \tpos{A-1}

 \dontleavehmode \fpos ...

  So is it safe to change the definition of \fpos to add
  \leavevmode at the beginning of the macro?

 no, that could happen in the macro that uses \fpos, not in \fpos itself

Cool, then I'll define my own macro to do that.

Thanks.



 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
 -

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

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

 ___




-- 
Best Regards
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn

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

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


Re: [NTG-context] Weird behavior about metafun

2008-01-07 Thread Aditya Mahajan
On Mon, 7 Jan 2008, Zhichu Chen wrote:

 Hi Hans and Wolfgang,

 I'm just trying to make some illustrations about the Chinese typesetting
 features. So I choose the way which is described in Chapter 5 of the metafun
 manual. And I wanna draw a line from the text I wanna comment on to the
 marginal notes which my comments lay on.

Something like this:
http://www.fauskes.net/media/pgftikzexamples/PDF/todo-notes.pdf

It will be nice to have a ConTeXt module that can do this.

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

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


Re: [NTG-context] Weird behavior about metafun

2008-01-07 Thread Zhichu Chen
On Jan 7, 2008 11:52 PM, Aditya Mahajan [EMAIL PROTECTED] wrote:

 On Mon, 7 Jan 2008, Zhichu Chen wrote:

  Hi Hans and Wolfgang,
 
  I'm just trying to make some illustrations about the Chinese typesetting
  features. So I choose the way which is described in Chapter 5 of the
 metafun
  manual. And I wanna draw a line from the text I wanna comment on to the
  marginal notes which my comments lay on.

 Something like this:
 http://www.fauskes.net/media/pgftikzexamples/PDF/todo-notes.pdf


Yes! That's what I'm trying to do. I think there's a chance
to implement that with few modifications on the existing
core-pgr.tex and mp-core.mp.


 http://www.fauskes.net/media/pgftikzexamples/PDF/todo-notes.pdf

 It will be nice to have a ConTeXt module that can do this.

 Aditya

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

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

 ___




-- 
Best Regards
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn

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

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


Re: [NTG-context] MathML in Metafun

2007-11-03 Thread Wolfgang Schuster
2007/11/2, Maurí­cio [EMAIL PROTECTED]:

  Is it possible to use MathML inside
  a Metapost or Metafun label?
 
  I'm not 100% sure, but \sometxt{... your ConTeXt stuff with mathml
  here ...} could work.

 It seems a good idea. But, actually, I should have learned
 how to insert MathML in Context in the first place. Do
 you know a good doc on that? I can find hundreds of MathML
 examples in the wiki, but none of them are inside Context
 documents.

 Thanks,
 Maurício


Hans wrote 2 Manuals for MathML.

http://pragma-ade.nl/show-man-16.htm

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

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


Re: [NTG-context] MathML in Metafun

2007-11-02 Thread Mojca Miklavec
On 11/1/07, Maurí­cio wrote:
 Hi,

 Is it possible to use MathML inside
 a Metapost or Metafun label?

I'm not 100% sure, but \sometxt{... your ConTeXt stuff with mathml
here ...} could work.
Or, I could imagine that you should be able to defne some commant, so that
\sometxt[mathml]{..mathml stuff/..} could work out of the box.

See
http://dl.contextgarden.net/myway/sometxt.pdf

However, I have never played with mathml, so you should try it out and
report if there will be any problems.

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

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


Re: [NTG-context] MathML in Metafun

2007-11-02 Thread Maurí­cio
 Is it possible to use MathML inside
 a Metapost or Metafun label?
 
 I'm not 100% sure, but \sometxt{... your ConTeXt stuff with mathml
 here ...} could work.

It seems a good idea. But, actually, I should have learned
how to insert MathML in Context in the first place. Do
you know a good doc on that? I can find hundreds of MathML
examples in the wiki, but none of them are inside Context
documents.

Thanks,
Maurício

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

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


[NTG-context] MathML in Metafun

2007-11-01 Thread Maurí­cio
Hi,

Is it possible to use MathML inside
a Metapost or Metafun label?

Thanks,
Maurício

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

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


[NTG-context] MetaFun and different body font size

2007-08-20 Thread Oliver Buerschaper
Dear folks,

I'm wondering how to communicate a different default bodyfont size to  
MetaFun ... consider this:

---

\setupbodyfont[32pt]


\starttext

\input ward

\startuseMPgraphic{test}
draw unitsquare scaled BodyFontSize;
draw textext.rt(Test);
draw btex \TeX etex xshifted 2*BodyFontSize;
\stopuseMPgraphic
\useMPgraphic{test}

\stoptext

---

Somehow MetaFun doesn't recognize the larger body font size :-( What  
can I do?

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

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


Re: [NTG-context] MetaFun and different body font size

2007-08-20 Thread Oliver Buerschaper
 Somehow MetaFun doesn't recognize the larger body font size :-(

By the way, font face changes aren't reflected either ...

---

\usetypescript[palatino][\defaultencoding]

\setupbodyfont[palatino,32pt]


\starttext

\input ward

\startuseMPgraphic{test}
draw unitsquare scaled BodyFontSize;
draw textext.rt(Test);
draw btex \TeX etex xshifted 2*BodyFontSize;
\stopuseMPgraphic
\useMPgraphic{test}

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

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


Re: [NTG-context] MetaFun and different body font size

2007-08-20 Thread Wolfgang Schuster
2007/8/20, Oliver Buerschaper [EMAIL PROTECTED]:
  Somehow MetaFun doesn't recognize the larger body font size :-(

 By the way, font face changes aren't reflected either ...

 ---

 \usetypescript[palatino][\defaultencoding]

 \setupbodyfont[palatino,32pt]


 \starttext

 \input ward

 \startuseMPgraphic{test}
 draw unitsquare scaled BodyFontSize;
 draw textext.rt(Test);
 draw btex \TeX etex xshifted 2*BodyFontSize;
 \stopuseMPgraphic
 \useMPgraphic{test}

 \stoptext

Did this work for you

\startMPenvironment
\usetypescript[palatino][texnansi]
\switchtobodyfont[palatino,20pt]
\stopMPenvironment

\usetypescript[palatino][texnansi]
\setupbodyfont[palatino,20pt]

\starttext
Text

\startuseMPgraphic
label(Text,origin) ;
\stopuseMPgraphic
\useMPgraphic
\stoptext

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

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


Re: [NTG-context] MetaFun and different body font size

2007-08-20 Thread Peter Rolf
Oliver Buerschaper schrieb:
 Dear folks,
 
 I'm wondering how to communicate a different default bodyfont size to  
 MetaFun ... consider this:
 
 ---
 
 \setupbodyfont[32pt]
 
 
 \starttext
 
 \input ward
 
 \startuseMPgraphic{test}
   draw unitsquare scaled BodyFontSize;
   draw textext.rt(Test);
   draw btex \TeX etex xshifted 2*BodyFontSize;
 \stopuseMPgraphic
 \useMPgraphic{test}
 
 \stoptext
 
 ---
 
 Somehow MetaFun doesn't recognize the larger body font size :-( What  
 can I do?

Hi Oliver,

see

http://wiki.contextgarden.net/Mpgraphic#.5CstartMPenvironment

You can use one of the options [global|+|reset].

'global' and '+' are also setting the env in the main doc (one font def
for all), 'reset' brings the environment back to it's defaults (s.
meta-ini.tex).


Best wishes, Peter


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

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

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


[NTG-context] Mysterious clipping for shaded MetaFun page background

2007-08-20 Thread Oliver Buerschaper
Dear folks,

can anyone reproduce this? (Live ConTeXt on the garden seems to run  
into this \faststartcolor thing ... with pdfTeX.)

Uncomment the page background overlay and the top bit of the frames'  
titles will be chipped off ... doesn't happen for the plain vanilla  
color background on my machine.

---

\enableregime[utf]

\setupcolors[state=start]

\usetypescript[palatino][\defaultencoding]
\setupbodyfont[palatino,30pt]

\startMPenvironment
\usetypescript[palatino][\defaultencoding]
\switchtobodyfont[palatino,30pt]
\stopMPenvironment

\startuseMPgraphic{FunnyFrame}
picture pic;
path a,b;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight);
pic := textext(\MPstring{FunnyFrame});
setbounds pic to (boundingbox pic) enlarged (BodyFontSize/5);
pic := pic shifted (OverlayWidth/2,OverlayHeight+(ypart ulcorner  
pic)/2);
drawoptions(withpen pencircle scaled OverlayLineWidth withcolor  
OverlayLineColor);
b := a topenlarged (ypart center pic-OverlayHeight);
b := b smoothed BodyFontSize;
fill b withcolor white;
draw b;
b := (boundingbox pic) smoothed (BodyFontSize/2);
fill b withcolor yellow;
draw b;
draw pic withcolor black;
setbounds currentpicture to a;
\stopuseMPgraphic

\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext
[FunnyText]
[background=FunnyFrame,
 frame=off,
 rulethickness=3pt,
 width=\textwidth]

\def\startFrame#1{%
\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}%
\startFunnyText}
\def\stopFrame{\stopFunnyText}

\startuniqueMPgraphic{shade}
path p;
p := unitsquare xyscaled (OverlayWidth,OverlayHeight);
linear_shade(p,6,blue,white);
\stopuniqueMPgraphic
\defineoverlay[shade][\useMPgraphic{shade}]

%\setupbackgrounds
%   [page]
%   [background=shade]

%\setupbackgrounds
%   [page]
%   [background=color,
%backgroundcolor=blue]

\noheaderandfooterlines


\starttext

\showframe

\startFrame{Test 1}
The quick brown fox jumps over the lazy dog.
\stopFrame

\startFrame{Test 2}
The quick brown fox jumps over the lazy dog.
\stopFrame

\stoptext

---

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

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


Re: [NTG-context] Mysterious clipping for shaded MetaFun page background

2007-08-20 Thread Peter Rolf
Oliver Buerschaper schrieb:
 Dear folks,
 
 can anyone reproduce this? (Live ConTeXt on the garden seems to run  
 into this \faststartcolor thing ... with pdfTeX.)

 Uncomment the page background overlay and the top bit of the frames'  
 titles will be chipped off ... doesn't happen for the plain vanilla  
 color background on my machine.
 
 ---
 
 \enableregime[utf]
 
 \setupcolors[state=start]
 
del
 \usetypescript[palatino][\defaultencoding]
 \setupbodyfont[palatino,30pt]
/del
 
 \startMPenvironment
[global]
   \usetypescript[palatino][\defaultencoding]
   \switchtobodyfont[palatino,30pt]
 \stopMPenvironment
   
 \startuseMPgraphic{FunnyFrame}
   picture pic;
   path a,b;
   a := unitsquare xyscaled (OverlayWidth,OverlayHeight);

% = OverlayBox

   pic := textext(\MPstring{FunnyFrame});
   setbounds pic to (boundingbox pic) enlarged (BodyFontSize/5);
   pic := pic shifted (OverlayWidth/2,OverlayHeight+(ypart ulcorner  
 pic)/2);
   drawoptions(withpen pencircle scaled OverlayLineWidth withcolor  
 OverlayLineColor);
   b := a topenlarged (ypart center pic-OverlayHeight);
   b := b smoothed BodyFontSize;
   fill b withcolor white;
   draw b;

% there is filldraw

   b := (boundingbox pic) smoothed (BodyFontSize/2);
   fill b withcolor yellow;
   draw b;
   draw pic withcolor black;
   setbounds currentpicture to a;

draw boundingbox currentpicture withcolor red;

 \stopuseMPgraphic


the boundingbox sets the final size of the gfx. if your gfx is larger
than the bb, things will overlap. just enlarge the bb, so that it fits
the gfx.


Peter


 \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
 \defineframedtext
   [FunnyText]
   [background=FunnyFrame,
frame=off,
rulethickness=3pt,
width=\textwidth]
 
 \def\startFrame#1{%
   \setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}%
   \startFunnyText}
 \def\stopFrame{\stopFunnyText}
 
 \startuniqueMPgraphic{shade}
   path p;
   p := unitsquare xyscaled (OverlayWidth,OverlayHeight);
   linear_shade(p,6,blue,white);
 \stopuniqueMPgraphic
 \defineoverlay[shade][\useMPgraphic{shade}]
 
 %\setupbackgrounds
 % [page]
 % [background=shade]
 
 %\setupbackgrounds
 % [page]
 % [background=color,
 %  backgroundcolor=blue]
   
 \noheaderandfooterlines
 
 
 \starttext
   
   \showframe
   
   \startFrame{Test 1}
   The quick brown fox jumps over the lazy dog.
   \stopFrame
   
   \startFrame{Test 2}
   The quick brown fox jumps over the lazy dog.
   \stopFrame
 
 \stoptext
 
 ---
 
 Cheerio,
 Oliver
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___
 

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

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


Re: [NTG-context] Mysterious clipping for shaded MetaFun page background

2007-08-20 Thread Hans Hagen
Peter Rolf wrote:
 Oliver Buerschaper schrieb:
 Dear folks,

 can anyone reproduce this? (Live ConTeXt on the garden seems to run  
 into this \faststartcolor thing ... with pdfTeX.)

it may help to increase

\def\objectoffset{1cm}

(by default reused objects clip and this creates a virtual bbox)


-
   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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] MetaFun and different body font size

2007-08-20 Thread Mojca Miklavec
On 8/20/07, Oliver Buerschaper wrote:
 Dear folks,

 I'm wondering how to communicate a different default bodyfont size to
 MetaFun ... consider this:

 ---

 \setupbodyfont[32pt]


 \starttext

 \input ward

 \startuseMPgraphic{test}
 draw unitsquare scaled BodyFontSize;
 draw textext.rt(Test);
 draw btex \TeX etex xshifted 2*BodyFontSize;
 \stopuseMPgraphic
 \useMPgraphic{test}

 \stoptext

 ---

 Somehow MetaFun doesn't recognize the larger body font size :-( What
 can I do?

There's one solutions which is far better  faster  more efficient 
more obedient: use \sometxt instead of btex ... etex and/or instead of
textext(...):

\startuseMPgraphic{test}
   draw unitsquare scaled BodyFontSize;
   label.rt(\sometxt{Test}, origin);
   draw \sometxt{\TeX} xshifted 2*BodyFontSize;
\stopuseMPgraphic
\useMPgraphic{test}

See http://dl.contextgarden.net/myway/sometxt.pdf

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

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


Re: [NTG-context] frames in ConTeXt and metafun

2007-07-13 Thread Thomas A. Schmitz
On Thu, 12 Jul 2007

 On Thu, 12 Jul 2007, Thomas A. Schmitz wrote:
 
 On Jul 12, 2007, at 10:04 AM, Peter Rolf wrote:

  sure (see attachment).
 
 Thanks so much Peter! THis looks MUCH better. The more I use metafun,
 the more I love it.
 
 Hello,
 
 Did you take a look at the result with xpdf? There seems to be a problem
 somewhere. But it looks very nice with acroread, indeed!
 
 Cheers, Peter

Yes you're right, I just looked at it on my linux box (usually I use OS 
X). The result is bizarre both in xpdf and in evince (there is no 
acroread for powerpc, shame on adobe!). But this seems to be merely an 
error in the viewer; I have often found the linux pdf viewers to be 
extremely inferior to what I get in OS X; one of the reasons why I will 
not be able to switch to linux anytime soom.

Best

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

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


[NTG-context] frames in ConTeXt and metafun

2007-07-12 Thread Thomas A. Schmitz
This is a very small cosmetic problem, but it bugs me: I'm preparing  
a background for a presentation, and I want a frame with a  
transparent color to appear on every slide, so I define an overlay  
and use metapost. I also want to frame some text elements, so I use a  
\framed. The problem is that in the \framed, the lines of the frame  
overlap at the edges, so with a transparent color, the corners are  
slightly darker. The minimal example below shows the problem. Any  
solution? Is it possible to have the frame around \framed drawn by  
metapost?

Thanks!

Thomas


% MINIMAL EXAMPLE %%

\setupcolors[state=start]

\definecolor [MyFrameColor][b=.55, t=.5, a=1]

\starttext

\startuseMPgraphic{fancyframe}
draw unitsquare
xyscaled(8cm,8cm)
withpen pencircle scaled 4pt
withcolor \MPcolor{MyFrameColor} ;
\stopuseMPgraphic

\useMPgraphic{fancyframe}

\framed 
[rulethickness=4pt,framecolor=MyFrameColor,height=8cm,width=8cm]{\strut}

\stoptext

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

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


Re: [NTG-context] frames in ConTeXt and metafun

2007-07-12 Thread Peter Rolf
Hi Thomas,

Thomas A. Schmitz schrieb:
 This is a very small cosmetic problem, but it bugs me: I'm preparing  
 a background for a presentation, and I want a frame with a  
 transparent color to appear on every slide, so I define an overlay  
 and use metapost. I also want to frame some text elements, so I use a  
 \framed. The problem is that in the \framed, the lines of the frame  
 overlap at the edges, so with a transparent color, the corners are  
 slightly darker. The minimal example below shows the problem. Any  
 solution? Is it possible to have the frame around \framed drawn by  
 metapost?

sure (see attachment).

Greetings, Peter

 Thanks!
 
 Thomas
 
 
 % MINIMAL EXAMPLE %%
 
 \setupcolors[state=start]
 
 \definecolor [MyFrameColor][b=.55, t=.5, a=1]
 
 \starttext
 
 \startuseMPgraphic{fancyframe}
 draw unitsquare
 xyscaled(8cm,8cm)
 withpen pencircle scaled 4pt
 withcolor \MPcolor{MyFrameColor} ;
 \stopuseMPgraphic
 
 \useMPgraphic{fancyframe}
 
 \framed 
 [rulethickness=4pt,framecolor=MyFrameColor,height=8cm,width=8cm]{\strut}
 
 \stoptext
 
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___
 

\setupcolors[state=start]

\definecolor [MyFrameColor][b=.55, t=.5, a=1]


\startuniqueMPgraphic{fancyframe}{linewidth,radius,color}
begingroup
  save c, lw ;
  color c ; c:= \MPvar{color} ;
  lw:= \MPvar{linewidth} ;
  
  draw unitsquare xyscaled(OverlayWidth-lw,OverlayHeight-lw)
  smoothed \MPvar{radius}
  withpen pencircle scaled lw
  withcolor c ;
endgroup ;
\stopuniqueMPgraphic

\defineoverlay[fancyframe]
  [\uniqueMPgraphic{fancyframe}{linewidth=4pt,radius=5pt,color=MyFrameColor}]

\presetlocalframed[fancy]
\setuplocalframed[fancy]
  [frame=off,background=fancyframe]



\starttext

\framed 
[rulethickness=4pt,framecolor=MyFrameColor,height=8cm,width=8cm]{}

\localframed[fancy]
[height=8cm,width=8cm]{}

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

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


Re: [NTG-context] frames in ConTeXt and metafun

2007-07-12 Thread Thomas A. Schmitz

On Jul 12, 2007, at 10:04 AM, Peter Rolf wrote:

 Hi Thomas,
 sure (see attachment).

 Greetings, Peter

Thanks so much Peter! THis looks MUCH better. The more I use metafun,  
the more I love it.

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

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


Re: [NTG-context] frames in ConTeXt and metafun

2007-07-12 Thread Peter Münster
On Thu, 12 Jul 2007, Thomas A. Schmitz wrote:

 On Jul 12, 2007, at 10:04 AM, Peter Rolf wrote:
 
  sure (see attachment).
 
 Thanks so much Peter! THis looks MUCH better. The more I use metafun,  
 the more I love it.

Hello,

Did you take a look at the result with xpdf? There seems to be a problem
somewhere. But it looks very nice with acroread, indeed!

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] metafun externalfigure macro with xetex

2007-07-10 Thread Lutz Haseloff

Hi all,

if i use the metafun macro externalfigure with xetex, there is a printed
number
(first externafigure prints a 1, the second a 2 right after the 1 and
so on)
in the lower left corner of the picture;  the picture itself is shifted to
the upper right,
out of the bounding box.
I have this effect with xetex 996p1, 997-dev, ConTeXt 17.04.07and the newest
beta.
Pdftex in this case works wery well.

Is this a Bug in Xetex or in ConTeXt?

Greetings

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

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


[NTG-context] metafun externalfigure macro with xetex

2007-07-05 Thread Lutz Haseloff

Hi all,

if i use the metafun macro externalfigure with xetex, there is a printed
number
(first externafigure prints a 1, the second a 2 right after the 1 and
so on)
in the lower left corner of the picture;  the picture itself is shifted to
the upper right
out of the bounding box.
I have this effect with xetex 996p1, 997-dev, ConTeXt 17.04.07, the newest
beta
and ConTeXt 26.01.2007. pdftex works wery well.

Is this a Bug in Xetex or in ConTeXt?

Greetings

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

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


Re: [NTG-context] metafun/label: utf8 and spaces

2007-07-02 Thread Patrick Gundlach
Hi Mojca,


 label(foobar baz äöß,(3cm,3cm));  % -- broken
 draw btex foobar baz äöß  etex  % --- OK



 Why not this one? [\sometxt] (Much faster, less problems, etc.)

(with the sound of 'wizard of oz')
Because, because, because... I didn't know about it. 

Thanks!

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

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


Re: [NTG-context] metafun/label: utf8 and spaces

2007-06-29 Thread Mojca Miklavec
On 6/28/07, Patrick Gundlach wrote:
 Hi,

 is there any way to get utf-8 labels and without the 'strange' space
 glyph?

 --

 \startMPenvironment[+]
 \enableregime[utf]
 \stopMPenvironment


 \starttext
 foobar baz äöß  % -- OK

 \startuniqueMPgraphic{bla}
 label(foobar baz äöß,(3cm,3cm));  % -- broken
 draw btex foobar baz äöß  etex  % --- OK
 \stopuniqueMPgraphic

 \useMPgraphic{bla}

 \stoptext
 --

Why not this one? (Much faster, less problems, etc.)

\enableregime[utf-8]

\starttext

\startuniqueMPgraphic{bla}
label(\sometxt{foobar baz äöß},(3cm,3cm));
\stopuniqueMPgraphic
\useMPgraphic{bla}

\stoptext

Metapost strings are something I wouldn't use anyway, although
Aditya's idea is also a nice one (a dirty way would be to redefine
label to use textext instead - I don't mean it too seriously of
course).

Mojca

(http://dl.contextgarden.net/myway/sometxt.pdf)
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] metafun/label: utf8 and spaces

2007-06-28 Thread Patrick Gundlach
Hi,

is there any way to get utf-8 labels and without the 'strange' space
glyph?

--

\startMPenvironment[+]
\enableregime[utf]
\stopMPenvironment


\starttext 
foobar baz äöß  % -- OK

\startuniqueMPgraphic{bla}
label(foobar baz äöß,(3cm,3cm));  % -- broken
draw btex foobar baz äöß  etex  % --- OK
\stopuniqueMPgraphic

\useMPgraphic{bla}

\stoptext
--

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

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


Re: [NTG-context] metafun/label: utf8 and spaces

2007-06-28 Thread Patrick Gundlach

 is there any way to get utf-8 labels and without the 'strange' space
 glyph?


A follow-up/answer...
(I hate doing this)

textext is a perfect substitute for label. (see metafun-p.pdf)

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

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


Re: [NTG-context] metafun/label: utf8 and spaces

2007-06-28 Thread Aditya Mahajan
Quoting Patrick Gundlach [EMAIL PROTECTED]:


 is there any way to get utf-8 labels and without the 'strange' space
 glyph?


 A follow-up/answer...
 (I hate doing this)

 textext is a perfect substitute for label. (see metafun-p.pdf)

I think of textext (and \sometxt) as a substitute for btex ... etex, 
not of label. I substitute of label should also accept a position 
variable, so that one could write

texlabel.top($x^2$, origin) ;

I know this should be simple, but I do not understand the metapost 
macro language to write such a macro. Writing

label.top(textext($x^2$), origin) is too verbose. Suggestions?

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

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


Re: [NTG-context] loadcurrentMPgraphic from metafun manual

2007-06-10 Thread Wolfgang Schuster
On Fri, 08 Jun 2007 16:25:13 -0400
Aditya Mahajan [EMAIL PROTECTED] wrote:

 Quoting nicola [EMAIL PROTECTED]:
 
  Hi,
  I have tried the following example (metafun-p.pdf, p. 112-3):
 
  \startMPgraphic
  draw unitsquare xscaled 5cm yscaled 1cm withpen pencircle scaled 2mm
  withcolor .625red;
  \stopMPgraphic
 
  \hbox \bgroup
  \loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic \quad
  \loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic \egroup
 
  but nothing is drawn unless I remove the setups in curly braces (in
  which case a rectangle 5cm x 1cm is drawn). Is there a different way to
  pass options to the figure inclusion macro?
 
 Interestingwhat is happening is something equivalent to
 
 \externalfigure
  [\MPgraphicfile.\the\currentMPgraphic]
  [type=mps,object=no,
   symbol=yes,reset=yes,
   maxwidth=,maxheight=,
   frame=off,background=,
   width=8cm,
   height=1cm]%
 
 and there is no figure. If I remove object=no, the figure is there. I 
 do not understand why object=no should affect the placement of the 
 figure.
 
 Aditya

Hi,

right, the object=no value is the problem. You can solve your problem
by inserting the following macro somewhere before starttext in your
document:

\unprotect

  \def\insertMPfileARG#1#2%
{\ifx\undefined\externalfigure
   \message{[insert file #1 here]}%
 \else
   \externalfigure
 [#1]
 [\c!type=\c!mps,\c!object=\v!yes,
  \c!symbol=\v!yes,\c!reset=\v!yes,
  \c!maxwidth=,\c!maxheight=,
  \c!frame=\v!off,\c!background=,
  #2]%
 \fi}

\protect

I changed only the no value from object to yes.

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

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


[NTG-context] \loadcurrentMPgraphic from metafun manual

2007-06-08 Thread nicola
Hi,
I have tried the following example (metafun-p.pdf, p. 112-3):

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

\hbox \bgroup 
\loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic \quad 
\loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic \egroup

but nothing is drawn unless I remove the setups in curly braces (in 
which case a rectangle 5cm x 1cm is drawn). Is there a different way to 
pass options to the figure inclusion macro?

Nicola

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

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


Re: [NTG-context] loadcurrentMPgraphic from metafun manual

2007-06-08 Thread Aditya Mahajan
Quoting nicola [EMAIL PROTECTED]:

 Hi,
 I have tried the following example (metafun-p.pdf, p. 112-3):

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

 \hbox \bgroup
 \loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic \quad
 \loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic \egroup

 but nothing is drawn unless I remove the setups in curly braces (in
 which case a rectangle 5cm x 1cm is drawn). Is there a different way to
 pass options to the figure inclusion macro?

Interestingwhat is happening is something equivalent to

\externalfigure
 [\MPgraphicfile.\the\currentMPgraphic]
 [type=mps,object=no,
  symbol=yes,reset=yes,
  maxwidth=,maxheight=,
  frame=off,background=,
  width=8cm,
  height=1cm]%

and there is no figure. If I remove object=no, the figure is there. I 
do not understand why object=no should affect the placement of the 
figure.

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

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


Re: [NTG-context] Back to Metafun Manual

2007-06-07 Thread Taco Hoekwater
David Arnold wrote:
 All,
 
 I am wondering what is wrong with the following. On my system it  

It runs fine on my system, somehow your metapost output image is
broken:

 (./meta-meta.tmp [MP to PDF] (./meta-mpgraph.1
 ! Dimension too large.
 recently read \onebasepoint
 
 \handleMPboundingbox ...expr \MPury \onebasepoint
-\MPlly  
 \onebasepoint \rel...
 l.2 %%BoundingBox: -11 -11 82 25121

this boundingbox is definately wrong: it gives the image an height
of 350 inches! Sorry, I can't explain why.

Best wishes,
Taco

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

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


Re: [NTG-context] Back to Metafun Manual

2007-06-07 Thread David Arnold
Taco,

After updating my gWTeX, it now works here as well.

Thanks.,

On Jun 7, 2007, at 12:05 AM, Taco Hoekwater wrote:

 David Arnold wrote:
 All,

 I am wondering what is wrong with the following. On my system it

 It runs fine on my system, somehow your metapost output image is
 broken:

 (./meta-meta.tmp [MP to PDF] (./meta-mpgraph.1
 ! Dimension too large.
 recently read \onebasepoint

 \handleMPboundingbox ...expr \MPury \onebasepoint
-\MPlly
 \onebasepoint \rel...
 l.2 %%BoundingBox: -11 -11 82 25121

 this boundingbox is definately wrong: it gives the image an height
 of 350 inches! Sorry, I can't explain why.

 Best wishes,
 Taco

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

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

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

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


[NTG-context] Back to Metafun Manual

2007-06-06 Thread David Arnold
All,

I am wondering what is wrong with the following. On my system it  
produces the error that follows.

\setuppapersize[S6][S6]

\usetypescriptonce [map]  [times,helvetica,palatino] [texnansi]
\usetypescriptonce [serif][times][name,texnansi]
\usetypescriptonce [sans] [helvetica][name,texnansi]
\usetypescriptonce [palatino] [texnansi]

\setupbodyfont [palatino,10pt]

\startbuffer[mpenv]
\startMPenvironment
   \usetypescriptonce[map][times,helvetica,palatino][texnansi]
   \usetypescriptonce[serif][times][name,texnansi]
   \usetypescriptonce[sans][helvetica][name,texnansi]
   \usetypescriptonce[palatino][texnansi]
   \setupbodyfont[palatino,10pt]
   \definefont[RotFont][RegularBold]
\stopMPenvironment
\stopbuffer

\definefont[RotFont][RegularBold]

\getbuffer[mpenv]

\setupcolors[state=start]

\starttext

\def\showMPline#1#2%
   {\startMPcode
  path p ; p := ((0,0)--(.5,1)--(1,0)) xscaled 2.5cm yscaled  
1.25cm ;
  pickup pencircle scaled .75cm ;
  draw p withcolor .625white ;
  interim linejoin := #1 ;
  interim linecap  := #2 ;
  draw p withcolor transparent(1,.5,.625yellow) ;
\stopMPcode}

\def\showMPtext#1#2%
   {linejoin=#1\par linecap=#2}

\startbuffer
\startcombination[3*3]
   {\showMPline{mitered}{butt}}{\showMPtext{mitered}{butt}}
   {\showMPline{mitered}{rounded}} {\showMPtext{mitered}{rounded}}
   {\showMPline{mitered}{squared}} {\showMPtext{mitered}{squared}}
   {\showMPline{rounded}{butt}}{\showMPtext{rounded}{butt}}
   {\showMPline{rounded}{rounded}} {\showMPtext{rounded}{rounded}}
   {\showMPline{rounded}{squared}} {\showMPtext{rounded}{squared}}
   {\showMPline{beveled}{butt}}{\showMPtext{beveled}{butt}}
   {\showMPline{beveled}{rounded}} {\showMPtext{beveled}{rounded}}
   {\showMPline{beveled}{squared}} {\showMPtext{beveled}{squared}}
\stopcombination
\stopbuffer

\placefigure
   [here] [fig:joints]
   {The nine ways to end and join lines.}
   {\getbuffer}


\stoptext

\stoptext


The error:

(./meta-meta.tmp [MP to PDF] (./meta-mpgraph.1
! Dimension too large.
recently read \onebasepoint

\handleMPboundingbox ...expr \MPury \onebasepoint
   -\MPlly  
\onebasepoint \rel...
l.2 %%BoundingBox: -11 -11 82 25121

?

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

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


Re: [NTG-context] Acrobat crashes metafun manual

2007-06-05 Thread luigi scarso
On 6/6/07, David Arnold [EMAIL PROTECTED] wrote:
 All,

 Running Acrobat 7.0.9. In reading the metafun-s.pdf from pragma-
 ade.com, Acrobat every so often just shuts down. Anyone else
 experience that? Is this a known behavior with metafun manual?

No problem on a Linux box

-- 
luigi

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

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

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


Re: [NTG-context] unicode in metafun?

2007-04-08 Thread Andrea Valle

Hi Nicola, Taco,

thanks.

So now I discovered \sometxt. As far as I understood what Taco say I  
this way I can use


On 7 Apr 2007, at 09:16, Taco Hoekwater wrote:


all characters context knows how to use.


This means that, if my chars aren't in \showcharacters they're  
unavailable (am I right?).
I guess that Nicola' suggestion is related to this fact. So, he uses  
\sometxt with XeTeX.

I'll take a look to the XeTeX (and eventuall get back with questions...)


Best

Unfortunately, in phonetics, that is very few, because
of the lacking TIPA support.

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


--
Andrea Valle
--
CIRMA - DAMS
Università degli Studi di Torino
-- http://www.cirma.unito.it/andrea/
-- [EMAIL PROTECTED]
--



 I did this interview where I just mentioned that I read Foucault.  
Who doesn't in university, right? I was in this strip club giving  
this guy a lap dance and all he wanted to do was to discuss Foucault  
with me. Well, I can stand naked and do my little dance, or I can  
discuss Foucault, but not at the same time; too much information.

(Annabel Chong)




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


Re: [NTG-context] unicode in metafun?

2007-04-07 Thread Taco Hoekwater
Andrea Valle wrote:
 
 Is there a way to use unicode symbols with metapost?

If you let context typeset the labels by using \textext
or, even better, \sometxt, you should be able to use
all characters context knows how to use.

Unfortunately, in phonetics, that is very few, because
of the lacking TIPA support.

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


Re: [NTG-context] unicode in metafun?

2007-04-07 Thread nicola
In article [EMAIL PROTECTED],
 Andrea Valle [EMAIL PROTECTED] wrote:

 Hi to all,
 
 I'm plotting a phonetic formant chart with metapost inside context.
 I know I can't use TIPA, but I would be happy with utf8.

I did something similar with XeTeX and ConTeXt using the \sometxt macro, 
e.g.:

\definetypeface[myface][rm][Xserif][Charis SIL][default][encoding=uc]
\starttext
\startreusableMPgraphic{fig}
  u := 1cm;
  draw origin--(0,u)--(0,2u)--(0,3u);
  dotlabel.lft(\sometxt{Q}, origin); dotlabel.rt(\sometxt{R}, origin);
  dotlabel.lft(\sometxt{Ã¥

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


[NTG-context] unicode in metafun?

2007-04-06 Thread Andrea Valle

Hi to all,

I'm plotting a phonetic formant chart with metapost inside context.
I know I can't use TIPA, but I would be happy with utf8.
So I'm encoding a utf8 file, and I can see the chars in the source.
As an example I see this:

ɷ

But MP is complaining about not ascii characters.
Even outside MP, just using ConTeXt I'm not able to see the  
previously mentioned char.


There's no error with
œ
(I guess it's extended ascii?)
but result is \dochar etc printed on resulting pdf.

Is there a way to use unicode symbols with metapost?

(or what else?)

Many thanks as usual

Best

-a-
--
Andrea Valle
--
CIRMA - DAMS
Università degli Studi di Torino
-- http://www.cirma.unito.it/andrea/
-- [EMAIL PROTECTED]
--


 I did this interview where I just mentioned that I read Foucault.  
Who doesn't in university, right? I was in this strip club giving  
this guy a lap dance and all he wanted to do was to discuss Foucault  
with me. Well, I can stand naked and do my little dance, or I can  
discuss Foucault, but not at the same time; too much information.

(Annabel Chong)



--
Andrea Valle
--
CIRMA - DAMS
Università degli Studi di Torino
-- http://www.cirma.unito.it/andrea/
-- [EMAIL PROTECTED]
--



 I did this interview where I just mentioned that I read Foucault.  
Who doesn't in university, right? I was in this strip club giving  
this guy a lap dance and all he wanted to do was to discuss Foucault  
with me. Well, I can stand naked and do my little dance, or I can  
discuss Foucault, but not at the same time; too much information.

(Annabel Chong)




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


[NTG-context] Fonts, nice looking headers, MetaFun and CV module

2007-03-19 Thread Gudmundur J. Kristjansson
Hi.

I'm been huffing and puffing the last few days trying to do my CV in 
ConTeXt. My previous version used the LaTeX Curve package and I was 
pretty happy with that.

I'm learning alot by doing this myself but some things have been pretty 
hard. The hardest: trying to some kind of fancy section headers. I'm 
pretty sure I should have been able to do this with the available 
documentation but I've read and read and not been able to find a 
solution.

Here's some of the things that my little brain can't comprehend:

1. I'm thoroughly confused about how fonts work. From various 
documents I found some that worked, for example:

\definetypeface [zapf] [cg] [calligraphy] [chancery]
\switchtotypeface [zapf] [12pt,cg]

or 

\setupbodyfont[ber,pos]

But I can't seem to find any place that lists the fonts I can use or 
how this actually works. Is there any standardized way, for example, 
to change font in headers or definitions of commands to affect only 
text in those definitions?

2. Fancy header with half of the text in background color (see headers 
in my former pdf at http://www.vitum.net/gjk/cv.pdf). 

I tried various things here. Using \framed, MetaFun and \setupbackground. 
For example:

\setupbackground
[leftoffset=0.3cm,
 rightoffset=0.3cm
 topoffset=-0.5cm,
 bottomoffset=0.3cm,
 background=color,
 backgroundcolor=red]

I guess I'm misunderstanding the offset parameters.

3. Framed texts with titles:

As explained in the MetaFun manual (Section 4.6, page 236) I tried 
using the code in that section...

\FrameTitle{Zapf (1)}
\StartFrame
Coming back to the use of typefaces in electronic
publishing: many of the new typographers receive their
knowledge and information about the rules of typography from
books, from computer magazines or the instruction manuals
which they get with the purchase of a PC or software.
\StopFrame

\startuseMPgraphic{FunnyFrame}
  picture p ; numeric w, h, o ;
  p := textext.rt(\MPstring{FunnyFrame}) ;
  w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ;
  p := p shifted (2o,h-ypart center p) ; draw p ;
  drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
  draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ;
  draw boundingbox p ;
  setbounds currentpicture to unitsquare xyscaled(w,h) ;
\stopuseMPgraphic

defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
defineframedtext[FunnyText][frame=off,background=FunnyFrame]
\def\StartFrame{\startFunnyText}
\def\StopFrame {\stopFunnyText }
\def\FrameTitle#1%
  {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}}
\setMPtext{FunnyFrame}{} % initialize the text variable

...and I have the following problems:
- The framing of the text is limited to a too narrow textwidth. I can't 
  seem to find where I change that in the code.
- Icelandic letters don't seem to work in titles or the text in the 
  frames. They do work in other places in the document, though.

Phew, that's enough for now. If any of you guys/gals have other ideas on 
how to do nice looking headers I'm open to everything.

Btw, I love using ConTeXt and really appreciate all your hard work.

P.S. Is there any CV package for ConTeXt out there? If not I could post 
my work (if people like what I did) to the ConTeXt wiki for others to use.

-- 
Best regards / Kær kveðja,
Gudmundur J. Kristjansson / Guðmundur J. Kristjánsson
[EMAIL PROTECTED] | [EMAIL PROTECTED] |
USA Tel. +347-821-9855.
Icelandic Tel. +354-893-.




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


Re: [NTG-context] Fonts, nice looking headers, MetaFun and CV module

2007-03-19 Thread Wolfgang Schuster
On Mon, 19 Mar 2007 03:05:16 -0400
Gudmundur J. Kristjansson [EMAIL PROTECTED] wrote:

 Hi.
 
 I'm been huffing and puffing the last few days trying to do my CV in 
 ConTeXt. My previous version used the LaTeX Curve package and I was 
 pretty happy with that.
 
 I'm learning alot by doing this myself but some things have been pretty 
 hard. The hardest: trying to some kind of fancy section headers. I'm 
 pretty sure I should have been able to do this with the available 
 documentation but I've read and read and not been able to find a 
 solution.
 
 Here's some of the things that my little brain can't comprehend:
 
 1. I'm thoroughly confused about how fonts work. From various 
 documents I found some that worked, for example:
 
 \definetypeface [zapf] [cg] [calligraphy] [chancery]
 \switchtotypeface [zapf] [12pt,cg]
 
 or 
 
 \setupbodyfont[ber,pos]
 
 But I can't seem to find any place that lists the fonts I can use or 
 how this actually works. Is there any standardized way, for example, 
 to change font in headers or definitions of commands to affect only 
 text in those definitions?
 
 2. Fancy header with half of the text in background color (see headers 
 in my former pdf at http://www.vitum.net/gjk/cv.pdf). 
 

Hi Gudmundur,

below is a very simple solution to your problem.

\unprotect

\def\cvsection#1#2%
  {\bgroup
 \setbox\scratchbox\hbox{#2}%
 \!!dimena\dimexpr\ht\scratchbox+\dp\scratchbox\relax
 \lower\dp\scratchbox\hbox\!!to\zeropoint
   {\startcolor[darkgray]
\vrule\c!height.5\!!dimena\c!width\hsize\hss
\stopcolor}%
 \midaligned{\box\scratchbox}
   \egroup}

\protect

\setupcolors[state=start]

\setuphead
  [section]
  [command=\cvsection,
   textstyle=\ss\bf]

\starttext

\section{Work experience}

\stoptext

Wolfgang

 I tried various things here. Using \framed, MetaFun and \setupbackground. 
 For example:
 
 \setupbackground
 [leftoffset=0.3cm,
  rightoffset=0.3cm
  topoffset=-0.5cm,
  bottomoffset=0.3cm,
  background=color,
  backgroundcolor=red]
 
 I guess I'm misunderstanding the offset parameters.
 
 3. Framed texts with titles:
 
 As explained in the MetaFun manual (Section 4.6, page 236) I tried 
 using the code in that section...
 
 \FrameTitle{Zapf (1)}
 \StartFrame
 Coming back to the use of typefaces in electronic
 publishing: many of the new typographers receive their
 knowledge and information about the rules of typography from
 books, from computer magazines or the instruction manuals
 which they get with the purchase of a PC or software.
 \StopFrame
 
 \startuseMPgraphic{FunnyFrame}
   picture p ; numeric w, h, o ;
   p := textext.rt(\MPstring{FunnyFrame}) ;
   w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ;
   p := p shifted (2o,h-ypart center p) ; draw p ;
   drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
   draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ;
   draw boundingbox p ;
   setbounds currentpicture to unitsquare xyscaled(w,h) ;
 \stopuseMPgraphic
 
 defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
 defineframedtext[FunnyText][frame=off,background=FunnyFrame]
 \def\StartFrame{\startFunnyText}
 \def\StopFrame {\stopFunnyText }
 \def\FrameTitle#1%
   {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}}
 \setMPtext{FunnyFrame}{} % initialize the text variable
 
 ...and I have the following problems:
 - The framing of the text is limited to a too narrow textwidth. I can't 
   seem to find where I change that in the code.
 - Icelandic letters don't seem to work in titles or the text in the 
   frames. They do work in other places in the document, though.
 
 Phew, that's enough for now. If any of you guys/gals have other ideas on 
 how to do nice looking headers I'm open to everything.
 
 Btw, I love using ConTeXt and really appreciate all your hard work.
 
 P.S. Is there any CV package for ConTeXt out there? If not I could post 
 my work (if people like what I did) to the ConTeXt wiki for others to use.
 
 -- 
 Best regards / Kær kveðja,
 Gudmundur J. Kristjansson / Guðmundur J. Kristjánsson
 [EMAIL PROTECTED] | [EMAIL PROTECTED] |
 USA Tel. +347-821-9855.
 Icelandic Tel. +354-893-.
 
 
 
 
 ___
 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] error with metafun

2007-01-05 Thread Taco Hoekwater


Peter Münster wrote:
 On Thu, 4 Jan 2007, Taco Hoekwater wrote:
 
 
Peter Münster wrote:

with the latest ConTeXt on TeX-live 2007 and this input file:

No error here, but my context and metapost are newer and my
pdftex  is older than TL, so that may not mean much.
 
 Did you use the --dvi switch of texexec?

I didn't, but I did just now, and yes, it is broken.
I get the same error you had, with the latest beta.

Looks like that bit of the ConTeXt code doesn't like the new
procsets in the new metapost version, because with this change:

   \starttext
   \startuseMPgraphic{test}
   mpprocset:=0;
   draw fullcircle scaled 4cm withpen pencircle scaled 1cm ;
   setbounds currentpicture to boundingbox fullcircle scaled 4cm ;
   \stopuseMPgraphic
   \useMPgraphic{test}
   \stoptext

It runs fine.

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


[NTG-context] error with metafun

2007-01-04 Thread Peter Münster
Hello,

with the latest ConTeXt on TeX-live 2007 and this input file:

\starttext
\startuseMPgraphic{test}
draw fullcircle scaled 4cm withpen pencircle scaled 1cm ;
setbounds currentpicture to boundingbox fullcircle scaled 4cm ;
\stopuseMPgraphic
\useMPgraphic{test}
\stoptext

I get the following error in dvi-mode:

This is MetaPost, Version 0.993 (Web2C 7.5.6)
(test-mpgraph.mp [1]
metafun 2007-1-4 11:2
 )
1 output file written: test-mpgraph.1
Transcript written on test-mpgraph.log.
[MP as EPS ./test-mpgraph.1] [MP color conversion ./test-mpgraph.1
! Argument of \dodohandleMPcolor has an extra }.
inserted text 
\par 
to be read again 
   }
\includeMPasEPS ...\the \!!heightb }\doinsertfile 
  }\wd \scratchbox \!!widthb...

\loadMPgraphic ...Pgraphics \insertMPfile {#1}{#2}
  \fi }
\handleuseMPgraphic \the \currentMPgraphic }{}
  \placeMPgraphic \fi \deall...

\douseMPgraphic ...s [#1][#2]\getvalue {\@@MPG #1}
  {}\elabelgroup 
...
l.6 \useMPgraphic{test}

Could anybody help please?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] error with metafun

2007-01-04 Thread Peter Münster
On Thu, 4 Jan 2007, Taco Hoekwater wrote:

 Peter Münster wrote:
  
  with the latest ConTeXt on TeX-live 2007 and this input file:
 
 No error here, but my context and metapost are newer and my
 pdftex  is older than TL, so that may not mean much.

Did you use the --dvi switch of texexec?
Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] error with metafun

2007-01-04 Thread Taco Hoekwater
Peter Münster wrote:
 Hello,
 
 with the latest ConTeXt on TeX-live 2007 and this input file:

No error here, but my context and metapost are newer and my
pdftex  is older than TL, so that may not mean much.

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


Re: [NTG-context] error with metafun

2007-01-04 Thread Hans Hagen
� wrote:
 Hello,

 with the latest ConTeXt on TeX-live 2007 and this input file:

 \starttext
 \startuseMPgraphic{test}
 draw fullcircle scaled 4cm withpen pencircle scaled 1cm ;
 setbounds currentpicture to boundingbox fullcircle scaled 4cm ;
 \stopuseMPgraphic
 \useMPgraphic{test}
 \stoptext

 I get the following error in dvi-mode:

 This is MetaPost, Version 0.993 (Web2C 7.5.6)
 (test-mpgraph.mp [1]
 metafun 2007-1-4 11:2
  )
 1 output file written: test-mpgraph.1
 Transcript written on test-mpgraph.log.
 [MP as EPS ./test-mpgraph.1] [MP color conversion ./test-mpgraph.1
 ! Argument of \dodohandleMPcolor has an extra }.
 inserted text 
 \par 
   
works ok here (there has been a problem in mp with empty lines but that was 
solved; maybe do a purge 

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] Problems with MetaFun and registers

2006-10-23 Thread Fredrik Sjunnesson
I have problems with the register macro in MetaFun.

When I try
== 
\setupcolors[state=start]

\starttext
\definelayer[test]

\startuseMPgraphic{oeps}
  path p ; p := fullcircle scaled 6cm ;
  fill p withcolor .8white ;
  draw p withpen pencircle scaled 1mm withcolor .625red ;
  register (somepos-1,0cm,0cm,center currentpicture) ;
\stopuseMPgraphic

\setMPlayer [test] [somepos-1] [location=c]
  {Does it work all right?}

\getMPlayer [test]{\useMPgraphic{oeps}}
\stoptext
==

(which is essentially copied from the manual) in ConTeXt live I get the
following error message

==
! Illegal unit of measure (pt inserted).
to be read again 
   -
\pospxywhd ...fnum \positionanchormode =\plusone -
  \MPx \pageanchor \fi
\rela...
l.7 ...hd{somepos-1}{0}{5687206}{5687206}{0}{0}{0}
  
? 
! Emergency stop.
to be read again 
   -
\pospxywhd ...fnum \positionanchormode =\plusone -
  \MPx \pageanchor \fi
\rela...
l.7 ...hd{somepos-1}{0}{5687206}{5687206}{0}{0}{0}
  
No pages of output.
==

Am I doing something wrong or is the register functionality broken in
ConTeXt 2006.10.13? 

/Fredrik


Teknisk projektledare
Ph.D. Complex Systems
AcobiaFLUX AB
[EMAIL PROTECTED]
Tel: +46 (0) 31 722 48 11
Fax: +46 (0) 31 722 48 01
Mob: +46 (0) 733 27 92 41
www.acobiaflux.se 
 

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


[NTG-context] bug: MetaFun doesn't speak French

2006-10-03 Thread Mojca Miklavec
Hello Hans,

here's a little MetaFun snippet which fails to work because of special
treatment of French characters:

\useencoding[ffr]
\mainlanguage[fr]

\startMPcode
fill fullcircle scaled 5cm;
\stopMPcode

\stoptext


 (0,0,5cm.directdiscretionary,0,0,5cm.directdiscretionary)
! Transform components aren't all known.
to be read again
   {
l.148 ...llcircle scaled 5cm\directdiscretionary {
  ;}
?


I assume that it worked OK some time ago (I was trying to compile a
document from 2002).

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-29 Thread Patrick Gundlach
Hello Sanjoy,


[...]

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

 I tried to fix it after Taco reported the exact problem. Plese test
 if it's working now.

 Thanks, the live context works!  I tested this file:

Thank you and Mojca for testing and fixing things.

Patrick

(if things get important, please cc: me)
-- 
ConTeXt wiki and more: http://contextgarden.net
___
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-27 Thread Patrick Gundlach
Hi,

 If I try to edit the top level of a page by clicking the edit tab at
 the top, then I get a dialog box from Firefox (on Linux).  I just
 tried it with http://wiki.contextgarden.net/Cont-sys.tex and got
 You have chosen to open index.php which is a: PHP script.  What
 should Firefox do with this file?...  If I'm logged in to the wiki
 then it happens.  If I'm not logged in, then I get the wiki editor
 page and all is fine.

I can't reproduce the problem. Please email me privately if this
problem persist.

@Mojca: I do have such a filter, but I should actually look into my
email accout :-)

@all: If you experience a problem with contextgarden.net, please send
me a CC:

Patrick
-- 
ConTeXt wiki and more: http://contextgarden.net
___
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-26 Thread Peter Münster
On Sun, 24 Sep 2006, Hans Hagen wrote:

  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.  

 right, that's the idea ; just occasionally peek in the shipped 
 cont-sys.rme to see if something important came up ... not that frequently

What do you think about a cont-sys.tex like this:

\input cont-sys.rme
\runMPgraphicstrue
\runMPTEXgraphicstrue
\endinput

?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
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-26 Thread Sanjoy Mahajan
 sure, that's an option, but up to the user (maybe wikify this
 suggestion) 

Patrick: Not sure if it's a firefox-only problem or one that the
contextgarden wiki can help with by sending more detailed mime types,
but...

If I try to edit the top level of a page by clicking the edit tab at
the top, then I get a dialog box from Firefox (on Linux).  I just
tried it with http://wiki.contextgarden.net/Cont-sys.tex and got
You have chosen to open index.php which is a: PHP script.  What
should Firefox do with this file?...  If I'm logged in to the wiki
then it happens.  If I'm not logged in, then I get the wiki editor
page and all is fine.

If a page has sections, I can click the edit link to the right of the
section title and it works fine whether or not I'm logged in.

-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-26 Thread Hans Hagen
� wrote:
 On Sun, 24 Sep 2006, Hans Hagen wrote:

   
 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.  
   
   
 right, that's the idea ; just occasionally peek in the shipped 
 cont-sys.rme to see if something important came up ... not that frequently
 

 What do you think about a cont-sys.tex like this:

 \input cont-sys.rme
 \runMPgraphicstrue
 \runMPTEXgraphicstrue
 \endinput

   
sure, that's an option, but up to the user (maybe wikify this suggestion) 

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] transparent metafun colors turn nearly black

2006-09-25 Thread Mojca Miklavec
On 9/24/06, Sanjoy Mahajan wrote:
 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 inimfmp
 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?)

Yes.

I tried to fix it after Taco reported the exact problem. Plese test if
it's working now. If it isn't (i.e.: if I have broken something else)
now at least you know who is to blame.

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-25 Thread Sanjoy Mahajan
 (I wonder if the live context has been having the same problem?)

 I tried to fix it after Taco reported the exact problem. Plese test
 if it's working now.

Thanks, the live context works!  I tested this file:

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

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

and a nice transparent green circle shows up.

I also tested (overlapping transparent squares):

  \setupcolors[state=start]
  \starttext
  \startreusableMPgraphic{a}
  fill unitsquare scaled 1cm withcolor yellow;
  fill unitsquare shifted (0.5,0.5)
scaled 1cm withcolor transparent(1,0.5,red);
  \stopreusableMPgraphic

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

and it now works.

-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-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=contextrevrev=128view=log
https://foundry.supelec.fr/plugins/scmsvn/viewcvs.php/tex/context/user/cont-sys.rme?root=contextrevrev=128view=log

Mojca
___
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 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 Hans Hagen
Sanjoy Mahajan 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.  
   
right, that's the idea ; just occasionally peek in the shipped 
cont-sys.rme to see if something important came up ... not that frequently


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: verbatimtex coming too late?

2006-09-24 Thread Sanjoy Mahajan
In this file, I intended that all labels would come out in 7pt:

===  cut here 
\starttext

\startMPenvironment
\setupbodyfont[7pt]
\stopMPenvironment

\startMPinclusions
def drawtext =
  label(btex In drawtext() macro. etex, origin);
enddef;
\stopMPinclusions

\startstaticMPfigure{fig}
  drawtext;
  label(btex Inline in the figure. etex, (2in,0));
\stopstaticMPfigure

hello, in 12pt, for comparison.

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

\stoptext
===  cut here 

However, only the label that is directly in the figure (Inline in the
figure.) comes out in 7pt.  The other one, produced by the drawtext
macro, comes out in 12pt.  The resulting metapost file is file-fig.mp
and the key portions are (with spacing adjusted a bit):

  def drawtext =
  label(btex In drawtext() macro. etex, origin);
  enddef;

  beginfig(1);
  verbatimtex \global \loadfontfileoncetrue \setupbodyfont [7pt]  etex;
  drawtext;
  label(btex  Inline in the figure. etex, (2in,0));
  endfig;

The verbatimtex..etex block inside the beginfig..endfig doesn't affect
the btex..etex in the drawtext macro, I guess because drawtext is
defined outside of the beginfig..endfig.

This is all with context 2006.08.08.  I tested it on the live context,
but the transcript says figure texweb-fig.pdf can not be found.

A possible solution is to put the verbatimtex at the beginning of the mp
file or after the input mp-grph, making it like this:

  verbatimtex \global \loadfontfileoncetrue \setupbodyfont [7pt]  etex;
  def drawtext =
  label(btex In drawtext() macro. etex, origin);
  enddef;

  beginfig(1);
  drawtext;
  label(btex  Inline in the figure. etex, (2in,0));
  endfig;

but does that break other assumptions?

Another solution is textext instead of btex..etex, though I don't
understand the differences between the two.  The main one: textext
expands the tex commands in its argument whereas btex..etex does not.
But in regular metapost btex..etex does expand, so I'm confused a bit.
For example, you can do mpost file.mp with file.mp being

  verbatimtex \def\M{{\rm M}} etex
  beginfig(1)
  label (btex mass $\M$ etex, origin);
  endfig;
  end

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


Re: [NTG-context] metafun: verbatimtex coming too late?

2006-09-24 Thread Sanjoy Mahajan
I had wondered:
 only the label that is directly in the figure (Inline in the
 figure.) comes out in 7pt.  The other one, produced by the drawtext
 macro, comes out in 12pt.

 A possible solution is to put the verbatimtex at the beginning of
 the mp file or after the input mp-grph, making it like this:

The following lines do the above, and make all the btex..etex texts
come out in the small size:

\startMPextensions
verbatimtex \the\everyMPTEXgraphic etex;
\stopMPextensions

It works okay on a few test files, but are there bad interactions?

-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 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] 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 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


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 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] 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] 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
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 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 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 inimfmp
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


[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 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-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 black 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 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 black 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-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


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


<    4   5   6   7   8   9   10   11   >