ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Learning ConTeXt, typical hurdle
@ 2005-03-10 13:34 Gerben Wierda
  2005-03-10 15:06 ` Patrick Gundlach
  0 siblings, 1 reply; 10+ messages in thread
From: Gerben Wierda @ 2005-03-10 13:34 UTC (permalink / raw)


Maybe I should start a blog somewhere...

Anyway, I have started my "conversion to ConTeXT" project.

So, I used the fiee perl script to set up my project. Then I started to
fill things in. Everything is still in one directory (I do not understand
directory searching in ConTeXt yet and I haven't seen a example for a book
project).

So, I have a project file:

===============================
% output=pdf interface=en
\usemodule[bib]
\startproject project_teoada
\environment env_teoada

%  \showlayout
%  \showgrid
%  \showbodyfontenvironment

	\product prd_book
\stopproject
===============================

A product file:

===============================
\startproduct prd_book
\project project_teoada

\startfrontmatter
	\component c_introduction
\stopfrontmatter
	\component c_chapter1
	\component c_chapter2
	\component c_chapter3
	\component c_chapter4
	\component c_chapter5
	\component c_chapter6
	\component c_chapter7
\startbackmatter
	\component c_appendixa
	\component c_appendixb
\stopbackmatter
\stopproduct
===============================

I defined a description environment to replace LaTeX's description. In the
environment file:
===============================
\startenvironment env_teoada
\project project_teoada

\definedescription [description]
	[location=hanging, margin=standard, headstyle=bold]
\definestartstop [descriptions] [before=\blank\startpacked,
after=\stoppacked\blank]

\stopenvironment
===============================

And I put some info in c_introduction.tex. There I used the description
thingy:

===============================
\startcomponent c_introduction
\product prd_book
\project project_teoada

\starttext
\chapter[h:guide]{Guide}

\startdescriptions
\description{Chapter \in[h:ch1]} Bla bla
\description{Chapter \in[h:ch2]} Bla bla
\stopdescriptions

\stoptext

\stopcomponent
===============================

Now, this fails. Why? I was completely stumped. I get an error message I
do not understand:

references      : unknown reference [][h:ch2]
! Extra }, or forgotten \endgroup.
\stopdescriptions ->\dostopattributes \egroup
                                              \getvalue {\??be
descriptions\...
<argument> Bla bla \stopdescriptions
                                     \@@stopdescription
{description}\stoptext

\dodowithpar ...cription}[]{Chapter \in [h:ch2]}#1
                                                  \@@stopdescription
{descri...
l.14

? x

Now what turns out to solve this? Empty lines before \description and
\stopdescriptions

Though I like ConTeXt if I look at certain design aspects, behaviour that
depends on whitespace before a command frightens me.

G

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Learning ConTeXt, typical hurdle
  2005-03-10 13:34 Learning ConTeXt, typical hurdle Gerben Wierda
@ 2005-03-10 15:06 ` Patrick Gundlach
  2005-03-10 16:09   ` Gerben Wierda
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Patrick Gundlach @ 2005-03-10 15:06 UTC (permalink / raw)


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.

Patrick
-- 
ConTeXt wiki: http://contextgarden.net

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Re: Learning ConTeXt, typical hurdle
  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
  2005-03-10 17:52   ` Willi Egger
  2005-03-13 21:42   ` h h extern
  2 siblings, 2 replies; 10+ messages in thread
From: Gerben Wierda @ 2005-03-10 16:09 UTC (permalink / raw)


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

G

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Learning ConTeXt, typical hurdle
  2005-03-10 16:09   ` Gerben Wierda
@ 2005-03-10 17:05     ` Patrick Gundlach
  2005-03-13 22:27     ` h h extern
  1 sibling, 0 replies; 10+ messages in thread
From: Patrick Gundlach @ 2005-03-10 17:05 UTC (permalink / raw)


Hello Gerben,


[...]

>> Things that were defined using \definedescription rely on \par as a
>> delimiter.


> What this introduces is that the working of the ascii file depends on its
> layout. 

I completely agree with you here. This description - \par thing has
been on the mailinglist a couple times. But: that is TeX (you know that,
but I wanted to point this out again). TeX is really sensitive to
source layout. LaTeX is doing a good job to remove a lot of
dependencies, but does not do a perfect job. In some places, ConTeXt
is a bit worse. But you will come across this only on some older
definitions like \definedescription. 


Patrick
-- 
ConTeXt wiki: http://contextgarden.net

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Re: Learning ConTeXt, typical hurdle
  2005-03-10 15:06 ` Patrick Gundlach
  2005-03-10 16:09   ` Gerben Wierda
@ 2005-03-10 17:52   ` Willi Egger
  2005-03-13 21:42   ` h h extern
  2 siblings, 0 replies; 10+ messages in thread
From: Willi Egger @ 2005-03-10 17:52 UTC (permalink / raw)


Hi Gerben,

Due to a mistaken handling you roriginal mail I lost it :-(

In that mail in the last part, I believe it was an example \component I 
saw, that you said \starttext ... \stoptext. You do not need this pair, 
The handling of starting and stopping is done by the \startproject ... 
\stopproject commands.

In the product section I saw that you did not use the \startbodymatter 
... \stopobodymatter. I think this is important, because in the 
frontmatter sectionheading handling is different, as is in the backmatter.

here you go with an example I prepared:

\startproject HBBbrev
\enablemode[A-vier]

\environment layout

\product voorpag        %Titlepage for the book
\product beginmat       %Frontmatter: Woord vooraf, Koppermaandag,
						%Boekbinderslied
\startbodymatter
\environment lo-3

\product gekart      %Gekartonneerd in drie varianten
\product bdz-rech    %Bandzetter rechte rug
...
\product technik     %Werkwijzen en technieken
\product appendix    %Appendices:

\stopbodymatter

\product backmat     %Backmatter: Impressum

\nomorefiles
\stopproject

In my case many of the product-files contain a number of \components.

I do hope, that this helps.

Kind regards Willi

Patrick Gundlach 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.
> 
> Patrick

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Re: Learning ConTeXt, typical hurdle
  2005-03-10 15:06 ` Patrick Gundlach
  2005-03-10 16:09   ` Gerben Wierda
  2005-03-10 17:52   ` Willi Egger
@ 2005-03-13 21:42   ` h h extern
  2 siblings, 0 replies; 10+ messages in thread
From: h h extern @ 2005-03-13 21:42 UTC (permalink / raw)


Patrick Gundlach 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.

there are only a few commands that depend on that

for descriptions, you can also use

\startwhatever {...}

\stopwhatever

in addition to

\whatever {...} ... \par

given that you defined whatever -)

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] 10+ messages in thread

* Re: Re: Learning ConTeXt, typical hurdle
  2005-03-10 16:09   ` Gerben Wierda
  2005-03-10 17:05     ` Patrick Gundlach
@ 2005-03-13 22:27     ` h h extern
  2005-03-14  6:44       ` Gerben Wierda
  1 sibling, 1 reply; 10+ messages in thread
From: h h extern @ 2005-03-13 22:27 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Re: Learning ConTeXt, typical hurdle
  2005-03-13 22:27     ` h h extern
@ 2005-03-14  6:44       ` Gerben Wierda
  2005-03-14  8:32         ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Gerben Wierda @ 2005-03-14  6:44 UTC (permalink / raw)


On 13 Mar 2005, at 23:27, h h extern wrote:

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

Apart from adapting, the \startitemize \stopitemize does not require me 
to have a \par at the end. That is also confusing.

G

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Re: Learning ConTeXt, typical hurdle
  2005-03-14  6:44       ` Gerben Wierda
@ 2005-03-14  8:32         ` Hans Hagen
  2005-03-14 10:28           ` Gerben Wierda
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2005-03-14  8:32 UTC (permalink / raw)


Gerben Wierda wrote:

> Apart from adapting, the \startitemize \stopitemize does not require me 
> to have a \par at the end. That is also confusing.

That's because it's a different construct (less variants in visualization and 
such);

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] 10+ messages in thread

* Re: Re: Learning ConTeXt, typical hurdle
  2005-03-14  8:32         ` Hans Hagen
@ 2005-03-14 10:28           ` Gerben Wierda
  0 siblings, 0 replies; 10+ messages in thread
From: Gerben Wierda @ 2005-03-14 10:28 UTC (permalink / raw)


> Gerben Wierda wrote:
>
>> Apart from adapting, the \startitemize \stopitemize does not require me
>> to have a \par at the end. That is also confusing.
>
> That's because it's a different construct (less variants in visualization
> and
> such);

I understand that, but for someone new to ConTeXt, the behaviour of
\whatever after a \definewhatever is unexpected. Especially so if one is
used to LaTeX.

The same is true for the non-implied start of a new column in \startable
after a new row has been declared.

My experience so far with ConTeXt is that it is probably possible to do
all the things I want to do (though I still have a couple of open issues,
see other posts) and I still have the feeling it is very powerful (I
already had that when I first read the manual years ago). But the error
messages I get or the behaviour I see when I make my beginner mistakes are
less illuminating than the LaTeX parts and the behaviour is also not
always friendly (e.g. the \NC needed after a new row in \starttable) or
intuitive or the same across diffferent parts of ConTeXt (\startitemize
versus \startwhatever). And it sometimes very difficult to find
documentation (directory structure, \starttable).

G

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-03-14 10:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-10 13:34 Learning ConTeXt, typical hurdle 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
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

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