From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6033 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: escaping from \starttyping...\stoptyping Date: Thu, 08 Nov 2001 10:19:29 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20011108101715.03172bf0@server-1> References: <20011107224838X.marko@kinetic.ki.informatik.uni-frankfurt. de> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1035396585 6787 80.91.224.250 (23 Oct 2002 18:09:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:09:45 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: marko@ki.informatik.uni-frankfurt.de In-Reply-To: <20011107224838X.marko@kinetic.ki.informatik.uni-frankfurt. de> Xref: main.gmane.org gmane.comp.tex.context:6033 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6033 At 10:48 PM 11/7/2001 +0100, Marko Schuetz wrote: >I want to use ConTeXt macros from within typing, like > > >\define[1]\mysquare{#1$^2$} > >\starttyping >this is verbatim text /mysquare{j} >\stoptyping > >it works with macros that do not take arguments, but with arguments >the open curly brace seems to be considered for the macro name and an >undefined ... error is produced. > >A related problem is that I cannot have e.g. a comma after a macro >name because then also the name is not recognized. > >Help will be appreciated! :-) I admit that it looks ugly but look at this: \startRAW \def\mathematics#1% %%\ N usage: \type {\mathematics{x^2}} {\ifmmode#1\else$#1$\fi} %%\ N becomes: \mathematics{X^2} \stopRAW the %%\ serves as an escape and N is the escape-to-tex handler [see verb-ini.tex/core-ver.tex for more details] [some day i will reimplement the pretty printing handler since it is (low level) a bit too fuzzy] 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 -------------------------------------------------------------------------