The following code results in an error. \startMPinclusions vardef a@#(text t) = @#(t) enddef; \stopMPinclusions \starttext Hello. \stoptext ! Illegal parameter number in definition of \theMPinclusions. <to be read again> ( <argument> vardef a@##( text t) = @##(t) enddef; \startMPinclusions ...tions ;}}\writeMPgraphic {#1 }} l.3 \stopMPinclusions I know that # is a special character in TeX, but is there a way to get abound this? What I actually trying to do, is to make a diagram drawing package that I wrote for Metapost, work in ConTeXt. So I would like to include the Metapost macros once and then use them later in drawings, that is, <include the Metapost macros in one way or another> \starttext ... we now have the following commutative diagram. \startuseMPgraphic <my code for the diagram> \stopuseMPgraphic \useMPgraphic \stoptext -- Emil Hedevang Lohse http://home.imf.au.dk/emil/ Alle spørgsmål er lige dumme. Og spørgsmålet "Kan ænder flyve?" er ikke dumt.
Emil Hedevang Lohse
I know that # is a special character in TeX, but is there a way to get abound this?
I see two posibilites (both untested): either replace the # with \# or surround your \startuseMPgraphic \stopuseMPgraphic with {\catcode`#=11 \startuseMPgraphic \stopuseMPgraphic } I don't know if this has any side effects in the startuseMPgraphic environment or if this even works. Probably there is an official ConTeXt way to do this. Patrick -- Mehr Buchstaben - mehr Spass
At 12:54 PM 1/22/2003 +0100, Patrick Gundlach wrote:
Emil Hedevang Lohse
writes: Hello,
I know that # is a special character in TeX, but is there a way to get abound this?
I see two posibilites (both untested):
either replace the # with \# or surround your
\startuseMPgraphic \stopuseMPgraphic
with
{\catcode`#=11 \startuseMPgraphic \stopuseMPgraphic }
I don't know if this has any side effects in the startuseMPgraphic environment or if this even works. Probably there is an official ConTeXt way to do this.
Your first method is the proper way: copied from supp-mps.tex: \appendtoks \let \# \letterhash \let \_ \letterunderscore \let \& \letterampersand \let \{ \letteropenbrace \let \} \letterclosebrace \to \everyMPgraphic so, all these can be escaped Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Hans Hagen
Your first method is the proper way:
copied from supp-mps.tex:
\appendtoks \let \# \letterhash \let \_ \letterunderscore \let \& \letterampersand \let \{ \letteropenbrace \let \} \letterclosebrace \to \everyMPgraphic
I believe there is a bug in supp-ini.tex: .catcode `.} 12 .xdef .letterclosebrace B.string{E should be .catcode `.} 12 .xdef .letterclosebrace B.string}E -- Emil Hedevang Lohse http://home.imf.au.dk/emil/ Alle spørgsmål er lige dumme. Og spørgsmålet "Kan ænder flyve?" er ikke dumt.
At 02:38 PM 1/24/2003 +0100, you wrote:
I believe there is a bug in supp-ini.tex:
.catcode `.} 12 .xdef .letterclosebrace B.string{E
should be
.catcode `.} 12 .xdef .letterclosebrace B.string}E
indeed Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
participants (3)
-
Emil Hedevang Lohse
-
Hans Hagen
-
Patrick Gundlach