ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Clean way of doing certain kind of outline?
       [not found] <20010306222412.6125.qmail@web10710.mail.yahoo.com>
@ 2001-03-07  6:10 ` Berend de Boer
  2001-03-07  8:10   ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Berend de Boer @ 2001-03-07  6:10 UTC (permalink / raw)


James Ramsey wrote:

> BTW, how do I define a macro with an *optional*
> argument in brackets (not just a mandatory argument in
> brackets--I know how to do that).

\def\mymacro%
   {\dosingleempty\domymacro}

\def\domymacro[#1]%
   {My optional #1 argument}

Groetjes,

Berendn. (-:


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

* Re: Clean way of doing certain kind of outline?
  2001-03-07  6:10 ` Clean way of doing certain kind of outline? Berend de Boer
@ 2001-03-07  8:10   ` Hans Hagen
  2001-03-07 18:37     ` James Ramsey
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2001-03-07  8:10 UTC (permalink / raw)
  Cc: ConTeXT Mailing List

At 07:10 AM 3/7/01 +0100, Berend de Boer wrote:
>James Ramsey wrote:
>
>
>> BTW, how do I define a macro with an *optional*
>> argument in brackets (not just a mandatory argument in
>> brackets--I know how to do that).
>
>\def\mymacro%
>   {\dosingleempty\domymacro}
>
>\def\domymacro[#1]%
>   {My optional #1 argument}

there is also an associated test:  

\def\domymacro[#1]%
  {\iffirstargument
      No argument
   \else
      Berends optional #1 argument
   \fi}

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: Clean way of doing certain kind of outline?
  2001-03-07  8:10   ` Hans Hagen
@ 2001-03-07 18:37     ` James Ramsey
  2001-03-08  7:58       ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: James Ramsey @ 2001-03-07 18:37 UTC (permalink / raw)


--- Hans Hagen <pragma@wxs.nl> wrote:
> At 07:10 AM 3/7/01 +0100, Berend de Boer wrote:
> >James Ramsey wrote:
> >
> >
> >> BTW, how do I define a macro with an *optional*
> >> argument in brackets (not just a mandatory
> argument in
> >> brackets--I know how to do that).
> >
> >\def\mymacro%
> >   {\dosingleempty\domymacro}
> >
> >\def\domymacro[#1]%
> >   {My optional #1 argument}
>  
> there is also an associated test:  
> 
> \def\domymacro[#1]%
>   {\iffirstargument
>       No argument
>    \else
>       Berends optional #1 argument
>    \fi}

Thanks. BTW, do you know if ConTeXt has either a
built-in way or at least a not too klunky way of doing
an outline like:

1.0 Foo
    1.1 Foobar
    1.2 Foobaz
2.0 Misc
    2.1 Miscellaneous
    2.2 Miscreant
        2.2.1 Fancy term for criminal
        2.2.2 Sounds funny

So far, the only way I can think of to do it is to
define an elaborate macro to put in the argument to
startitemize/stopitemize's "\sym" (which is why I
asked how to do an optional argument).

=====

----I am a fool for Christ. Mostly I am a fool.----

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/


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

* Re: Clean way of doing certain kind of outline?
  2001-03-07 18:37     ` James Ramsey
@ 2001-03-08  7:58       ` Hans Hagen
  2001-03-08 16:23         ` James Ramsey
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2001-03-08  7:58 UTC (permalink / raw)
  Cc: ntg-context

At 10:37 AM 3/7/01 -0800, James Ramsey wrote:

>Thanks. BTW, do you know if ConTeXt has either a
>built-in way or at least a not too klunky way of doing
>an outline like:
>
>1.0 Foo
>    1.1 Foobar
>    1.2 Foobaz
>2.0 Misc
>    2.1 Miscellaneous
>    2.2 Miscreant
>        2.2.1 Fancy term for criminal
>        2.2.2 Sounds funny
>
>So far, the only way I can think of to do it is to
>define an elaborate macro to put in the argument to
>startitemize/stopitemize's "\sym" (which is why I
>asked how to do an optional argument).

Is this an automatically generated list (toc) or a manually composed one
(in which case enumerations can handle it) ? 

Hans  
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: Clean way of doing certain kind of outline?
  2001-03-08  7:58       ` Hans Hagen
@ 2001-03-08 16:23         ` James Ramsey
  2001-03-08 17:01           ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: James Ramsey @ 2001-03-08 16:23 UTC (permalink / raw)


--- Hans Hagen <pragma@wxs.nl> wrote:
> At 10:37 AM 3/7/01 -0800, James Ramsey wrote:
>  
> >Thanks. BTW, do you know if ConTeXt has either a
> >built-in way or at least a not too klunky way of
> doing
> >an outline like:
> >
> >1.0 Foo
> >    1.1 Foobar
> >    1.2 Foobaz
> >2.0 Misc
> >    2.1 Miscellaneous
> >    2.2 Miscreant
> >        2.2.1 Fancy term for criminal
> >        2.2.2 Sounds funny
> >
> >So far, the only way I can think of to do it is to
> >define an elaborate macro to put in the argument to
> >startitemize/stopitemize's "\sym" (which is why I
> >asked how to do an optional argument).
> 
> Is this an automatically generated list (toc) or a
> manually composed one
> (in which case enumerations can handle it) ? 

It's manual. How would enumerations be able to handle
it? They can do the numbering, I know (at least four
levels deep) but what about the indenting?

=====

----I am a fool for Christ. Mostly I am a fool.----

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/


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

* Re: Clean way of doing certain kind of outline?
  2001-03-08 16:23         ` James Ramsey
@ 2001-03-08 17:01           ` Hans Hagen
  2001-03-09  1:47             ` James Ramsey
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2001-03-08 17:01 UTC (permalink / raw)
  Cc: ntg-context

At 08:23 AM 3/8/01 -0800, you wrote:
>
>--- Hans Hagen <pragma@wxs.nl> wrote:
>> At 10:37 AM 3/7/01 -0800, James Ramsey wrote:
>>  
>> >Thanks. BTW, do you know if ConTeXt has either a
>> >built-in way or at least a not too klunky way of
>> doing
>> >an outline like:
>> >
>> >1.0 Foo
>> >    1.1 Foobar
>> >    1.2 Foobaz
>> >2.0 Misc
>> >    2.1 Miscellaneous
>> >    2.2 Miscreant
>> >        2.2.1 Fancy term for criminal
>> >        2.2.2 Sounds funny
>> >
>> >So far, the only way I can think of to do it is to
>> >define an elaborate macro to put in the argument to
>> >startitemize/stopitemize's "\sym" (which is why I
>> >asked how to do an optional argument).
>> 
>> Is this an automatically generated list (toc) or a
>> manually composed one
>> (in which case enumerations can handle it) ? 
>
>It's manual. How would enumerations be able to handle
>it? They can do the numbering, I know (at least four
>levels deep) but what about the indenting?

\defineenumeration[LikeThis][location=left,before=,after=,text=]

\setupenumerations[LikeThis]      [width=2em]
\setupenumerations[subLikeThis]   [width=3em,margin=2em]
\setupenumerations[subsubLikeThis][width=4em,margin=5em]

\startbuffer
\startLikeThis some text \stopLikeThis
\startsubLikeThis some more text \stopsubLikeThis
\startsubLikeThis some more text \stopsubLikeThis
\startsubLikeThis some more text \stopsubLikeThis
\startsubsubLikeThis some more text \stopsubLikeThis
\startsubsubLikeThis some more text \stopsubLikeThis
\startsubsubLikeThis some more text \stopsubLikeThis
\startsubLikeThis some more text \stopsubLikeThis
\startsubLikeThis some more text \stopsubLikeThis
\startsubLikeThis some more text \stopsubLikeThis
\stopbuffer

\dorecurse{3}{\getbuffer}

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: Clean way of doing certain kind of outline?
  2001-03-08 17:01           ` Hans Hagen
@ 2001-03-09  1:47             ` James Ramsey
  2001-03-09  8:00               ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: James Ramsey @ 2001-03-09  1:47 UTC (permalink / raw)


--- Hans Hagen <pragma@wxs.nl> wrote:
> At 08:23 AM 3/8/01 -0800, you wrote:
> >
> >--- Hans Hagen <pragma@wxs.nl> wrote:
>
>\defineenumeration[LikeThis][location=left,before=,after=,text=]
> 
> \setupenumerations[LikeThis]      [width=2em]
> \setupenumerations[subLikeThis]  
> [width=3em,margin=2em]
>
\setupenumerations[subsubLikeThis][width=4em,margin=5em]
> 
> \startbuffer
> \startLikeThis some text \stopLikeThis
> \startsubLikeThis some more text \stopsubLikeThis
> \startsubLikeThis some more text \stopsubLikeThis
> \startsubLikeThis some more text \stopsubLikeThis
> \startsubsubLikeThis some more text \stopsubLikeThis
> \startsubsubLikeThis some more text \stopsubLikeThis
> \startsubsubLikeThis some more text \stopsubLikeThis
> \startsubLikeThis some more text \stopsubLikeThis
> \startsubLikeThis some more text \stopsubLikeThis
> \startsubLikeThis some more text \stopsubLikeThis
> \stopbuffer
> 
> \dorecurse{3}{\getbuffer}

The above worked rather well. About the only thing
missing is the ".0" after the first level outline
entry. I tried the following:

\setupenumerations[LikeThis]
[width=2em,stopper=.0]
\setupenumerations[subLikeThis]
[width=3em,margin=2em,stopper=]
\setupenumerations[subsubLikeThis]
[width=4em,margin=5em,stopper=]

but the stopper ended up being ".0" after all the
numbers. The "stopper=" line entry for subLikeThis and
subsubLikeThis was apparently ignored. (Actually, I
have the same problem with "headstyle")

=====

----I am a fool for Christ. Mostly I am a fool.----

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/


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

* Re: Clean way of doing certain kind of outline?
  2001-03-09  1:47             ` James Ramsey
@ 2001-03-09  8:00               ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2001-03-09  8:00 UTC (permalink / raw)
  Cc: ntg-context

At 05:47 PM 3/8/01 -0800, James Ramsey wrote:

>but the stopper ended up being ".0" after all the
>numbers. The "stopper=" line entry for subLikeThis and
>subsubLikeThis was apparently ignored. (Actually, I

Ok, i'll patch it. For the moment use: right= (if this fails i'll send you
a new file)

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Clean way of doing certain kind of outline?
@ 2001-03-06  2:02 James Ramsey
  0 siblings, 0 replies; 9+ messages in thread
From: James Ramsey @ 2001-03-06  2:02 UTC (permalink / raw)


I am being asked to do an outline with numbering that
looks like the following:

1.0 Foo
    1.1 Foobar
    1.2 Foobaz
2.0 Misc
    2.1 Miscellaneous
    2.2 Miscreant
        2.2.1 Fancy term for criminal
        2.2.2 Sounds funny

This looks like it might be a job for some kind of
enumeration or something, but I was wondering what
would be most appropriate. The numbers in the outline
should be cross-referenceable.

=====

----I am a fool for Christ. Mostly I am a fool.----

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/


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

end of thread, other threads:[~2001-03-09  8:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20010306222412.6125.qmail@web10710.mail.yahoo.com>
2001-03-07  6:10 ` Clean way of doing certain kind of outline? Berend de Boer
2001-03-07  8:10   ` Hans Hagen
2001-03-07 18:37     ` James Ramsey
2001-03-08  7:58       ` Hans Hagen
2001-03-08 16:23         ` James Ramsey
2001-03-08 17:01           ` Hans Hagen
2001-03-09  1:47             ` James Ramsey
2001-03-09  8:00               ` Hans Hagen
2001-03-06  2:02 James Ramsey

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