ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] How to keep nested itemize group together with parent itemize item?
       [not found] <978661565.6376946.1727229690489.ref@mail.yahoo.com>
@ 2024-09-25  2:01 ` Joel via ntg-context
  2024-09-25  5:26   ` [NTG-context] " Mikael Sundqvist
  2024-09-25 12:55   ` ai2472206007
  0 siblings, 2 replies; 3+ messages in thread
From: Joel via ntg-context @ 2024-09-25  2:01 UTC (permalink / raw)
  To: Mailing List for ConTeXt Users; +Cc: Joel


[-- Attachment #1.1: Type: text/plain, Size: 1319 bytes --]

I have a nested itemize list like this, with first a question, then answer:
\starttext
\startitemize[n]    \startitem What is the color of the sky? \stopitem    \startitemize[3]        \startitem blue \stopitem        \startitem green \stopitem
        \startitem red \stopitem
        \startitem yellow \stopitem
     \stopitemize    \startitem What is the color of the grass? \stopitem    \startitemize[3]        \startitem blue \stopitem        \startitem green \stopitem
        \startitem red \stopitem
        \startitem yellow \stopitem
     \stopitemize    \startitem What is the color of the butterfly? \stopitem    \startitemize[3]        \startitem blue \stopitem        \startitem green \stopitem
        \startitem red \stopitem
        \startitem yellow \stopitem
     \stopitemize
\stopitemize

\stoptext
My copyeditor has noticed that often times a page break will appear after a question, leaving the answers, or some answers on a new page. He's requested I make sure the page breaks can only occur in front of a question, such that if a new page is needed, it places the question and answers always on the same page. Is there any way to make that happen in ConTeXt?
--Joel

[-- Attachment #1.2: Type: text/html, Size: 3658 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [NTG-context] Re: How to keep nested itemize group together with parent itemize item?
  2024-09-25  2:01 ` [NTG-context] How to keep nested itemize group together with parent itemize item? Joel via ntg-context
@ 2024-09-25  5:26   ` Mikael Sundqvist
  2024-09-25 12:55   ` ai2472206007
  1 sibling, 0 replies; 3+ messages in thread
From: Mikael Sundqvist @ 2024-09-25  5:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

you can probably control this a bit with penalties, but it would be
better to post an example where the unwanted break actually occur.

You can do \showmakeup[vpenalty] to see what penalties are added, and
you can play with for example

\startitemize[3,intro]

for the inner itemizations. But without an example showing the problem
it is a bit difficult...

/Mikael

On Wed, Sep 25, 2024 at 4:08 AM Joel via ntg-context <ntg-context@ntg.nl> wrote:
>
> I have a nested itemize list like this, with first a question, then answer:
>
> \starttext
>
> \startitemize[n]
>     \startitem What is the color of the sky? \stopitem
>     \startitemize[3]
>         \startitem blue \stopitem
>         \startitem green \stopitem
>         \startitem red \stopitem
>         \startitem yellow \stopitem
>     \stopitemize
>     \startitem What is the color of the grass? \stopitem
>     \startitemize[3]
>         \startitem blue \stopitem
>         \startitem green \stopitem
>         \startitem red \stopitem
>         \startitem yellow \stopitem
>     \stopitemize
>     \startitem What is the color of the butterfly? \stopitem
>     \startitemize[3]
>         \startitem blue \stopitem
>         \startitem green \stopitem
>         \startitem red \stopitem
>         \startitem yellow \stopitem
>     \stopitemize
>
> \stopitemize
>
> \stoptext
>
> My copyeditor has noticed that often times a page break will appear after a question, leaving the answers, or some answers on a new page. He's requested I make sure the page breaks can only occur in front of a question, such that if a new page is needed, it places the question and answers always on the same page. Is there any way to make that happen in ConTeXt?
>
> --Joel
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / 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
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [NTG-context] Re: How to keep nested itemize group together with parent itemize item?
  2024-09-25  2:01 ` [NTG-context] How to keep nested itemize group together with parent itemize item? Joel via ntg-context
  2024-09-25  5:26   ` [NTG-context] " Mikael Sundqvist
@ 2024-09-25 12:55   ` ai2472206007
  1 sibling, 0 replies; 3+ messages in thread
From: ai2472206007 @ 2024-09-25 12:55 UTC (permalink / raw)
  To: ntg-context

If you don't mind using a little trick, 
try wrapping the questions and options in a vbox to avoid pagination. 
The best solution may be to use penalty to do so.

\def\startnewitem{\vbox\bgroup\startitem}
\def\stopnewitem{\stopitem\egroup}

\starttext
\startitemize[n]    
\startnewitem% <-- wrap
    What is the color of the sky?     
    \startitemize[3]        
        \startitem blue \stopitem        
        \startitem green \stopitem
        \startitem red \stopitem
        \startitem yellow \stopitem
     \stopitemize  
\stopnewitem % <-- wrap
\startnewitem % <-- wrap
    What is the color of the grass?     
    \startitemize[3]        
        \startitem blue \stopitem        
        \startitem green \stopitem
        \startitem red \stopitem
        \startitem yellow \stopitem
     \stopitemize
\stopnewitem% <-- wrap
\startnewitem% <-- wrap
     What is the color of the butterfly?        
     \startitemize[3]    
        \startitem blue \stopitem       
        \startitem green \stopitem
        \startitem red \stopitem
        \startitem yellow \stopitem
     \stopitemize
\stopnewitem% <-- wrap
\stopitemize

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

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-25 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <978661565.6376946.1727229690489.ref@mail.yahoo.com>
2024-09-25  2:01 ` [NTG-context] How to keep nested itemize group together with parent itemize item? Joel via ntg-context
2024-09-25  5:26   ` [NTG-context] " Mikael Sundqvist
2024-09-25 12:55   ` ai2472206007

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).