ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Radhelorn <radhelorn@mail.ru>
Subject: Re: About \defineshortcut
Date: Wed, 21 Dec 2005 10:53:34 +0300	[thread overview]
Message-ID: <43A909FE.6020501@mail.ru> (raw)
In-Reply-To: <43A88599.9020800@wxs.nl>

Hans Hagen wrote:
> Radhelorn wrote:
>> I think that \defineshortcut commands are most useful inside some 
>> environment (start/stop pair). So it is possible to have such 
>> environment that restores back all catcode changes (or other variable 
>> changes) made inside it (like local variables in some programming 
>> laguages)? This can have many other uses.
>>
> i have no idea why you use shortcuts (i implemented it as a gimmick -)

Well I was reading sources and stumbled over these commands. I am using 
shortcuts to typeset programming examples in non standard languages and 
pseudo-code.

> 
> grouping is doable with:
> 
> \starttext
> 
> \startsetups whatever
>    \defineshortcut [b] [style=bold]
>    \defineshortcut [e] [style=slanted]
> \stopsetups
> 
> \definestartstop[whatever][commands=\setups{whatever}]
> 
> \input tufte
> 
> oeps <b:oeps> or <e:oeps>
> 
> \startwhatever
> oeps <b:oeps> or <e:oeps>
> \stopwhatever
> 
> oeps <b:oeps> or <e:oeps>
> 
> \input tufte
> 
> \stoptext
> 

Many thanks! I've looked this indeed!

It is a pity that such useful command (setups) remains undocumented. As 
far as I understand inside setups can be any commands and environment 
changes are fully restored after their execution. Right? And \setups 
command can replace any single command (in arguments and such).

If this is OK, then I will try to collect some more examples and post 
them on the WIKI later this week.

-- 
Radhelorn <radhelorn@mail.ru>

  reply	other threads:[~2005-12-21  7:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15 21:31 Radhelorn
2005-12-16 19:18 ` Taco Hoekwater
2005-12-17 12:38   ` Radhelorn
2005-12-17 13:49     ` Taco Hoekwater
2005-12-20 21:37   ` Radhelorn
2005-12-20 22:28     ` Hans Hagen
2005-12-21  7:53       ` Radhelorn [this message]
2005-12-21  9:06         ` Hans Hagen

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=43A909FE.6020501@mail.ru \
    --to=radhelorn@mail.ru \
    --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).