[NTG-context] Spacing issue in itemize

Gavin gavinpublic at comcast.net
Thu Jan 13 22:32:31 CET 2022


Thank you again, Aditya!

I changed my documents so I use three levels of question, which solved the problem.

My code might be more readable if the different levels had different names (question, part, subpart), rather than nested questions in questions. This was my original intention. I was certainly surprised by the result.

Now I’m moving on to the problem set's diagrams with MetaFun.

Gavin


> On Jan 13, 2022, at 10:15 AM, Aditya Mahajan via ntg-context <ntg-context at ntg.nl> wrote:
> 
> On Thu, 13 Jan 2022, Gavin via ntg-context wrote:
> 
>> Hi list,
>> 
>> When I define an items group, it seems to mess up the spacing for a nested item group. See example below. Any ideas?
>> 
>> I’m typesetting with
>> 
>> 	> ConTeXt  ver: 2022.01.06 19:51 LMTX  fmt: 2022.1.9  int: english/english
>> 
>> on an M1 Mac.
>> 
>> Thanks!
>> Gavin
>> 
>> 
>> \usemodule[visual]
>> 
>> \defineitemgroup[questions]
>> \setupquestions [each] [n]
>> 
>> \starttext
>> This numbered list uses my item group \quotation{questions.} The itemize inside is missing space above item (a).
>> \startquestions
>>  \item \fakewords{15}{20}
>>    \startitemize[a][left=(,stopper=,right=)]
>>      \item \fakewords{10}{15}
>>      \item \fakewords{10}{15}
>>    \stopitemize
>>  \item \fakewords{10}{15}
>> \stopquestions
>> 
>> This numbered list uses itemize. The itemize inside has the expected space above item (a).
>> \startitemize[n]
>>  \item \fakewords{15}{20}
>>    \startitemize[a][left=(,stopper=,right=)]
>>      \item \fakewords{10}{15}
>>      \item \fakewords{10}{15}
>>    \stopitemize
>>  \item \fakewords{10}{15}
>> \stopitemize
>> 
>> \stoptext
> 
> This is by design. This is what is happening:
> 
> \usemodule[visual]
> 
> \defineitemgroup[questions]
> 
> \starttext
> This numbered list uses my item group \quotation{questions.} The itemize inside is missing space above item (a).
> \startquestions[n][inbetween={AAA}]
>  \item \fakewords{15}{20}
>    \startitemize[a][left=(,stopper=,right=),before={BBB}]
>      \item \fakewords{10}{15}
>      \item \fakewords{10}{15}
>    \stopitemize
>  \item \fakewords{10}{15}
> \stopquestions
> 
> This numbered list uses itemize. The itemize inside has the expected space above item (a).
> \startitemize[n][inbetween={AAA}]
>  \item \fakewords{15}{20}
>    \startitemize[a][left=(,stopper=,right=),before={BBB}]
>      \item \fakewords{10}{15}
>      \item \fakewords{10}{15}
>    \stopitemize
>  \item \fakewords{10}{15}
> \stopitemize
> 
> \stoptext
> 
> Note that in the first case, the inbetween does not get inserted at the start of the nested itemization (because, ConTeXt doesn't think that they are nested as the names are different). But the before key of the nested itemization doesn't get inserted in both cases because ConTeXt thinks that the itemization is nested!
> 
> You can change this behavior by using:
> 
> \unprotect
> \c_strc_itemgroups_spacing_mode\plusone
> \protect
> 
> in which case both outputs are similar. 
> 
> @Hans: Does it make sense to add a setups key to \setupitemize to keep such changes local?
> 
> Aditya
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________



More information about the ntg-context mailing list