About 'repeat' option of \startitemize
Hello All!
A while ago Hans introduced 'repeat' option for \startitemize to make
nested items. I've decided to give it a try:
\startitemize[repeat]
\item item1
\startitemize
\item item1.1
\item item1.2
\item item1.3
\stopitemize
\item
\startitemize
\item item2.1
\item item2.2
\item item2.3
\item item2.4
\stopitemize
\stopitemize
gives:
1. item1
1. item1.1
2.2. item1.2
3.3. item1.3
2.1. item2.1
2.2. item2.2
3.3. item2.3
4.4. item2.4
should:
1. item1
1.1. item1.1
1.2. item1.2
1.3. item1.3
2.1. item2.1
2.2. item2.2
2.3. item2.3
2.4. item2.4
From my observations of mysterious box manipulations in core-itm I
think that fix for repeating first digit can be as simple as removing
one of these \plusone's somewhere. But it is possible to make both 1.1
and 2.1 work as in my example?
And it seems that space after dot in nested lists is slightly bigger. Is
this intentional?
--
Radhelorn
Radhelorn wrote:
Hello All! A while ago Hans introduced 'repeat' option for \startitemize to make nested items. I've decided to give it a try:
next time give it a try when i just made it; it took some time to figure out what was wrong (rather tricky code) \unprotect \def\checkforrepeatedlistitem {\ifnum\itemlevel=\plusone \initializeboxstack{item}% \fi \ifconditional\repeatlistitem \savebox{item}{\itemlevel}{\hbox{\copy8}}% \setbox8\hbox to \wd8 {\setbox\scratchbox\hbox {\scratchcounter\itemlevel \advance\scratchcounter\minusone \dorecurse\scratchcounter{\foundbox{item}{\recurselevel}}}% \ifnum\itemlevel>\plusone \ifdim\wd\scratchbox>\zeropoint \hskip-\dimen2 \box\scratchbox \fi \fi \box8 }% \fi} \showframe \starttext \startbuffer \item \startitemize[n] \item item 1.1 \item item 1.2 \startitemize[n] \item item 1.2.1 \item item 1.2.2 \stopitemize \item item 1.3 \stopitemize \item \startitemize[n] \item item 2.1 \item item 2.2 \stopitemize \item item 3 \startitemize[n] \item item 3.1 \item item 3.2 \stopitemize \item \startitemize[n] \item item 4.1 \item item 4.2 \stopitemize \stopbuffer \startitemize[n,repeat,6*broad,packed] \getbuffer \stopitemize \blank[3*big] \startitemize[n,repeat,packed] \getbuffer \stopitemize \blank[3*big] \setupitemize[each][atmargin][width=3em] \startitemize[n,repeat,packed] \getbuffer \stopitemize \stoptext
Hans Hagen wrote:
Radhelorn wrote:
Hello All! A while ago Hans introduced 'repeat' option for \startitemize to make nested items. I've decided to give it a try:
next time give it a try when i just made it; it took some time to figure out what was wrong (rather tricky code)
Thanks! Soon you will be fixing bugs even earlier than we will be
noticing them!
But there is another problem. When using itemize without repeat option
indentation is right, but with this option indentation (both before
number and after number) of nested items is different for different levels:
1. item
1.1 item
1.2.1 item
1.2.1.1.item
1.2.2.1em
Something needs to be done with this, but I'm afraid that this will
complicate macros even more.
--
Radhelorn
Radhelorn wrote:
Hans Hagen wrote:
Radhelorn wrote:
Hello All! A while ago Hans introduced 'repeat' option for \startitemize to make nested items. I've decided to give it a try:
next time give it a try when i just made it; it took some time to figure out what was wrong (rather tricky code)
Thanks! Soon you will be fixing bugs even earlier than we will be noticing them!
But there is another problem. When using itemize without repeat option indentation is right, but with this option indentation (both before number and after number) of nested items is different for different levels:
1. item 1.1 item 1.2.1 item 1.2.1.1.item 1.2.2.1em
for that you can best set up a dedicated instance of itemize (defineitemgroup) and assign the right widths to the levels Hans
Hans Hagen wrote:
Radhelorn wrote:
1. item 1.1 item 1.2.1 item 1.2.1.1.item 1.2.2.1em
for that you can best set up a dedicated instance of itemize (defineitemgroup) and assign the right widths to the levels
I'm sorry to disturb you with my endless requests but it seems that
options of itemgroups is not interact properly.
I've tried as you suggested this way:
\defineitemgroup[myitemize]
\setupitemgroup[myitemize][n,width=4em]
\startmyitemize
\item item 1
\item item 2
\stopmyitemize
It gives many "missing or ungrouped '=' after 'n'" messages and changes
item symbol to default dot. I've also tried n=1 or n=2 (seen in the
sources). This gives same result, but without error message.
Thanks for your patience.
--
Radhelorn
Radhelorn wrote:
Hans Hagen wrote:
Radhelorn wrote:
1. item 1.1 item 1.2.1 item 1.2.1.1.item 1.2.2.1em
for that you can best set up a dedicated instance of itemize (defineitemgroup) and assign the right widths to the levels
I'm sorry to disturb you with my endless requests but it seems that options of itemgroups is not interact properly.
I've tried as you suggested this way:
\defineitemgroup[myitemize] \setupitemgroup[myitemize][n,width=4em]
\setupitemgroup[myitemize][each][width=4em] \setupitemgroup[myitemize][each][n]
\startmyitemize \item item 1 \item item 2 \stopmyitemize
It gives many "missing or ungrouped '=' after 'n'" messages and changes item symbol to default dot. I've also tried n=1 or n=2 (seen in the sources). This gives same result, but without error message.
Thanks for your patience.
Hans Hagen wrote:
\defineitemgroup[myitemize] \setupitemgroup[myitemize][n,width=4em]
\setupitemgroup[myitemize][each][width=4em] \setupitemgroup[myitemize][each][n]
Thanks. This will do for a time. Actually I have another observation in
behaviour of 'repeat' option but will try to experiment with this a
little more. This itm module is too elaborate.
--
Radhelorn
participants (2)
-
Hans Hagen
-
Radhelorn