ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Description nesting
@ 2006-05-05 11:09 nico
  2006-05-05 23:40 ` Aditya Mahajan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: nico @ 2006-05-05 11:09 UTC (permalink / raw)


Hello,

Is there a way to nest some descriptions, where the nested descriptions  
respect the enclosing indentation?

Funnily the wiki speaks about the subject  
(http://wiki.contextgarden.net/Description) but doesn't give any solution  
(btw, the given solution to have several paragraphs in a description looks  
obsolete since \start \stop works pretty well).

Here is an example that I would like to see working:

\definedescription[descr][
   headstyle=bold,style=normal,align=left,location=hanging,
   width=broad,margin=1cm]

\setupwhitespace[medium]

\starttext

\startdescr{Para}
   This is a shorter item label, and some text that talks about it.
   The text is wrapped into a paragraph, with successive lines indented.

   This is another paragraph under the "Para" item.

   \startdescr{SubPara1}
   This is a shorter item label, and some text that talks about it.
   The text is wrapped into a paragraph, with successive lines indented.
   \stopdescr
   \startdescr{SubPara2}
   This is a shorter item label, and some text that talks about it.
   The text is wrapped into a paragraph, with successive lines indented.
   \stopdescr
\stopdescr

\stoptext

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

* Re: Description nesting
  2006-05-05 11:09 Description nesting nico
@ 2006-05-05 23:40 ` Aditya Mahajan
  2006-05-06  8:29 ` Hans Hagen
  2006-05-06  8:30 ` Hans Hagen
  2 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2006-05-05 23:40 UTC (permalink / raw)


On Fri, 5 May 2006, nico wrote:

> Hello,
>
> Is there a way to nest some descriptions, where the nested descriptions
> respect the enclosing indentation?
>
> Funnily the wiki speaks about the subject
> (http://wiki.contextgarden.net/Description) but doesn't give any solution
> (btw, the given solution to have several paragraphs in a description looks
> obsolete since \start \stop works pretty well).
>
> Here is an example that I would like to see working:
>
> \definedescription[descr][
>   headstyle=bold,style=normal,align=left,location=hanging,
>   width=broad,margin=1cm]

Try,

  \definedescription[descr][
     headstyle=bold,style=normal,align=left,location=hanging,
     width=broad,margin=2em, before=\doMySetup]

  \def\doMySetup{
     \setupdescriptions[descr]
     [before=\startnarrower,after=\stopnarrower]}


>
> \setupwhitespace[medium]
>
> \starttext
>
> \startdescr{Para}
>   This is a shorter item label, and some text that talks about it.
>   The text is wrapped into a paragraph, with successive lines indented.
>
>   This is another paragraph under the "Para" item.
>
>   \startdescr{SubPara1}
>   This is a shorter item label, and some text that talks about it.
>   The text is wrapped into a paragraph, with successive lines indented.
>   \stopdescr
>   \startdescr{SubPara2}
>   This is a shorter item label, and some text that talks about it.
>   The text is wrapped into a paragraph, with successive lines indented.
>   \stopdescr
> \stopdescr
>
> \stoptext



-- 
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008

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

* Re: Description nesting
  2006-05-05 11:09 Description nesting nico
  2006-05-05 23:40 ` Aditya Mahajan
@ 2006-05-06  8:29 ` Hans Hagen
  2006-05-06 22:30   ` nico
  2006-05-06  8:30 ` Hans Hagen
  2 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2006-05-06  8:29 UTC (permalink / raw)


nico wrote:
> Hello,
>
> Is there a way to nest some descriptions, where the nested descriptions  
> respect the enclosing indentation?
>
> Funnily the wiki speaks about the subject  
> (http://wiki.contextgarden.net/Description) but doesn't give any solution  
> (btw, the given solution to have several paragraphs in a description looks  
> obsolete since \start \stop works pretty well).
>   
you can play with this patch

\setvalue{@@description\v!hanging}[#1]#2%
  {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}% % adds \c!margin to 
\leftskip
   \noindent\ignorespaces
   \advance\leftskip -\leftskipadaption \relax
   \ifdim\leftskipadaption=\zeropoint
     \leftskipadaption1.5em % just some default
     \ifnum\insidedefinition=\plusone
       \ifdim\leftskip>\zeropoint \relax
         \leftskipadaption\leftskip
       \fi
     \fi
   \fi
   \ifnum\insidedefinition>\zerocount
     \advance\leftskip \leftskipadaption
   \fi
   \hskip-\leftskipadaption
   \ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox
   \kern\ifdim\!!widthb=\zeropoint .75em\else\!!widthb\fi
   \ignorespaces
   \@@dodescription}

> Here is an example that I would like to see working:
>
> \definedescription[descr][
>    headstyle=bold,style=normal,align=left,location=hanging,
>    width=broad,margin=1cm]
>
> \setupwhitespace[medium]
>
> \starttext
>
> \startdescr{Para}
>    This is a shorter item label, and some text that talks about it.
>    The text is wrapped into a paragraph, with successive lines indented.
>
>    This is another paragraph under the "Para" item.
>
>    \startdescr{SubPara1}
>    This is a shorter item label, and some text that talks about it.
>    The text is wrapped into a paragraph, with successive lines indented.
>    \stopdescr
>    \startdescr{SubPara2}
>    This is a shorter item label, and some text that talks about it.
>    The text is wrapped into a paragraph, with successive lines indented.
>    \stopdescr
> \stopdescr
>
> \stoptext
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   


-- 

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

* Re: Description nesting
  2006-05-05 11:09 Description nesting nico
  2006-05-05 23:40 ` Aditya Mahajan
  2006-05-06  8:29 ` Hans Hagen
@ 2006-05-06  8:30 ` Hans Hagen
  2006-05-06 22:41   ` nico
  2 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2006-05-06  8:30 UTC (permalink / raw)


nico wrote:
> Hello,
>
> Is there a way to nest some descriptions, where the nested descriptions  
> respect the enclosing indentation?
>   
btw, we need some test files for descriptions in the test-suite 

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

* Re: Description nesting
  2006-05-06  8:29 ` Hans Hagen
@ 2006-05-06 22:30   ` nico
  0 siblings, 0 replies; 6+ messages in thread
From: nico @ 2006-05-06 22:30 UTC (permalink / raw)


On Sat, 06 May 2006 10:29:56 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> nico wrote:
>> Hello,
>>
>> Is there a way to nest some descriptions, where the nested descriptions
>> respect the enclosing indentation?
>>
> you can play with this patch

Ok, it works fine, thanks! It also makes the indentation of a hanging  
description put in an itemize more consistent.

BTW, I wonder if it should not be also applied to location=left.

Regards,
BG

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

* Re: Description nesting
  2006-05-06  8:30 ` Hans Hagen
@ 2006-05-06 22:41   ` nico
  0 siblings, 0 replies; 6+ messages in thread
From: nico @ 2006-05-06 22:41 UTC (permalink / raw)


On Sat, 06 May 2006 10:30:24 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> nico wrote:
>> Hello,
>>
>> Is there a way to nest some descriptions, where the nested descriptions
>> respect the enclosing indentation?
>>
> btw, we need some test files for descriptions in the test-suite

I've added two tests under core-des.tex/, one about basic combination of  
location and width options, the other about the footnotes.

Regards,
BG

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

end of thread, other threads:[~2006-05-06 22:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-05 11:09 Description nesting nico
2006-05-05 23:40 ` Aditya Mahajan
2006-05-06  8:29 ` Hans Hagen
2006-05-06 22:30   ` nico
2006-05-06  8:30 ` Hans Hagen
2006-05-06 22:41   ` nico

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