ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: About 'repeat' option of \startitemize
Date: Wed, 21 Dec 2005 14:17:41 +0100	[thread overview]
Message-ID: <43A955F5.3080805@wxs.nl> (raw)
In-Reply-To: <43A91277.4010707@mail.ru>

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

  reply	other threads:[~2005-12-21 13:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-21  8:29 Radhelorn
2005-12-21 13:17 ` Hans Hagen [this message]
2005-12-21 17:29   ` Radhelorn
2005-12-21 18:06     ` Hans Hagen
2005-12-22 20:49       ` Radhelorn
2005-12-22 21:10         ` Hans Hagen
2005-12-22 21:41           ` Radhelorn
2006-01-04 19:12             ` Radhelorn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43A955F5.3080805@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).