Am 05.09.2026 um 16:32 schrieb Jim Diamond via ntg-context:
Hi all,

If I have

\setupwhitespace[big]

...

Labs:
\startitemize[nowhite,a]
   \item black
   \item chocolate
   \item yellow
\stopitemize

then the "Labs:" line is immediately followed by the "black" item, as
desired (in this case).

But if the list is a sub-list, as in the example below, there is a blank
line after "Labs:".

I have tried a variety of different options, all to no avail.  As a
work-around, if I make the outer list "packed" and put a \blank after the
last item in each sub-list, I get what I want.

But is there a set of options which automagically packs the sub-lists (and
the text above them) together but separates the sub-lists by blank lines?
Context use the value of the inbetween key at the begin and end of sub lists unless you change this behaviour with the spacing=before option. The following example demonstrates how you can use the packed option and the before and after key to change the spacing in the list.

%%%% begin example
\define[1]\HighlightParameter
  {\leftaligned{\tttf\middlecyan [#1]}}

\starttext

\startbuffer[itemize]
\startitemize
  \startitem Item 1 \stopitem
  \startitem
    Item 2
    \startitemize
      \startitem Item 2.1 \stopitem
      \startitem Item 2.2 \stopitem
    \stopitemize
  \stopitem
  \startitem Item 3 \stopitem
\stopitemize
\stopbuffer

\startbuffer[packed]
\setupitemize[1][packed]
\setupitemize[2][unpacked]
\stopbuffer

\startbuffer[spacing]
\setupitemize[1][spacing=before]
\stopbuffer

\startbuffer[combined]
\setupitemize[1][packed][spacing=before]
\setupitemize[2][unpacked]
\stopbuffer

\startbuffer[disable]
\setupitemize[1][packed][before=,after=]
\setupitemize[2][unpacked]
\stopbuffer

\setupitemize
  [before=\HighlightParameter{before},
   after=\HighlightParameter{after},
   inbetween=\HighlightParameter{inbetween}]

\start
\typebuffer[itemize] \getbuffer[itemize]
\stop

\page

\start
\typebuffer[packed,itemize] \getbuffer[packed,itemize]
\stop

\page

\start
\typebuffer[spacing,itemize] \getbuffer[spacing,itemize]
\stop

\page

\start
\typebuffer[combined,itemize] \getbuffer[combined,itemize]
\stop

\page

\start
\typebuffer[disable,itemize] \getbuffer[disable,itemize]
\stop

\stoptext
%%%% end example

You should also consider to use head entries insted of normal item entries for you first level as shown in your example.

%%%% begin example
\starttext

\startitemize[a][afterhead={\blank[nowhite,disable]}]
  \starthead{Item}
    \startitemize[a]
      \startitem Subitem \stopitem
    \stopitemize
  \stophead
\stopitemize

\stoptext
%%%% end example

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

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to