ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: bug with active :!;?
Date: Wed, 31 Aug 2005 10:19:41 +0200	[thread overview]
Message-ID: <4315681D.9070304@elvenkind.com> (raw)
In-Reply-To: <43155E8A.60606@wxs.nl>

Hans Hagen wrote:
> BILLET Olivier wrote:
> 
>> By the way, does this include the possibility to treat the character in
>> different ways depending on the current mode (math/text)?
>> Because, in the current setting, if you request for 3cm before `:' and
>> then define a mathematical function $f : R \to Z$ you'll end up with a
>> huuuge space between f and : which you certainly isn't what you want.
>>  
>>
> see attached file; taco may know other tricks (i remember that there is 
> some mechanism in tex for active char treatment in math mode)

It is possible to treat an arbitrary character as if it was \active
inside math mode, but not the other way around: when a character has
catcode \active, it is always treated as that macro, regardless of
the current mode.

For curious people, here is how you make a "mathmode only" macro:

   \mathcode`\!="8000
   \begingroup
   \catcode`\!=13
   \gdef!{\it math}
   \endgroup
   This is a $!$ test!.

Cheers, Taco

  reply	other threads:[~2005-08-31  8:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-26 10:01 Olivier
2005-08-29 10:50 ` Hans Hagen Outside
2005-08-29 13:20   ` BILLET Olivier
2005-08-29 13:40     ` Hans Hagen
2005-08-31  7:38     ` Hans Hagen
2005-08-31  8:19       ` Taco Hoekwater [this message]
2005-08-31  8:55       ` Setting header texts Jilani Khaldi
2005-08-31  9:05         ` Setting header texts (second) Jilani Khaldi
2005-08-31  9:19           ` Hans Hagen
2005-08-31 11:23             ` Jilani Khaldi
2005-08-31 15:58           ` Mojca Miklavec
2005-08-31 21:25             ` Setting a line on the header Jilani Khaldi

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=4315681D.9070304@elvenkind.com \
    --to=taco@elvenkind.com \
    --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).