ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
Subject: Re: the closing bracket (structuring syntax)
Date: Thu, 10 Aug 2006 16:47:34 -0400 (EDT)	[thread overview]
Message-ID: <Pine.GSO.4.63.0608101634130.21205@rrpf4327h10.ratva.hzvpu.rqh> (raw)
In-Reply-To: <D277C0E6-989A-4170-B2DD-B83A2A0BD4CF@st.estfiles.de>

On Thu, 10 Aug 2006, Steffen Wolfrum wrote:

> Hi,
>
> in XML and alike there is a concept of dedicated start/stop in
> formatting:
>
> <begin heading> ... <end heading >
> <begin footnote> ... <end footnote >
> <begin italic> ... <end italic>
>
> But in ConTeXt/TeX we have always the same closing syntax "}". That
> makes reading the code not easier.


You can always define your own startstop.

\definestartstop[italic][before={\bgroup \it},after={\egroup}]

and then do

\startitalic
  This is italic
\stopitalic

When a command takes an optional agrument, you can do use something like 
this

\def\startfootnote%
    {\unskip\dosingleempty\dostartfootnote}

\def\dostartfootnote[#1]#2\stopfootnote%
   {\footnote[#1]{#2}}


You can make such definitions of all your frequently used environments 
(or, if you prefer, write in XML and let ConTeXt handle XML).

> Is there a workaround to define the closing more precisely (like the
> examples above),
> so that finding a "}" in a ConTeXt source lets me distinguish what
> it's about?

There are \bgroup...\egroup which is same as {...} for all practical 
purposes.

Aditya

  parent reply	other threads:[~2006-08-10 20:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-10 19:46 Steffen Wolfrum
2006-08-10 20:44 ` Hans Hagen
2006-08-10 20:52   ` Steffen Wolfrum
2006-08-10 20:47 ` Aditya Mahajan [this message]
2006-08-13 13:29   ` Steffen Wolfrum
2006-08-14  6:13     ` Steffen Wolfrum
2006-08-15 14:30       ` Aditya Mahajan
2006-08-14 22:26     ` Aditya Mahajan
2006-09-13  2:34       ` Aditya Mahajan

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=Pine.GSO.4.63.0608101634130.21205@rrpf4327h10.ratva.hzvpu.rqh \
    --to=adityam@umich.edu \
    --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).