1

I have this setup:

\documentclass{article}

\begin{document}

\begin{description}
  \item [Heading]~
  \begin{quote}
    \begin{enumerate}
      \item First
      \item Second
    \end{enumerate}
  \end{quote}
\end{description}

\end{document}

I know of the samepage package but that seems not to help since I cannot easily split up the enumerate's first item to put it together in a samepage.

Also, I do not like the needspace approach since, if I understood it correctly, I would need to know how long my First enumerate item is. But I don't want to set that manually.

Is there a way to tell LaTeX just to keep the Heading and First item together?

Edit

Here is some illustration.

This should not happen:

Heading
---- new page ----
    1. First
    2. Second

If there is enough space below the heading, then this would be fine:

Heading
    1. First
---- new page ----
    2. Second

Otherwise

---- new page ----
Heading
    1. First
    2. Second

Also, I guess it makes sense that part of the first item might be on the first page and part on the second, if first item goes over several lines.

Heading
    1. First First First First First First 
       First First First First First First
---- new page ----
       First First First First First First 
       First First First First First First
    2. Second
Daniel
  • 1,787
  • Is there a need for using the quote environment? – Werner Sep 29 '16 at 19:44
  • @Werner Yes. I am quoting someone else's enumeration. – Daniel Sep 29 '16 at 20:00
  • Do you just have one Heading or is this something that is spread throughout your document? Do you have a twoside document? – Werner Sep 29 '16 at 20:05
  • @Werner This happens at several occasions in my document. It is only onesided. – Daniel Sep 29 '16 at 20:15
  • In your current example your Heading just fits within the margin and enumeration (because of quote). What should happen if Heading is wider than this gap? – Werner Sep 29 '16 at 20:21
  • @Werner That it fits the indentation is not on purpose. So the heading could just be longer. – Daniel Sep 29 '16 at 20:45
  • Could you provide same examples of how this should be handled, perhaps as images or ASCII, so it can be made clear of all your possible cases? – Werner Sep 29 '16 at 20:53
  • @Werner Sure. I tried to illustrate it. Does that help? – Daniel Sep 29 '16 at 21:01
  • quote is a list, see eg http://tex.stackexchange.com/a/2645/2388 how to suppress break points before a list. With enumitem you can also set beginpenalty. – Ulrike Fischer Sep 29 '16 at 21:07
  • @UlrikeFischer Thanks. The custom commands \mynobreakpar and \nolisttopbreak seem not to work for me. The first has no effect while the latter moves the First item all the way up right behind the Heading or has no effect as well-depending on where I put it. \@beginparpenalty=10000 seems to work. Is there a way to use it only locally for a certain list? – Daniel Sep 29 '16 at 21:55

0 Answers0