ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Not possible to redefine inbetween in \definedescription
@ 2005-07-14 11:43 Radhelorn
  2005-07-14 12:45 ` Taco Hoekwater
  2005-07-20 19:58 ` Hans Hagen
  0 siblings, 2 replies; 11+ messages in thread
From: Radhelorn @ 2005-07-14 11:43 UTC (permalink / raw)


Hello All!
I think that I've found a bug in descriptions. It seems that it is
impossible to redefine inbetween option -- it always produces a \blank.
Try this:

\definedescription[desc][before=before,after=after,inbetween=inbetween,location=top]
\desc{test} test

I've fixed it this way:

--- core-des.tex.orig   2005-06-14 06:56:00.000000000 +0400
+++ core-des.tex        2005-07-14 15:26:20.000000000 +0400
@@ -372,7 +372,8 @@
        \c!indenting,\c!indentnext,\c!align,\c!text,\c!distance,\c!command]%
     \getparameters[\??dd#1]
       [\s!do\c!state=\v!stop,\s!do\c!command=\normal@@descriptionhandler,\c!level=,#2]%
-   \doifvalue{\??dd#1\c!location}\v!top{\doassign[\??dd#1][\c!inbetween=\blank]}%
+   \doifvalue{\??dd#1\c!location}\v!top{%
+     \doifnotvalue{\??dd#1\c!inbetween}{\doassign[\??dd#1][\c!inbetween=\blank]}}%
     \setvalue        {#1}{\dodoubleempty\@@description[#1]}%
     \setvalue{\e!start#1}{\dodoubleempty\@@startdescription[#1]}%
     \setvalue{\e!stop #1}{\@@stopdescription{#1}}}%


And when using commands with brackets in argumets like:

\definedescription[desc][before=\blank[small]]

ConTeXt will give many errors, so arguments needs to be grouped (before={\blank[small]}). 
Is this intentional?


Thanks for your time.

-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 11:43 Not possible to redefine inbetween in \definedescription Radhelorn
@ 2005-07-14 12:45 ` Taco Hoekwater
  2005-07-14 13:53   ` Radhelorn
  2005-07-20 19:58 ` Hans Hagen
  1 sibling, 1 reply; 11+ messages in thread
From: Taco Hoekwater @ 2005-07-14 12:45 UTC (permalink / raw)



Hi,

Radhelorn wrote:
 > ... [bug and fix snipped] ..

Thanks for the bug report.

> And when using commands with brackets in argumets like:
> 
> \definedescription[desc][before=\blank[small]]
> 
> ConTeXt will give many errors, so arguments needs to be grouped 
> (before={\blank[small]}). Is this intentional?

Yes, that is a speed optimization. ConTeXt does not even attempt
to balance the occurrence of [ and ] at top-level, so the explicit
grouping indeed required.

It would be easy to extend ConTeXt to do this, but the speed
penalty would be substantial.

Greetings, Taco

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 12:45 ` Taco Hoekwater
@ 2005-07-14 13:53   ` Radhelorn
  2005-07-14 14:30     ` Taco Hoekwater
  2005-07-14 15:01     ` luigi.scarso
  0 siblings, 2 replies; 11+ messages in thread
From: Radhelorn @ 2005-07-14 13:53 UTC (permalink / raw)


Taco Hoekwater wrote:
>> And when using commands with brackets in argumets like:
>> 
>> \definedescription[desc][before=\blank[small]]
>> 
>> ConTeXt will give many errors, so arguments needs to be grouped 
>> (before={\blank[small]}). Is this intentional?
> 
> 
> Yes, that is a speed optimization. ConTeXt does not even attempt to balance
> the occurrence of [ and ] at top-level, so the explicit grouping indeed
> required.
> 
> It would be easy to extend ConTeXt to do this, but the speed penalty would
> be substantial.
> 

Thanks.
So every command with brackets needs to be grouped? Maybe something else? Where
to look at it?


-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 13:53   ` Radhelorn
@ 2005-07-14 14:30     ` Taco Hoekwater
  2005-07-14 15:08       ` Adam Lindsay
  2005-07-14 15:01     ` luigi.scarso
  1 sibling, 1 reply; 11+ messages in thread
From: Taco Hoekwater @ 2005-07-14 14:30 UTC (permalink / raw)




Radhelorn wrote:
> 
> Thanks.
> So every command with brackets needs to be grouped? Maybe something 
> else? Where to look at it?

I know of nothing else, just brackets. Any bracket, not just as
part of a command, but also in cases like this:

   \setuppublications[left={[}]

Taco

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 13:53   ` Radhelorn
  2005-07-14 14:30     ` Taco Hoekwater
@ 2005-07-14 15:01     ` luigi.scarso
  1 sibling, 0 replies; 11+ messages in thread
From: luigi.scarso @ 2005-07-14 15:01 UTC (permalink / raw)


Radhelorn wrote:

>
> Thanks.
> So every command with brackets needs to be grouped? Maybe something 
> else? Where
> to look at it?
>
>
It's better   grouping with {}  with brackets; there should be nothing else.

luigi

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 14:30     ` Taco Hoekwater
@ 2005-07-14 15:08       ` Adam Lindsay
  2005-07-14 17:25         ` Radhelorn
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Lindsay @ 2005-07-14 15:08 UTC (permalink / raw)


Taco Hoekwater said this at Thu, 14 Jul 2005 16:30:10 +0200:

>> So every command with brackets needs to be grouped? Maybe something 
>> else? Where to look at it?
>
>I know of nothing else, just brackets. Any bracket, not just as
>part of a command, but also in cases like this:
>
>   \setuppublications[left={[}]

Ooh, just remembered: Commas, too. 
\setupitemize[stopper={,}]

and to be sure: "every command with brackets" sounds like you mean
everywhere... this is just amongst parameters.

So: brackets and commas, used as parameter values, need to have
enclosing braces.

If you think of the braces as "quoting" the parameter values, you'll
probably be alright.
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 15:08       ` Adam Lindsay
@ 2005-07-14 17:25         ` Radhelorn
  2005-07-14 17:27           ` Adam Lindsay
  2005-07-14 17:49           ` Christopher Creutzig
  0 siblings, 2 replies; 11+ messages in thread
From: Radhelorn @ 2005-07-14 17:25 UTC (permalink / raw)


Adam Lindsay wrote:
> Taco Hoekwater said this at Thu, 14 Jul 2005 16:30:10 +0200:
> 
> 
>>>So every command with brackets needs to be grouped? Maybe something 
>>>else? Where to look at it?
>>
>>I know of nothing else, just brackets. Any bracket, not just as
>>part of a command, but also in cases like this:
>>
>>  \setuppublications[left={[}]
> 
> 
> Ooh, just remembered: Commas, too. 
> \setupitemize[stopper={,}]
> 
> and to be sure: "every command with brackets" sounds like you mean
> everywhere... this is just amongst parameters.
> 
> So: brackets and commas, used as parameter values, need to have
> enclosing braces.
> 
> If you think of the braces as "quoting" the parameter values, you'll
> probably be alright.

I mean parameter values. Then why not have ConTeXt add braces to every 
parameter? Or there will be slowdown Taco mentioned?


-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 17:25         ` Radhelorn
@ 2005-07-14 17:27           ` Adam Lindsay
  2005-07-14 17:49           ` Christopher Creutzig
  1 sibling, 0 replies; 11+ messages in thread
From: Adam Lindsay @ 2005-07-14 17:27 UTC (permalink / raw)


Radhelorn said this at Thu, 14 Jul 2005 21:25:50 +0400:

>> If you think of the braces as "quoting" the parameter values, you'll
>> probably be alright.
>
>I mean parameter values. Then why not have ConTeXt add braces to every 
>parameter? Or there will be slowdown Taco mentioned?

Sort of. That, I imagine, has more to do with TeX's parser, and the
inability to look ahead.

What if I amend my statement to:

If you think of the braces as "quoting" the parameter values when
necessary or otherwise ambiguous, you'll probably be alright.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 17:25         ` Radhelorn
  2005-07-14 17:27           ` Adam Lindsay
@ 2005-07-14 17:49           ` Christopher Creutzig
  2005-07-15  5:13             ` Radhelorn
  1 sibling, 1 reply; 11+ messages in thread
From: Christopher Creutzig @ 2005-07-14 17:49 UTC (permalink / raw)


Radhelorn wrote:

> I mean parameter values. Then why not have ConTeXt add braces to every 
> parameter? Or there will be slowdown Taco mentioned?

  Exactly.  ConTeXt would need to find out the parameters' boundaries 
first, and that is the place where things would become slow, since it is 
not possible to use TeX's built-in parser for that; it just can't handle 
two different types of balanced brackets at the same time.  Besides, 
you'd still need to quote commas, since \setupitemize[stopper=,] is just 
as valid as \setupitemize[stopper={,}] is, just with a completely 
different meaning.  And while it may be a bit strange, you could even 
set \setupitemize[stopper={, before=abc },after=\blank] – absolutely no 
way of guessing these quotes.


regards,
	Christopher

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 17:49           ` Christopher Creutzig
@ 2005-07-15  5:13             ` Radhelorn
  0 siblings, 0 replies; 11+ messages in thread
From: Radhelorn @ 2005-07-15  5:13 UTC (permalink / raw)


Christopher Creutzig wrote:
> Radhelorn wrote:
> 
>> I mean parameter values. Then why not have ConTeXt add braces to every 
>> parameter? Or there will be slowdown Taco mentioned?
> 
> 
>  Exactly.  ConTeXt would need to find out the parameters' boundaries 
> first, and that is the place where things would become slow, since it is 
> not possible to use TeX's built-in parser for that; it just can't handle 
> two different types of balanced brackets at the same time.  Besides, 
> you'd still need to quote commas, since \setupitemize[stopper=,] is just 
> as valid as \setupitemize[stopper={,}] is, just with a completely 
> different meaning.  And while it may be a bit strange, you could even 
> set \setupitemize[stopper={, before=abc },after=\blank] – absolutely no 
> way of guessing these quotes.
> 
> 
> regards,
>     Christopher
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

Thanks Adam, Christopher, you helped me a lot! It's always hard to 
explain TeXnical things to Word users.

-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: Not possible to redefine inbetween in \definedescription
  2005-07-14 11:43 Not possible to redefine inbetween in \definedescription Radhelorn
  2005-07-14 12:45 ` Taco Hoekwater
@ 2005-07-20 19:58 ` Hans Hagen
  1 sibling, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2005-07-20 19:58 UTC (permalink / raw)


Radhelorn wrote:

>     \getparameters[\??dd#1]
>       
> [\s!do\c!state=\v!stop,\s!do\c!command=\normal@@descriptionhandler,\c!level=,#2]% 
>
> -   
> \doifvalue{\??dd#1\c!location}\v!top{\doassign[\??dd#1][\c!inbetween=\blank]}% 
>
> +   \doifvalue{\??dd#1\c!location}\v!top{%
> +     
> \doifnotvalue{\??dd#1\c!inbetween}{\doassign[\??dd#1][\c!inbetween=\blank]}}% 
>

looks ok to me 

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

end of thread, other threads:[~2005-07-20 19:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-14 11:43 Not possible to redefine inbetween in \definedescription Radhelorn
2005-07-14 12:45 ` Taco Hoekwater
2005-07-14 13:53   ` Radhelorn
2005-07-14 14:30     ` Taco Hoekwater
2005-07-14 15:08       ` Adam Lindsay
2005-07-14 17:25         ` Radhelorn
2005-07-14 17:27           ` Adam Lindsay
2005-07-14 17:49           ` Christopher Creutzig
2005-07-15  5:13             ` Radhelorn
2005-07-14 15:01     ` luigi.scarso
2005-07-20 19:58 ` 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).