* the closing bracket (structuring syntax)
@ 2006-08-10 19:46 Steffen Wolfrum
2006-08-10 20:44 ` Hans Hagen
2006-08-10 20:47 ` Aditya Mahajan
0 siblings, 2 replies; 9+ messages in thread
From: Steffen Wolfrum @ 2006-08-10 19:46 UTC (permalink / raw)
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.
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?
But in such a way that the file still can be processed as a regular
ConTeXt file?
Steffen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: the closing bracket (structuring syntax)
2006-08-10 19:46 the closing bracket (structuring syntax) Steffen Wolfrum
@ 2006-08-10 20:44 ` Hans Hagen
2006-08-10 20:52 ` Steffen Wolfrum
2006-08-10 20:47 ` Aditya Mahajan
1 sibling, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2006-08-10 20:44 UTC (permalink / raw)
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.
>
> 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?
>
> But in such a way that the file still can be processed as a regular
> ConTeXt file?
>
its' no problem to define most commands as start/stop, however keep in
mind that some start/stop constructs (like tables) pick up pieces in
order to store them
so, if some commands need start/stop variants ... just make me a list
and we'll see what we can do about it
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: the closing bracket (structuring syntax)
2006-08-10 19:46 the closing bracket (structuring syntax) Steffen Wolfrum
2006-08-10 20:44 ` Hans Hagen
@ 2006-08-10 20:47 ` Aditya Mahajan
2006-08-13 13:29 ` Steffen Wolfrum
1 sibling, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2006-08-10 20:47 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: the closing bracket (structuring syntax)
2006-08-10 20:44 ` Hans Hagen
@ 2006-08-10 20:52 ` Steffen Wolfrum
0 siblings, 0 replies; 9+ messages in thread
From: Steffen Wolfrum @ 2006-08-10 20:52 UTC (permalink / raw)
Thank you.
\footnote
\index
\chapter \section ...
\it \bf \sc \mr \cap
\language[...]
That would be quite a good start.
Steffen
Am 10.08.2006 um 22:44 schrieb Hans Hagen:
> 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.
>>
>> 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?
>>
>> But in such a way that the file still can be processed as a regular
>> ConTeXt file?
>>
> its' no problem to define most commands as start/stop, however keep in
> mind that some start/stop constructs (like tables) pick up pieces in
> order to store them
>
> so, if some commands need start/stop variants ... just make me a list
> and we'll see what we can do about it
>
> Hans
>
>
> -----------------------------------------------------------------
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
> | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: the closing bracket (structuring syntax)
2006-08-10 20:47 ` Aditya Mahajan
@ 2006-08-13 13:29 ` Steffen Wolfrum
2006-08-14 6:13 ` Steffen Wolfrum
2006-08-14 22:26 ` Aditya Mahajan
0 siblings, 2 replies; 9+ messages in thread
From: Steffen Wolfrum @ 2006-08-13 13:29 UTC (permalink / raw)
Am 10.08.2006 um 22:47 schrieb Aditya Mahajan:
> 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}}
And what would be the opposite?
For example \startquote ... \stopquote
to something like {MyQuote ... }
Steffen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: the closing bracket (structuring syntax)
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
1 sibling, 1 reply; 9+ messages in thread
From: Steffen Wolfrum @ 2006-08-14 6:13 UTC (permalink / raw)
Am 13.08.2006 um 15:29 schrieb Steffen Wolfrum:
> And what would be the opposite?
>
> For example \startquote ... \stopquote
> to something like {MyQuote ... }
>
> Steffen
\def\MyQuote#1{\startquote#1\stopquote}
\MyQuote{something to be quoted}
... should work OK, right?
Steffen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: the closing bracket (structuring syntax)
2006-08-13 13:29 ` Steffen Wolfrum
2006-08-14 6:13 ` Steffen Wolfrum
@ 2006-08-14 22:26 ` Aditya Mahajan
2006-09-13 2:34 ` Aditya Mahajan
1 sibling, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2006-08-14 22:26 UTC (permalink / raw)
> And what would be the opposite?
>
> For example \startquote ... \stopquote
> to something like {\MyQuote ... }
AFAIK, there is no easy way to do this.
Aditya
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: the closing bracket (structuring syntax)
2006-08-14 6:13 ` Steffen Wolfrum
@ 2006-08-15 14:30 ` Aditya Mahajan
0 siblings, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2006-08-15 14:30 UTC (permalink / raw)
On Mon, 14 Aug 2006, Steffen Wolfrum wrote:
>
> Am 13.08.2006 um 15:29 schrieb Steffen Wolfrum:
>
>> And what would be the opposite?
>>
>> For example \startquote ... \stopquote
>> to something like {MyQuote ... }
>>
>> Steffen
>
>
> \def\MyQuote#1{\startquote#1\stopquote}
>
> \MyQuote{something to be quoted}
>
>
> ... should work OK, right?
Yes, there is also
\def\MyQuote{\groupedcommand{\startquote}{\stopquote}}
which does not read the argument and is better in some cases.
Aditya
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: the closing bracket (structuring syntax)
2006-08-14 22:26 ` Aditya Mahajan
@ 2006-09-13 2:34 ` Aditya Mahajan
0 siblings, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2006-09-13 2:34 UTC (permalink / raw)
On Mon, 14 Aug 2006, Aditya Mahajan wrote:
>> And what would be the opposite?
>>
>> For example \startquote ... \stopquote
>> to something like {\MyQuote ... }
>
> AFAIK, there is no easy way to do this.
One can use \aftergroup trickery.
\def\MyQuote{\symbol[leftquote]\aftergroup\endMyQuote}
\def\endMyQuote{\symbol[rightquote]}
\starttext
{\MyQuote This is a test}
\mainlanguage[fr]
{\MyQuote This is a test}
\stoptext
Aditya
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-09-13 2:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-10 19:46 the closing bracket (structuring syntax) Steffen Wolfrum
2006-08-10 20:44 ` Hans Hagen
2006-08-10 20:52 ` Steffen Wolfrum
2006-08-10 20:47 ` Aditya Mahajan
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
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).