[NTG-context] metafun question

2004-08-16 Thread Floris van Manen
it seems that metafun has difficulty understanding the example using
thevardef [EMAIL PROTECTED] expr p =   construct.


! Illegal parameter number in definition of [EMAIL PROTECTED]@dummy2.
to be read again 

argument ... p of p enddef; \par vardef [EMAIL PROTECTED] 
  expr p = cuta(@##,@##) @##...

\dostartuseMPgraphic ...leuseMPgraphic {#1}{#2}{#3
  }}\elabelgroup 
l.41 \stopuseMPgraphic



why?


i copied the sample of the mp manual:



% interface=english output=pdftex

\starttext


\startuseMPgraphic{dummy2}

vardef cuta(suffix a,b) expr p =
drawarrow p cutbefore bpath.a cutafter bpath.b;
point .5*length p of p
enddef;

vardef [EMAIL PROTECTED] expr p =
cuta(@#,@#) @[EMAIL PROTECTED]@#.c 
enddef;

beginfig(52);
verbatimtex \def\stk#1#2{$\displaystyle{\matrix{#1\cr#2\cr}}$} etex
circleit.aa(btex\strut Start etex); aa.dx=aa.dy;
circleit.bb(btex \stk B{(a|b)^*a} etex);
circleit.cc(btex \stk C{b^*} etex);
circleit.dd(btex \stk D{(a|b)^*ab} etex);
circleit.ee(btex\strut Stop etex); ee.dx=ee.dy;
numeric hsep;
bb.c-aa.c = dd.c-bb.c = ee.c-dd.c = (hsep,0);
cc.c-bb.c = (0,.8hsep);
xpart(ee.e - aa.w) = 3.8in;
drawboxed(aa,bb,cc,dd,ee);
label.ulft(btex$b$etex, cuta(aa,cc) aa.c{dir50}..cc.c);
label.top(btex$b$etex, self.cc(0,30pt));
label.rt(btex$a$etex, cuta(cc,bb) cc.c..bb.c);
label.top(btex$a$etex, cuta(aa,bb) aa.c..bb.c);
label.llft(btex$a$etex, self.bb(-20pt,-35pt));
label.top(btex$b$etex, cuta(bb,dd) bb.c..dd.c);
label.top(btex$b$etex, cuta(dd,ee) dd.c..ee.c);
label.lrt(btex$a$etex, cuta(dd,bb) dd.c..{dir140}bb.c);
label.bot(btex$a$etex, cuta(ee,bb) ee.c..tension1.3 ..{dir115}bb.c);
label.urt(btex$b$etex, cuta(ee,cc) ee.c{(cc.c-ee.c)rotated-15}..cc.c);
endfig;

\stopuseMPgraphic

\useMPgraphic{dummy2}

\stoptext






//floris


___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] metafun question getting XY

2004-08-16 Thread Floris van Manen
if i define a path

q := (w0,w0)--(w0,ww0)--(w2,ww1)--(w3,ww2)--(w3,w0)--cycle ;

and then pass this path as a parameter to a function

test( q ) ;


then within that function i can step through the 'list of points'.

def test( expr a  ) =
 for i = 1 upto (length(a)-2):
  dotlabel.bot ( , (point i of a)  );
 endfor ;
enddef;


but how could i extract from each point the X and the Y value to
construct the lines like this.

 for i = 1 upto (length(a)-2):
  z1 = (point i of a) ;
  draw (0,y1)--(100,y1) ;
 endfor;



thanks!
% floris



___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metafun question getting XY

2004-08-16 Thread Hans Hagen
Floris van Manen wrote:
if i define a path
q := (w0,w0)--(w0,ww0)--(w2,ww1)--(w3,ww2)--(w3,w0)--cycle ;
and then pass this path as a parameter to a function
test( q ) ;
then within that function i can step through the 'list of points'.
def test( expr a  ) =
for i = 1 upto (length(a)-2):
 dotlabel.bot ( , (point i of a)  );
endfor ;
enddef;
but how could i extract from each point the X and the Y value to
construct the lines like this.
for i = 1 upto (length(a)-2):
 z1 = (point i of a) ;
 draw (0,y1)--(100,y1) ;
endfor;
 

xpart point i of a ; 
ypart point i of a ; 

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
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] metafun question

2004-08-16 Thread Hans Hagen
Floris van Manen wrote:
it seems that metafun has difficulty understanding the example using
 

no, it's tex playing tricks (# is kin dof special to tex)
thevardef [EMAIL PROTECTED] expr p =   construct.
 

use \# instead
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
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Is there a bug during pagination of external figures?

2004-08-16 Thread Stefan Wachter
Patrick Gundlach wrote:
Stefan Wachter [EMAIL PROTECTED] writes:

Hi Hans,
I attach an example Context file and the included graphics.
Unfortunately the example is by far not minimal. 

The file is just a few bytes, no need to mention...
Just looking at the error message, I bet your problem is at:
\setupheadertexts[text][{\tfc 8}{\tfb-3\_refkom}][]
\setupheadertexts[margin][{\tfc bu}][\ifnum\pageno = 
1\NamedExternalLink{../../../../bu/8/8_3_refkom/1/inhalt.pdf}{last}{\symbol[PfeilNachLinks]{}
 §}\else\PrevOrNextPage{/PrevPage}{\symbol[PfeilNachLinks]{} 
§}\fi\hskip.5em\ifnum\pageno = \lastpage{§ 
\symbol[PfeilNachRechts]}\else\PrevOrNextPage{/NextPage}{§ 
\symbol[PfeilNachRechts]}\fi]
Patrick
Hi Patrick,
i do not think that the problem is caused by the header texts. The same
header text definition is used during all the document but the problem
is encountered only at a page with several external figures. In
addition, if I insert a new page in between the figures then the problem
disappears (cf. original bug report).
--Stefan
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] How to implement a changing navigation bar?

2004-08-16 Thread Stefan Wachter
Hi all,
I use an overlay to implement a navigation bar in the left margin of a 
document. It seems to me that the processing of the overlay is done only 
once and not for every page again. In addition, the \lastpage is not 
available.

Does anyone know a solution? Maybe headers/footers are a solution. But 
how is absolute positioning accomplished with them?

Thanks for your attention,
--Stefan
PS: Here is my current implementation:
\definelayer[navbar]
\setupbackgrounds[text][leftmargin][background=navbar]
\setlayer[navbar][x=0cm,y=10cm]{\the\pageno}

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: How to implement a changing navigation bar?

2004-08-16 Thread Vit Zyka
--Stefan
PS: Is there some documentation about \appendtoks around?
Of course:
  grep -i \appendtoks tex/context/base/*.tex
;-)
\every* are defined/decribed(?) in core-var.tex
Vit
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Using ConTeXt through MikTeX

2004-08-16 Thread Shailesh Ashok Shirali
Hello, friends,
I posted this message some days back to the MikTeX mailing list, 
but would like to repeat it here.

I use MikTeX with the text editor TechnicCenter. I generally work 
with PDFLaTeX.

I have been reading about ConTeXt, which among other things 
enables the use of Metapost from within the package. (I wish to 
use Metapost as I need to draw lots of diagrams for Euclidean 
geometry.) It seems that one can configure MikTeX for ConTeXt.

Could any user of ConTeXt suggest how to do the configuring? I am 
not able to act on the tips given. I have located in MikTeX 
Options the option cont-uk (in the Formats tab) and have 
selected it; but am not sure of the next step.

I would be grateful for some advice on this matter. Thanks.
Sincerely,
Shailesh Shirali
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Cannot TeX this

2004-08-16 Thread Salman Khilji
Why can't I process the following from the manual?

\def\HeadTitle#1#2%
  {\hbox to hsize
{\hfill %
\framed[height=1cm,width=2cm,align=left]{#1}%
\framed[height=1cm,width=4cm,align=right]{#2}}}

\setuphead[subsection][command=\HeadTitle]

\starttext

\subsection{Test}{Test}

This is a test

\stoptext

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Cannot TeX this (SOLVED)

2004-08-16 Thread Salman Khilji
On Monday 16 August 2004 10:35 pm, Salman Khilji wrote:
   {\hbox to hsize


OOPS!  Sorry about this one.  Couldn't see the hsize instead of \hsize

Salman

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context