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:
Used ConTeXt version is 2013.05.28 00:36
.
Best Answer
ConTeXt does remove such spaces when you use nested itemize, for example
but there is no high level interface for this. However, it is easy to provide a wrapper around the low level commands
and then use
Unfortunately, you cannot use
because the
before
is triggered too late in\startitemize
. For automatically workflow, you can define your own description rendering setup.which gives
For no vertical space, simply add