[NTG-context] Weird Fieldstack problem

2007-06-08 Thread Zhichu Chen

Hi,

I've written the following test file:

==
\setupcolors[state=start]
\setuppagenumbering[state=stop]
\setupinteraction  [state=start]

\starttext

\MPdrawingdonetrue

\startMPdrawing
draw (0,0)--(2cm,2cm);
\stopMPdrawing
\definesymbol[aa][\getMPdrawing]

\startMPdrawing
draw (2cm,2cm)--(2cm,0);
\stopMPdrawing

\definesymbol[bb][\getMPdrawing]

\startMPdrawing
draw (0,0)--(2cm,0);
\stopMPdrawing

\definesymbol[cc][\getMPdrawing]

\definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on]


\fieldstack[somemap]
\goto{here} [JS(Walk_Field{somemap})]

\stoptext
==

It seems that the fieldstack does not work. Is there anything wrong?

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


[NTG-context] code weaving (solved)

2007-06-08 Thread Steffen Wolfrum
Surprise, surprise:

 \def\setnotebodyfont
   {\let\setnotebodyfont\relax
\restoreglobalbodyfont
   
\switchtobodyfont[rm,9pt]\setupinterlinespace[line=9.8pt,height=.79,depth=.21]\setupalign[block,hanging,hz]\parskip2pt}%
 
   

... sometimes I wish I had administrative access to the mailing list
in order to silently delete my own dump postings ...  o(

Steffen
___
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
___


[NTG-context] code weaving

2007-06-08 Thread Steffen Wolfrum
Hi,

my footnotes are nicely defined a such:

 \def\setnotebodyfont
   {\let\setnotebodyfont\relax
\restoreglobalbodyfont
   
\switchtobodyfont[rm,9pt]\setupinterlinespace[line=9.8pt,height=.79,depth=.21]\parskip2pt}%
 
   


Now I have to set the entire text with hanging/hz – same for the footnotes.

But the related command ...  

\setupfootnotes[align={block,hanging,hz}]

... is kind of overwritten/ignored by the syntax shown above. No matter where I 
place it.



Could someone please show me how to weave the align-instructions into the given 
footnote definition?


Thank you,

Steffen
___
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 Fieldstack problem

2007-06-08 Thread Aditya Mahajan
On Fri, 8 Jun 2007, Zhichu Chen wrote:

 Hi,

 I've written the following test file:

 ==
 \setupcolors[state=start]
 \setuppagenumbering[state=stop]
 \setupinteraction  [state=start]

 \starttext

 \MPdrawingdonetrue

 \startMPdrawing
 draw (0,0)--(2cm,2cm);
 \stopMPdrawing
 \definesymbol[aa][\getMPdrawing]

 \startMPdrawing
 draw (2cm,2cm)--(2cm,0);
 \stopMPdrawing

 \definesymbol[bb][\getMPdrawing]

 \startMPdrawing
 draw (0,0)--(2cm,0);
 \stopMPdrawing

 \definesymbol[cc][\getMPdrawing]

 \definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on]


 \fieldstack[somemap]
 \goto{here} [JS(Walk_Field{somemap})]

 \stoptext
 ==

 It seems that the fieldstack does not work. Is there anything wrong?

I haven't tested this, but I think that all elements in the fieldstack 
should have the same bounding box. Look at the widget manual, where 
Hans shows how to make sure that all elements have the same bounding 
box.

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 Fieldstack problem

2007-06-08 Thread Zhichu Chen

Hi Aditya,

Actually, they should have the same boundingbox, the first MPdrawing
environment draws a line from (0,0) to (2cm,2cm) and the sequence MPdrawing
environments just add two lines that are in the previous boundingbox.

I know what's happening now. \definesymbol doesn't define a symbol
from \getMPdrawing at once.


On 6/8/07, Aditya Mahajan [EMAIL PROTECTED] wrote:


On Fri, 8 Jun 2007, Zhichu Chen wrote:

 Hi,

 I've written the following test file:

 ==
 \setupcolors[state=start]
 \setuppagenumbering[state=stop]
 \setupinteraction  [state=start]

 \starttext

 \MPdrawingdonetrue

 \startMPdrawing
 draw (0,0)--(2cm,2cm);
 \stopMPdrawing
 \definesymbol[aa][\getMPdrawing]

 \startMPdrawing
 draw (2cm,2cm)--(2cm,0);
 \stopMPdrawing

 \definesymbol[bb][\getMPdrawing]

 \startMPdrawing
 draw (0,0)--(2cm,0);
 \stopMPdrawing

 \definesymbol[cc][\getMPdrawing]

 \definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on]


 \fieldstack[somemap]
 \goto{here} [JS(Walk_Field{somemap})]

 \stoptext
 ==

 It seems that the fieldstack does not work. Is there anything wrong?

I haven't tested this, but I think that all elements in the fieldstack
should have the same bounding box. Look at the widget manual, where
Hans shows how to make sure that all elements have the same bounding
box.

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] Weird Fieldstack problem

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

 Hi Aditya,

 Actually, they should have the same boundingbox, the first MPdrawing
 environment draws a line from (0,0) to (2cm,2cm) and the sequence MPdrawing
 environments just add two lines that are in the previous boundingbox.

 I know what's happening now. \definesymbol doesn't define a symbol
 from \getMPdrawing at once.

Yes, \definesymbol[a][b] is roughly equal to \def\a{b}, for example

\starttext

\def\something{aa}

\definesymbol[aa][\something]
\symbol[aa]

\def\something{bb}
\symbol[aa]

\stoptext

This is what is also happening in your case. You need to go back to the 
definebuffer and processbuffer as suggested in metafun manual.

I do not know if it makes sense to have a \edef version of 
definesymbol. In any case, getting expansion to work with \getMPdrawing 
is going to be difficult.

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