ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: h h extern <pragma@wxs.nl>
Subject: Re: Re: Learning ConTeXt, typical hurdle
Date: Sun, 13 Mar 2005 23:27:03 +0100	[thread overview]
Message-ID: <4234BE37.6000405@wxs.nl> (raw)
In-Reply-To: <60915.213.84.141.31.1110470951.squirrel@213.84.141.31>

Gerben Wierda wrote:
>>Hey Gerben,
>>
>>
>>>Now what turns out to solve this? Empty lines before \description and
>>>\stopdescriptions
>>
>>Things that were defined using \definedescription rely on \par as a
>>delimiter.
>>
>>
>>>Though I like ConTeXt if I look at certain design aspects, behaviour
>>>that
>>>depends on whitespace before a command frightens me.
>>
>>Just the way it works :-) Nothing to worry about.
> 
> 
> What this introduces is that the working of the ascii file depends on its
> layout. I can understand that an empty line does a \par (it is convenient
> after all) but I would see that kind of behaviour kept to a minimum. That
> is, now I have this 'invisible' element that is needed to close my
> structure. It is something quite unexpected for me in a TeX workflow.
> Different layout because of a missing empty line, fine. But an error
> message and a halt really surprises me. Another part of a learning curve
> which if you want adoption you should try to avoid. But maybe it is
> impossible to make ConTeXt more 'forgiving'.
> 
> The alternative is \startdescription\stopdescription which is logically
> nicer, but adds inconvenience to the typing/editing
> 
> IMO LaTeX here does a better user-interface job (not just because I happen
> to know LaTeX). Withing the description environment \item starts a new
> item and the item ends with the start of another item or the end of the
> environment. Completely independent of the layout of the ascii file.
> 
> It would IMO be a lot friendlier if my \stopdescriptions and \description
> commands would take care of this and I could do things like:
> 
> \startdescriptions
> \description{Foo} Bar bar bar
> \description{Foo} Bar bar bar
> \description{Foo} Bar bar bar
> \stopdescriptions
> 
> without triggering an error.

this could be made working to some extend, but it would complicate the code; 
this mechanism actually is implemented so that it can handle:

\starttext

\definedescription[test]

\test oeps whow \par

\test oeps

whow

\test {oeps} whow \par

\test {oeps} whow \par

\starttest {oeps} whow \stoptest

\stoptext

nowadays i tend to more verbose coding; anyhow, we can add something

\unprotect

\def\startdescriptions
   {\dosingleempty\dostartdescriptions}

\def\dostartdescriptions[#1]%
   {\begingroup
    \def\item{\getvalue{#1}}%
    \let\dostoppairdescription \donothing
    \let\@@description         \dostartpairdescription
    \let\@@startsomedescription\dostartsomedescription}

\def\stopdescriptions
   {\dostoppairdescription
    \endgroup}

\def\dostartpairdescription[#1][#2]%
   {\dostoppairdescription
    \def\dostoppairdescription{\@@stopdescription{#1}}%
    \bgroup
    \def\currentdescription{#1}%
    \doifelse{\descriptionparameter{\s!do\c!state}}\v!start
      {\@@makedescription{#1}[#2]{}}
      {\@@makedescription{#1}[#2]}}

\def\dostartsomedescription % #1[#2]#3%
   {\bgroup
    \@@makedescription} % {#1}[#2]{#3}}

\protect

\starttext

\definedescription[test]

\startdescriptions
\test{Foo} Bar bar bar
\test{Foo} Bar bar bar
\test{Foo} Bar bar bar
\stopdescriptions

\startdescriptions
\starttest{Foo} Bar bar bar \stoptest
\starttest{Foo} Bar bar bar \stoptest
\starttest{Foo} Bar bar bar \stoptest
\stopdescriptions

\startdescriptions[test]
\item{Foo} Bar bar bar
\item{Foo} Bar bar bar
\item{Foo} Bar bar bar
\stopdescriptions

\stoptext

for those who have problems adapting; so, what does the general context public 
think of such an extension?

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

  parent reply	other threads:[~2005-03-13 22:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-10 13:34 Gerben Wierda
2005-03-10 15:06 ` Patrick Gundlach
2005-03-10 16:09   ` Gerben Wierda
2005-03-10 17:05     ` Patrick Gundlach
2005-03-13 22:27     ` h h extern [this message]
2005-03-14  6:44       ` Gerben Wierda
2005-03-14  8:32         ` Hans Hagen
2005-03-14 10:28           ` Gerben Wierda
2005-03-10 17:52   ` Willi Egger
2005-03-13 21:42   ` h h extern

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=4234BE37.6000405@wxs.nl \
    --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).