ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* decriptions
@ 1999-06-25 11:39 Hans Hagen
  1999-06-25 13:48 ` decriptions Taco Hoekwater
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hans Hagen @ 1999-06-25 11:39 UTC (permalink / raw)


Hi all and Wybo in particular, 

I suppose this is what you want: 

\setuplayout[width=100mm]

\definedescription
  [description]
  [location=hanging,        % implemented recently 
   margin=standard,
   headstyle=bold]

\definestartstop
  [descriptions]
  [before=\blank\startpacked,
   after=\stoppacked\blank,
   commands=\let\item\description]

\starttext

\dorecurse{10}{This one is for Wybo. }

\startdescriptions

\description {aap:} is a monkey, but much more can be told
about this animal;s for example they are hairy, mostly
brown or black and they resemble people a lot.

\item {noot:} is a vegetable; again there are many kinds
and you will get very fat if you eat lots of them.

\startdescription {this is a rather long item:}

it is not very interesting in itself, but gives me the
opportunity to tell you something about the description
environment: it is like an itemize, but with user-supplied
labels which are printed bold.

\stopdescription

\stopdescriptions

\dorecurse{10}{This one is for Wybo. }

\stoptext 

I think it makes sense to add such latex counterparts to a specific
module m-latex or so. If needed, with some \begin \end alike
substitutes, like 

\let\normalbegin\begin

\let\complexbegin\normalbegin

\def\simplebegin#1%
  {\getvalue{start#1}\bgroup
   \def\end##1{\egroup\getvalue{stop##1}}}

\definecomplexorsimple \begin

So, that one can now also say: 

\begin{descriptions}

\item {aap:} is a monkey, but much more can be told
about this animal;s for example they are hairy, mostly
brown or black and they resemble people a lot.

\item {noot:} is a vegetable; again there are many kinds
and you will get very fat if you eat lots of them.

\item {this is a rather long item:} it is not very
interesting in itself, but gives me the opportunity to tell
you something about the description environment: it is like
an itemize, but with user-supplied labels which are printed
bold.

\end{descriptions}

But, keep in mind that \begin \end is used for different purposes in
context (block moves/reuse), although the definition given here is
supposed to take care of that (untested). So, consider this a last
resort. 

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


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

* Re: decriptions
  1999-06-25 13:48 ` decriptions Taco Hoekwater
@ 1999-06-25 11:53   ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 1999-06-25 11:53 UTC (permalink / raw)
  Cc: ntg-context, wybo

Taco Hoekwater wrote:
> 
>     Hans> I think it makes sense to add such latex counterparts to a
>     Hans> specific module m-latex or so. If needed, with some \begin
>     Hans> \end alike substitutes, like
> 
> To be joined with m-ltxemu ?

Sure. Just send me what you have some day and we make some nice
emulator. If needed I'm sure Wybo can make us some hefty perl scripts to
complement them. 

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


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

* Re: decriptions
  1999-06-25 11:39 decriptions Hans Hagen
@ 1999-06-25 13:48 ` Taco Hoekwater
  1999-06-25 11:53   ` decriptions Hans Hagen
  1999-06-26 10:37 ` decriptions Wybo Dekker
  1999-06-26 21:09 ` decriptions Wybo Dekker
  2 siblings, 1 reply; 7+ messages in thread
From: Taco Hoekwater @ 1999-06-25 13:48 UTC (permalink / raw)
  Cc: ntg-context, wybo

    Hans> I think it makes sense to add such latex counterparts to a
    Hans> specific module m-latex or so. If needed, with some \begin
    Hans> \end alike substitutes, like

To be joined with m-ltxemu ?

Taco


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

* Re: decriptions
  1999-06-25 11:39 decriptions Hans Hagen
  1999-06-25 13:48 ` decriptions Taco Hoekwater
@ 1999-06-26 10:37 ` Wybo Dekker
  1999-06-26 15:54   ` decriptions Hans Hagen
  1999-06-26 21:09 ` decriptions Wybo Dekker
  2 siblings, 1 reply; 7+ messages in thread
From: Wybo Dekker @ 1999-06-26 10:37 UTC (permalink / raw)
  Cc: ntg-context

Hans Hagen wrote:
> 
> Hi all and Wybo in particular, 
> 
> I suppose this is what you want: 
> 
> \setuplayout[width=100mm]
> 
> \definedescription
>   [description]
>   [location=hanging,        % implemented recently 
>    margin=standard,
>    headstyle=bold]
> 
> \definestartstop
>   [descriptions]
>   [before=\blank\startpacked,
>    after=\stoppacked\blank,
>    commands=\let\item\description]
> 
> \starttext
> 
> \dorecurse{10}{This one is for Wybo. }
> 
> \startdescriptions
> 
> \description {aap:} is a monkey, but much more can be told
> about this animal;s for example they are hairy, mostly
> brown or black and they resemble people a lot.
> 
> \item {noot:} is a vegetable; again there are many kinds
> and you will get very fat if you eat lots of them.
> 
> \startdescription {this is a rather long item:}
> 
> it is not very interesting in itself, but gives me the
> opportunity to tell you something about the description
> environment: it is like an itemize, but with user-supplied
> labels which are printed bold.
> 
> \stopdescription
> 
> \stopdescriptions
> 
> \dorecurse{10}{This one is for Wybo. }
> 
> \stoptext 

That's exactly what I meant. Yet a few remarks: 
1: why allow a mix of `item' and `description'? Just `item' would suffice
2: the only need for the \startdescription/\stopdescription pair I see
   is that it allows for more than 1 paragraph in a description/item. Latex
   allows for that without extra's.  And it always separates
   paragraphs in lists with an empty line and with no parindent. And
   if one doesn't want the empty line: use \\
   I like that behaviour.

> I think it makes sense to add such latex counterparts to a specific
> module m-latex or so. If needed, with some \begin \end alike
> substitutes, like 

[...]

I don't think it's a good idea to emulate latex in context. It just
makes people to stick with latex instead of thinking the context way. 

You should do two things:
1: make context alternatives for things that people like in latex, but
   only if they are right in your view.
2: give people hints about how they can do the things they did in
   latex better in context.

A final question: 
As Hans now generously generates new code for me in English, while I
started my book in Dutch (which was the language used during the
course). I decided to translate the book into english, using my `tran'
perlscript. But that doesn't find translations for:

\startstandaardopmaak
\stopstandaardopmaak
\volledigeinhoudsopgave

Those words are not in mult-co[mn].tex. Howcome?
-- 
Hartelijke groet, Wybo
--
__Servalys Analytical Chemistry Services__
Wybo H. Dekker      wybo@servalys.hobby.nl
Deilsedijk 60       www.hobby.nl/~servalys
4158 CH Deil        tel +31-345-652164    
The Netherlands     fax +31-345-652383    


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

* Re: decriptions
  1999-06-26 10:37 ` decriptions Wybo Dekker
@ 1999-06-26 15:54   ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 1999-06-26 15:54 UTC (permalink / raw)
  Cc: ntg-context

Wybo Dekker wrote:

> That's exactly what I meant. Yet a few remarks:
> 1: why allow a mix of `item' and `description'? Just `item' would suffice

Because item is a context command already. I added \item for convenience
only. The 'description' comman dis now defined outside the
'descriptions' environment, and therefore also available outside there,
while that \item equivalent is only available inside. You get
\description for free. (If I would have used \item, itemize would fail,
and if I would define it inside the environemt, you cannot change
characteristics. Now you can change for instance the font: \setup....
[description][headstyle=slanted]

> 2: the only need for the \startdescription/\stopdescription pair I see
>    is that it allows for more than 1 paragraph in a description/item. Latex
>    allows for that without extra's.  And it always separates

Context also so, unless you want to do something fance, and then
additional grouping is needed. 

>    paragraphs in lists with an empty line and with no parindent. And
>    if one doesn't want the empty line: use \\
>    I like that behaviour.

It goes beyond that. One can set the font for the description text for
instance [style=].

So: 

\whatever {item} text \par|emptyline more text \par|empty line

can handle the 'item' and 'text' but not 'more text' (this is tex), but 

\startwhatever {item} text \par more text \stopwhatever

handles 'text' and 'more text'

> > I think it makes sense to add such latex counterparts to a specific
> > module m-latex or so. If needed, with some \begin \end alike
> > substitutes, like
> 
> [...]
> 
> I don't think it's a good idea to emulate latex in context. It just
> makes people to stick with latex instead of thinking the context way.
> 
> You should do two things:
> 1: make context alternatives for things that people like in latex, but
>    only if they are right in your view.

Sure. So actually I should remove the \item and stick to \description. 

> 2: give people hints about how they can do the things they did in
>    latex better in context.

Ok. 

> A final question:
> As Hans now generously generates new code for me in English, while I
> started my book in Dutch (which was the language used during the
> course). I decided to translate the book into english, using my `tran'
> perlscript. But that doesn't find translations for:
> 
> \startstandaardopmaak
> \stopstandaardopmaak
> \volledigeinhoudsopgave
> 
> Those words are not in mult-co[mn].tex. Howcome?

They are made up by \definemakeup[...]. Some commands adapt themselves
to the interface. One can for instance say 'bychapter' and
'perhoofdstuk' and here context composes keywords. You can find them in
the elements sections, so if you let 'tran' scan the \startelements part
too, you're done. For converience I can split the elements into those
used in setup<something> and start<something>. Some can be found in
variables. 

It makes sense to draw a list of the ones defined that way. Not so many.
Can be dummy entries in mult-com. I'll think of 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.nl
-----------------------------------------------------------------


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

* Re: decriptions
  1999-06-25 11:39 decriptions Hans Hagen
  1999-06-25 13:48 ` decriptions Taco Hoekwater
  1999-06-26 10:37 ` decriptions Wybo Dekker
@ 1999-06-26 21:09 ` Wybo Dekker
  1999-06-26 23:03   ` decriptions Hans Hagen
  2 siblings, 1 reply; 7+ messages in thread
From: Wybo Dekker @ 1999-06-26 21:09 UTC (permalink / raw)
  Cc: ntg-context

Another question about the new description environment: before 
> \stopdescriptions
an empty line appears to be required. Is that a bug or a feature?
Without it, tex says that it inserted a missing }

-- 
Hartelijke groet, Wybo
--
__Servalys Analytical Chemistry Services__
Wybo H. Dekker      wybo@servalys.hobby.nl
Deilsedijk 60       www.hobby.nl/~servalys
4158 CH Deil        tel +31-345-652164    
The Netherlands     fax +31-345-652383    


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

* Re: decriptions
  1999-06-26 21:09 ` decriptions Wybo Dekker
@ 1999-06-26 23:03   ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 1999-06-26 23:03 UTC (permalink / raw)
  Cc: ntg-context

Wybo Dekker wrote:

> Another question about the new description environment: before
> > \stopdescriptions
> an empty line appears to be required. Is that a bug or a feature?
> Without it, tex says that it inserted a missing }

This is one the few situations that context expects a \par or empty
line. It has to do with the fact that the par is grabbed, which in
itself is due to the fact that one can set the font. Consider 

\description{text} more text in some specific font 

some text not belonging to the description in the main body font. 

There is no robust way to deal with this. 

In general, one can set up a text rather spacy in context, because quite
some effort went into catching those situations. 

So, it's a nuisance, due to a feature. 

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


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

end of thread, other threads:[~1999-06-26 23:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-25 11:39 decriptions Hans Hagen
1999-06-25 13:48 ` decriptions Taco Hoekwater
1999-06-25 11:53   ` decriptions Hans Hagen
1999-06-26 10:37 ` decriptions Wybo Dekker
1999-06-26 15:54   ` decriptions Hans Hagen
1999-06-26 21:09 ` decriptions Wybo Dekker
1999-06-26 23:03   ` decriptions Hans Hagen

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