ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl
Subject: Re: escaping from \starttyping...\stoptyping
Date: Thu, 08 Nov 2001 10:19:29 +0100	[thread overview]
Message-ID: <5.1.0.14.1.20011108101715.03172bf0@server-1> (raw)
In-Reply-To: <20011107224838X.marko@kinetic.ki.informatik.uni-frankfurt. de>

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


       reply	other threads:[~2001-11-08  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20011107224838X.marko@kinetic.ki.informatik.uni-frankfurt. de>
2001-11-08  9:19 ` Hans Hagen [this message]
2001-11-08 10:47   ` Marko Schuetz
     [not found] ` <20011108114700B.marko@kinetic.ki.informatik.uni-frankfurt. de>
2001-11-08 13:20   ` Hans Hagen
2001-11-09 13:31     ` Marko Schuetz
     [not found]   ` <20011109143114Y.marko@kinetic.ki.informatik.uni-frankfurt. de>
2001-11-12 11:26     ` Hans Hagen
2001-11-12 13:24       ` Marko Schuetz
2001-11-07 21:48 Marko Schuetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.1.20011108101715.03172bf0@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).