ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: itemize start=2
       [not found] <mailman.1.1188381610.30510.ntg-context@ntg.nl>
@ 2007-08-29 17:36 ` Wolfgang Werners-Lucchini
  2007-08-30  5:43   ` Wolfgang Schuster
  2007-08-30  8:12   ` Mojca Miklavec
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfgang Werners-Lucchini @ 2007-08-29 17:36 UTC (permalink / raw)
  To: ntg-context

> > how can I start an itemization with 2
> >
> > I have tried snippets like
> >
> > \setupitemgroup[[itemize][start=2]
> > \startitemize[n]
> > \item zwei
> > \item drei
> > \stopitemize
> >
> > but could'nt found a solution.
> >
> > Btw.: Is there a differenz between
> >
> > \setupitemize[]
> >
> > and
> >
> > \setupitemgroup[[itemize][]
> >
> > Wolfgang
> 
> Hi Wolfgang,
> 
> \setupitemize is only macro for \setupitemgroup[itemize] and is
> generated with \defineitemgroup like many other setup commands.
> 
> To start your enumeration with 2 you have to define your own
> number conversion.
> 
> \def\nextnumber#1{\the\numexpr#1+1\relax}
> 
> \defineconversion[nn][\nextnumber]
> 
> \starttext
> \startitemize[nn]
> \item zwei
> \item drei
> \stopitemize
> \stoptext
> 
> Wolfgang

Hi Wolfgang!

This works!

But two questions remain:

1) I am wondering, how you find such answers. What is your strategie 
searching the sources?
2) What is that existing option 'start' for? Take this as an example 
for question 1). 

Wolfgang  
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: itemize start=2
  2007-08-29 17:36 ` itemize start=2 Wolfgang Werners-Lucchini
@ 2007-08-30  5:43   ` Wolfgang Schuster
  2007-08-30  8:12   ` Mojca Miklavec
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2007-08-30  5:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2007/8/29, Wolfgang Werners-Lucchini <wwl@musensturm.de>:
> > > how can I start an itemization with 2
> > >
> > > I have tried snippets like
> > >
> > > \setupitemgroup[[itemize][start=2]
> > > \startitemize[n]
> > > \item zwei
> > > \item drei
> > > \stopitemize
> > >
> > > but could'nt found a solution.
> > >
> > > Btw.: Is there a differenz between
> > >
> > > \setupitemize[]
> > >
> > > and
> > >
> > > \setupitemgroup[[itemize][]
> > >
> > > Wolfgang
> >
> > Hi Wolfgang,
> >
> > \setupitemize is only macro for \setupitemgroup[itemize] and is
> > generated with \defineitemgroup like many other setup commands.
> >
> > To start your enumeration with 2 you have to define your own
> > number conversion.
> >
> > \def\nextnumber#1{\the\numexpr#1+1\relax}
> >
> > \defineconversion[nn][\nextnumber]
> >
> > \starttext
> > \startitemize[nn]
> > \item zwei
> > \item drei
> > \stopitemize
> > \stoptext
> >
> > Wolfgang
>
> Hi Wolfgang!
>
> This works!
>
> But two questions remain:
>
> 1) I am wondering, how you find such answers. What is your strategie
> searching the sources?

You can the answer in the big manual (cont-enp), it explains the symbols
are defined with \definesymbol and the counters values (n, r, r ... keys)
with \defineconversion.

> 2) What is that existing option 'start' for? Take this as an example
> for question 1).

If I understand the source correct it should begin the itemize with the
level you give with the start value, with the value 2 in your example the
outer itemize group should start with itemlevel 2 and we should get
the dash symbol as item marker but either this did not work I am wrong.

I tried this with the following example but the output off both items
are the same.

\starttext

\startitemize
\item Text
\stopitemize

\setupitemize[start=2]

\startitemize
\item Text
\stopitemize

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: itemize start=2
  2007-08-29 17:36 ` itemize start=2 Wolfgang Werners-Lucchini
  2007-08-30  5:43   ` Wolfgang Schuster
@ 2007-08-30  8:12   ` Mojca Miklavec
  1 sibling, 0 replies; 5+ messages in thread
From: Mojca Miklavec @ 2007-08-30  8:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 8/29/07, Wolfgang Werners-Lucchini wrote:
> > > how can I start an itemization with 2
> > >
> > > I have tried snippets like
> > >
> > > \setupitemgroup[[itemize][start=2]
> > > \startitemize[n]
> > > \item zwei
> > > \item drei
> > > \stopitemize
> > >
> > > but could'nt found a solution.

It looks like a misfeature (ie. bug) to me.

> But two questions remain:
>
> 1) I am wondering, how you find such answers. What is your strategie
> searching the sources?
> 2) What is that existing option 'start' for? Take this as an example
> for question 1).

As far as I can see, 'start' currently serves no purpose since it gets
overridden in line 447 in
    \expanded{\setitemparameter{\itemlevel}{\c!start}{1}}%
in core-itm.tex anyway. Try to comment out that line.

The next problem lies a few lines below:

     \doifelsenothing{\getitemparameter\itemlevel\c!start}
       {\def\currentitemoffset{1}}
       {\def\currentitemoffset{\getitemparameter\itemlevel\c!start}%
        \letitemparameter\itemlevel\c!start\empty}%

You need to say \edef instead of \def, otherwise the empty value will
be used for calculating \currentitemoffset.

How to search? It's difficult to tell, but in this particular case,
you take a look into core-itm.tex (assuming you know where
itemizations are. If you don't, you can execute "grep \setupitem *" in
tex/context/base/.) Then, you search for \c!start and try to figure
out where it is used. You find \setitemlevel. OK, great. What does it
do there? It's supposed to change \currentitemoffset. If you want to
check \currentitemoffset, you simply place
    (my debug: \currentitemoffset)
at the end of \setitemlevel. Now, you either need to copy that
definition on the top of your document (which will override the global
one), or remake the formats with "texexec --make en" before running
texexec on your document again. You will get some extra info on top of
your itemization. It doesn't belong there, but you will remove it
afterwards. (Did I forget to say that it might be wise to make a bacup
of the original file?) Now when you remade the formats (or placed the
definition on top of your file or to cont-new.tex) and compiled the
document again, take a look at the result.

Oh, well, you only get (my debug: ). \currentitemoffset seems to be
empty. Then try to put
     (I wanted to have: \getitemparameter\itemlevel\c!start)
somewhere at the beginning of \setitemlevel, somewhere inbetween
(after \expandex{...}) and somewhere at the end. It works at the
beginning, then it gets reset to 1, and then it gets deleted.
 And they you try to figure out why.

Btw: the two modifications mentioned above don't solve the problem
yet, since you now have a problem with offset +1 (I remember a bug
report from not so long ago, when itemizations started with 0, so that
might be related). But I would better leave that for Hans.
Itemizations are so complex that I don't dare to touch anything there.

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: itemize start=2
  2007-09-06 18:46 ` Wolfgang Werners-Lucchini
@ 2007-09-08 10:29   ` Mojca Miklavec
  0 siblings, 0 replies; 5+ messages in thread
From: Mojca Miklavec @ 2007-09-08 10:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 9/6/07, Wolfgang Werners-Lucchini wrote:
> Hallo!
>
> > > > > I have tried snippets like
> > > > >
> > > > > \setupitemgroup[[itemize][start=2]
> > > > > \startitemize[n]
> > > > > \item zwei
> > > > > \item drei
> > > > > \stopitemize
> > > > >
> > > > > but could'nt found a solution.
> >
> > It looks like a misfeature (ie. bug) to me.
> >
> > > But two questions remain:
> > >
> > > 1) I am wondering, how you find such answers. What is your
> > strategie
> > > searching the sources?
> > > 2) What is that existing option 'start' for? Take this as an
> > example
> > > for question 1).
> >
> > As far as I can see, 'start' currently serves no purpose since it
> > gets
> > overridden in line 447 in
> >     \expanded{\setitemparameter{\itemlevel}{\c!start}{1}}%
> > in core-itm.tex anyway. Try to comment out that line.
> >
> > The next problem lies a few lines below:
> >
> >      \doifelsenothing{\getitemparameter\itemlevel\c!start}
> >        {\def\currentitemoffset{1}}
> >
> > {\def\currentitemoffset{\getitemparameter\itemlevel\c!start}%
> >         \letitemparameter\itemlevel\c!start\empty}%
> >
> > You need to say \edef instead of \def, otherwise the empty value
> > will
> > be used for calculating \currentitemoffset.
> >
> > How to search? It's difficult to tell, but in this particular
> > case,
> > you take a look into core-itm.tex (assuming you know where
> > itemizations are. If you don't, you can execute "grep \setupitem *"
> > in
> > tex/context/base/.) Then, you search for \c!start and try to
> > figure
> > out where it is used. You find \setitemlevel. OK, great. What does
> > it
> > do there? It's supposed to change \currentitemoffset. If you want
> > to check \currentitemoffset, you simply place
> >     (my debug: \currentitemoffset)
> > at the end of \setitemlevel. Now, you either need to copy that
> > definition on the top of your document (which will override the
> > global
> > one), or remake the formats with "texexec --make en" before
> > running
> > texexec on your document again. You will get some extra info on top
> > of your itemization. It doesn't belong there, but you will remove it
> > afterwards. (Did I forget to say that it might be wise to make a
> > bacup
> > of the original file?) Now when you remade the formats (or placed
> > the
> > definition on top of your file or to cont-new.tex) and compiled
> > the
> > document again, take a look at the result.
> >
> > Oh, well, you only get (my debug: ). \currentitemoffset seems to
> > be empty.
>
> If I change the above /def to /edef I get (my debug: 1), but as a
> sideeffect the counter is incremented and therefor is starting with 2
> then.

Yes, that's true.

> > Then try to put
> >      (I wanted to have: \getitemparameter\itemlevel\c!start)
> > somewhere at the beginning of \setitemlevel, somewhere inbetween
> > (after \expandex{...}) and somewhere at the end. It works at the
> > beginning, then it gets reset to 1, and then it gets deleted.
> >  And they you try to figure out why.
>
> \letitemparameter\itemlevel\c!start\empty}
>
> commenting this line has too the above sideeffect that counting is
> started with 2.

Yes, the whole definition should be changed. I only pointed you to the
problematic places, but there is some minor pitfall left. And I don't
dare to touch anything since itemization definitions seem a bit
complex to me.

> But I don't understand the whole thing.
>
> If I understand you right, the c!start is for increasing the
> itemizelevel NOT the numbering. So I wonder why the later is
> affected.

Perhaps the name doesn't fit best, but it seems to me that
"itemizelevel" in that context increases the numbering, not the level
(I might be wrong).

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: itemize start=2
       [not found] <mailman.1.1188468002.4085.ntg-context@ntg.nl>
@ 2007-09-06 18:46 ` Wolfgang Werners-Lucchini
  2007-09-08 10:29   ` Mojca Miklavec
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Werners-Lucchini @ 2007-09-06 18:46 UTC (permalink / raw)
  To: ntg-context

Hallo!

> > > > I have tried snippets like
> > > >
> > > > \setupitemgroup[[itemize][start=2]
> > > > \startitemize[n]
> > > > \item zwei
> > > > \item drei
> > > > \stopitemize
> > > >
> > > > but could'nt found a solution.
> 
> It looks like a misfeature (ie. bug) to me.
> 
> > But two questions remain:
> >
> > 1) I am wondering, how you find such answers. What is your
> strategie
> > searching the sources?
> > 2) What is that existing option 'start' for? Take this as an
> example
> > for question 1).
> 
> As far as I can see, 'start' currently serves no purpose since it
> gets
> overridden in line 447 in
>     \expanded{\setitemparameter{\itemlevel}{\c!start}{1}}%
> in core-itm.tex anyway. Try to comment out that line.
> 
> The next problem lies a few lines below:
> 
>      \doifelsenothing{\getitemparameter\itemlevel\c!start}
>        {\def\currentitemoffset{1}}
>       
> {\def\currentitemoffset{\getitemparameter\itemlevel\c!start}%
>         \letitemparameter\itemlevel\c!start\empty}%
> 
> You need to say \edef instead of \def, otherwise the empty value
> will
> be used for calculating \currentitemoffset.
> 
> How to search? It's difficult to tell, but in this particular
> case,
> you take a look into core-itm.tex (assuming you know where
> itemizations are. If you don't, you can execute "grep \setupitem *"
> in
> tex/context/base/.) Then, you search for \c!start and try to
> figure
> out where it is used. You find \setitemlevel. OK, great. What does
> it
> do there? It's supposed to change \currentitemoffset. If you want
> to check \currentitemoffset, you simply place
>     (my debug: \currentitemoffset)
> at the end of \setitemlevel. Now, you either need to copy that
> definition on the top of your document (which will override the
> global
> one), or remake the formats with "texexec --make en" before
> running
> texexec on your document again. You will get some extra info on top
> of your itemization. It doesn't belong there, but you will remove it
> afterwards. (Did I forget to say that it might be wise to make a
> bacup
> of the original file?) Now when you remade the formats (or placed
> the
> definition on top of your file or to cont-new.tex) and compiled
> the
> document again, take a look at the result.
> 
> Oh, well, you only get (my debug: ). \currentitemoffset seems to
> be empty. 

If I change the above /def to /edef I get (my debug: 1), but as a 
sideeffect the counter is incremented and therefor is starting with 2 
then.

> Then try to put
>      (I wanted to have: \getitemparameter\itemlevel\c!start)
> somewhere at the beginning of \setitemlevel, somewhere inbetween
> (after \expandex{...}) and somewhere at the end. It works at the
> beginning, then it gets reset to 1, and then it gets deleted.
>  And they you try to figure out why.

\letitemparameter\itemlevel\c!start\empty}

commenting this line has too the above sideeffect that counting is 
started with 2.

But I don't understand the whole thing. 

If I understand you right, the c!start is for increasing the 
itemizelevel NOT the numbering. So I wonder why the later is 
affected.

Wolfgang


> Btw: the two modifications mentioned above don't solve the problem
> yet, since you now have a problem with offset +1 (I remember a bug
> report from not so long ago, when itemizations started with 0, so
> that
> might be related). But I would better leave that for Hans.
> Itemizations are so complex that I don't dare to touch anything
> there.
> 
> Mojca

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2007-09-08 10:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1.1188381610.30510.ntg-context@ntg.nl>
2007-08-29 17:36 ` itemize start=2 Wolfgang Werners-Lucchini
2007-08-30  5:43   ` Wolfgang Schuster
2007-08-30  8:12   ` Mojca Miklavec
     [not found] <mailman.1.1188468002.4085.ntg-context@ntg.nl>
2007-09-06 18:46 ` Wolfgang Werners-Lucchini
2007-09-08 10:29   ` Mojca Miklavec

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