ConTeXt: Page break preference between nested itemize environments
up vote
1
down vote
favorite
I frequently have nested itemize environments that must appear on the same page as the item that they are nested under, such as parts of a question on an assignment or exam. I can't seem to figure out the right options to force this behavior in all cases where nested content is physically able to fit on the page.
I had tried to use page[bigpreference]
after the nested itemize:
usemodule[visual]
setupitemize[2][after={page[bigpreference]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
But I get an unwanted break immediately on the first page:
I found a reference to c_strc_itemgroups_spacing_mode=0
in another question and while this helps, I still see an unwanted page break on page 3. I also tried setupitemize[1][inbetween={page[bigpreference]}]
with no improvement.
I'm not entirely sure whether this behavior is specific to nested itemize environments but is there any general way to make sure that the top-level item content is never split across pages?
Update:
While playing around some more with the page preference options, I found that the combination of page[no]
and page[bigpreference]
seems to work best, but as it is based on preferences, the end result is not guaranteed. Including the following options into the above code still results in an unwanted page break on page 6:
setupitemize[2][inbetween={page[no]},
before={page[no]},
after={page[bigpreference]}]
Perhaps some sort of framing solution would be best, but I'm not sure how to implement one in a generic fashion (without manually defining frames).
context itemize
add a comment |
up vote
1
down vote
favorite
I frequently have nested itemize environments that must appear on the same page as the item that they are nested under, such as parts of a question on an assignment or exam. I can't seem to figure out the right options to force this behavior in all cases where nested content is physically able to fit on the page.
I had tried to use page[bigpreference]
after the nested itemize:
usemodule[visual]
setupitemize[2][after={page[bigpreference]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
But I get an unwanted break immediately on the first page:
I found a reference to c_strc_itemgroups_spacing_mode=0
in another question and while this helps, I still see an unwanted page break on page 3. I also tried setupitemize[1][inbetween={page[bigpreference]}]
with no improvement.
I'm not entirely sure whether this behavior is specific to nested itemize environments but is there any general way to make sure that the top-level item content is never split across pages?
Update:
While playing around some more with the page preference options, I found that the combination of page[no]
and page[bigpreference]
seems to work best, but as it is based on preferences, the end result is not guaranteed. Including the following options into the above code still results in an unwanted page break on page 6:
setupitemize[2][inbetween={page[no]},
before={page[no]},
after={page[bigpreference]}]
Perhaps some sort of framing solution would be best, but I'm not sure how to implement one in a generic fashion (without manually defining frames).
context itemize
A very dirty trick is putting your items and subitems in a vbox, but the layout may look quite awful. So does the code.
– sztruks
Oct 11 at 19:05
@sztruks Thanks! That wouldn't be too bad if I didn't have to usevbox
manually (I'm usually dealing with quite a few such pages at a time). Do you know how I could incorporatevbox
into any of thebefore/after/inbetween
options or something similar? I didn't have much luck when I played around with that idea earlier.
– ssokolen
Oct 11 at 19:34
unfortunately not, I am just beginning my travel with TeX boxes…
– sztruks
Oct 11 at 19:44
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I frequently have nested itemize environments that must appear on the same page as the item that they are nested under, such as parts of a question on an assignment or exam. I can't seem to figure out the right options to force this behavior in all cases where nested content is physically able to fit on the page.
I had tried to use page[bigpreference]
after the nested itemize:
usemodule[visual]
setupitemize[2][after={page[bigpreference]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
But I get an unwanted break immediately on the first page:
I found a reference to c_strc_itemgroups_spacing_mode=0
in another question and while this helps, I still see an unwanted page break on page 3. I also tried setupitemize[1][inbetween={page[bigpreference]}]
with no improvement.
I'm not entirely sure whether this behavior is specific to nested itemize environments but is there any general way to make sure that the top-level item content is never split across pages?
Update:
While playing around some more with the page preference options, I found that the combination of page[no]
and page[bigpreference]
seems to work best, but as it is based on preferences, the end result is not guaranteed. Including the following options into the above code still results in an unwanted page break on page 6:
setupitemize[2][inbetween={page[no]},
before={page[no]},
after={page[bigpreference]}]
Perhaps some sort of framing solution would be best, but I'm not sure how to implement one in a generic fashion (without manually defining frames).
context itemize
I frequently have nested itemize environments that must appear on the same page as the item that they are nested under, such as parts of a question on an assignment or exam. I can't seem to figure out the right options to force this behavior in all cases where nested content is physically able to fit on the page.
I had tried to use page[bigpreference]
after the nested itemize:
usemodule[visual]
setupitemize[2][after={page[bigpreference]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
But I get an unwanted break immediately on the first page:
I found a reference to c_strc_itemgroups_spacing_mode=0
in another question and while this helps, I still see an unwanted page break on page 3. I also tried setupitemize[1][inbetween={page[bigpreference]}]
with no improvement.
I'm not entirely sure whether this behavior is specific to nested itemize environments but is there any general way to make sure that the top-level item content is never split across pages?
Update:
While playing around some more with the page preference options, I found that the combination of page[no]
and page[bigpreference]
seems to work best, but as it is based on preferences, the end result is not guaranteed. Including the following options into the above code still results in an unwanted page break on page 6:
setupitemize[2][inbetween={page[no]},
before={page[no]},
after={page[bigpreference]}]
Perhaps some sort of framing solution would be best, but I'm not sure how to implement one in a generic fashion (without manually defining frames).
context itemize
context itemize
edited Oct 11 at 20:08
asked Oct 11 at 18:10
ssokolen
752110
752110
A very dirty trick is putting your items and subitems in a vbox, but the layout may look quite awful. So does the code.
– sztruks
Oct 11 at 19:05
@sztruks Thanks! That wouldn't be too bad if I didn't have to usevbox
manually (I'm usually dealing with quite a few such pages at a time). Do you know how I could incorporatevbox
into any of thebefore/after/inbetween
options or something similar? I didn't have much luck when I played around with that idea earlier.
– ssokolen
Oct 11 at 19:34
unfortunately not, I am just beginning my travel with TeX boxes…
– sztruks
Oct 11 at 19:44
add a comment |
A very dirty trick is putting your items and subitems in a vbox, but the layout may look quite awful. So does the code.
– sztruks
Oct 11 at 19:05
@sztruks Thanks! That wouldn't be too bad if I didn't have to usevbox
manually (I'm usually dealing with quite a few such pages at a time). Do you know how I could incorporatevbox
into any of thebefore/after/inbetween
options or something similar? I didn't have much luck when I played around with that idea earlier.
– ssokolen
Oct 11 at 19:34
unfortunately not, I am just beginning my travel with TeX boxes…
– sztruks
Oct 11 at 19:44
A very dirty trick is putting your items and subitems in a vbox, but the layout may look quite awful. So does the code.
– sztruks
Oct 11 at 19:05
A very dirty trick is putting your items and subitems in a vbox, but the layout may look quite awful. So does the code.
– sztruks
Oct 11 at 19:05
@sztruks Thanks! That wouldn't be too bad if I didn't have to use
vbox
manually (I'm usually dealing with quite a few such pages at a time). Do you know how I could incorporate vbox
into any of the before/after/inbetween
options or something similar? I didn't have much luck when I played around with that idea earlier.– ssokolen
Oct 11 at 19:34
@sztruks Thanks! That wouldn't be too bad if I didn't have to use
vbox
manually (I'm usually dealing with quite a few such pages at a time). Do you know how I could incorporate vbox
into any of the before/after/inbetween
options or something similar? I didn't have much luck when I played around with that idea earlier.– ssokolen
Oct 11 at 19:34
unfortunately not, I am just beginning my travel with TeX boxes…
– sztruks
Oct 11 at 19:44
unfortunately not, I am just beginning my travel with TeX boxes…
– sztruks
Oct 11 at 19:44
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Does changing the spacing mode work for you?
usemodule[visual]
unprotect
% 0 = before/after
% 1 = between unless before
% 2 = between
c_strc_itemgroups_spacing_mode=0
protect
setupitemize[2][before={blank[samepage]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
Click to enlarge picture:
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Does changing the spacing mode work for you?
usemodule[visual]
unprotect
% 0 = before/after
% 1 = between unless before
% 2 = between
c_strc_itemgroups_spacing_mode=0
protect
setupitemize[2][before={blank[samepage]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
Click to enlarge picture:
add a comment |
up vote
0
down vote
Does changing the spacing mode work for you?
usemodule[visual]
unprotect
% 0 = before/after
% 1 = between unless before
% 2 = between
c_strc_itemgroups_spacing_mode=0
protect
setupitemize[2][before={blank[samepage]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
Click to enlarge picture:
add a comment |
up vote
0
down vote
up vote
0
down vote
Does changing the spacing mode work for you?
usemodule[visual]
unprotect
% 0 = before/after
% 1 = between unless before
% 2 = between
c_strc_itemgroups_spacing_mode=0
protect
setupitemize[2][before={blank[samepage]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
Click to enlarge picture:
Does changing the spacing mode work for you?
usemodule[visual]
unprotect
% 0 = before/after
% 1 = between unless before
% 2 = between
c_strc_itemgroups_spacing_mode=0
protect
setupitemize[2][before={blank[samepage]}]
starttext
startitemize
dorecurse{20}{
item This is an exam/assignment question item: fakewords{10}{20}
startitemize
dorecurse{3}{
item subquestion or multiple choice answer: fakewords{10}{20}
}
stopitemize
}
stopitemize
stoptext
Click to enlarge picture:
answered 5 hours ago
Henri Menke
67.2k7148255
67.2k7148255
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f454806%2fcontext-page-break-preference-between-nested-itemize-environments%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
A very dirty trick is putting your items and subitems in a vbox, but the layout may look quite awful. So does the code.
– sztruks
Oct 11 at 19:05
@sztruks Thanks! That wouldn't be too bad if I didn't have to use
vbox
manually (I'm usually dealing with quite a few such pages at a time). Do you know how I could incorporatevbox
into any of thebefore/after/inbetween
options or something similar? I didn't have much luck when I played around with that idea earlier.– ssokolen
Oct 11 at 19:34
unfortunately not, I am just beginning my travel with TeX boxes…
– sztruks
Oct 11 at 19:44