[Tex/LaTex] Remove the space above/below itemizes and descriptions

contextdescriptionitemizelistsspacing

In the document below an itemize is nested in a description and I want to have no vertical space between the entries.

I removed the space above and below of itemizes and descriptions using \vskip-\parskip, but this might not be the right way. And it does not work if the itemize is the first content inside a description.

I tried to use the joinedup and nowhite as shown here, but then the spacing still exists.

How to remove the space above/below itemizes and descriptions?

Code:

\definedescription[description][
    alternative=left,
    width=2em,
    before={\vskip-\parskip},  %<<< ?
    after={\vskip-\parskip},   %<<< ?
]

\setupitemize[each][packed][   % [joinedup,nowhite] don't change spacing
    before={\vskip-\parskip},  %<<< ?
    after={\vskip-\parskip},   %<<< ?
]

\starttext

    \startdescription{Foo}
        \input knuth
    \stopdescription

    \startdescription{Bar}
        \startitemize
        \item ↑ Too much space above ↑
        \item Just some Text
        \item Just some Text
        \stopitemize
    \stopdescription

    \startdescription{Baz}
        A line that contains some text. A line that contains some text. A line that contains some text. 
        \startitemize
        \item Just some Text
        \item Just some Text
        \item Just some Text
        \stopitemize
        A line that contains some text. A line that contains some text. A line that contains some text. 
    \stopdescription

\stoptext

Result:

output document

Used ConTeXt version is 2013.05.28 00:36.

Best Answer

ConTeXt does remove such spaces when you use nested itemize, for example

\startitemize
  \item 
    \startitemize
      \item One
      \item Two
    \stopitemize
\stopitemize

but there is no high level interface for this. However, it is easy to provide a wrapper around the low level commands

\unprotect
\define\concatitemgroup{\hskip\d_strc_itemgroups_signal}
\protect

and then use

\startdescription{Bar}
  \concatitemgroup
  \startitemize
    \item ↑ Too much space above ↑
    \item Just some Text
    \item Just some Text
  \stopitemize
\stopdescription

Unfortunately, you cannot use

\startitemize[before=\concatitemgroup]

because the before is triggered too late in \startitemize. For automatically workflow, you can define your own description rendering setup.

\unprotect
\startsetups[\??constructionrenderings:leftconcat]
    \directsetup{\??constructionrenderings:\v!left:\v!none}
    \hskip\d_strc_itemgroups_signal
\stopsetups

\defineconstructionalternative
  [leftconcat]
  [\c!renderingsetup=\??constructionrenderings:leftconcat]

\def\concatitemgroup{\hskip\d_strc_itemgroups_signal}

\protect

\definedescription
  [description]
  [
    alternative=leftconcat,
    width=2em,
  ]

\setupitemize[packed]

\starttext
    \startdescription{Bar}
      \startitemize
        \item ↑ Too much space above ↑
        \item Just some Text
        \item Just some Text
      \stopitemize
    \stopdescription

    \startdescription{Baz}
        A line that contains some text. A line that contains some text. A line that contains some text. 
        \startitemize
        \item Just some Text
        \item Just some Text
        \item Just some Text
        \stopitemize
        A line that contains some text. A line that contains some text. A line that contains some text. 
    \stopdescription
  \stoptext

which gives

enter image description here

For no vertical space, simply add

\setupitemize[nowhite]
Related Question