0

Using a begin penalty (Avoid a break between a list and its introductory statement) works with enumerate

How to format labels with the enumerate environment was discussed in format labels of enumerate

Using a begin penalty and label formatting with enumerate at the same time poses a conundrum. Consider this example:

\documentclass{report}
\usepackage[bottom=1cm, top =1cm]{geometry}
\usepackage{lipsum}
\usepackage{enumerate}
%\usepackage{enumitem}                                                          
\begin{document}
\lipsum[1-8]
\lipsum[5][1-5]

another paragraph

consider the following cases:
\begin{enumerate}[1), beginpenalty=10000]
\item case 1
\item case 2
\end{enumerate}

\lipsum[6-7]
\end{document}

First it compiles only when commenting out the line

\usepackage{enumitem}

However, the package enumitem must be supplied for using beginpenalty=10000. Can you help?

  • Replace enumerate with enumtem (option [shortlabels]). – Bernard May 3 '19 at 16:48
  • @Bernard, do you mean enumitem? This environment is undefined even with the enumitem package. – Viesturs May 3 '19 at 17:24
  • Yes, sorry for the typo. Which environment is undefined? – Bernard May 3 '19 at 17:26
  • @Bernard, the environment enumitem is undefined even with the enumitem package. – Viesturs May 3 '19 at 17:28
  • There is no enumitem environment: it's a package to customise standard lists and defines newlists if you wish. – Bernard May 3 '19 at 17:30
1

Use this code:

\documentclass{report}
\usepackage[bottom=1cm, top =1cm]{geometry}
\usepackage{lipsum}
\usepackage[shortlabels]{enumitem}

\begin{document}

\lipsum[1-8]
\lipsum[5][1-5]

another paragraph

consider the following cases:
\begin{enumerate}[1), beginpenalty=10000]
\item case 1
\item case 2
\end{enumerate}

\lipsum[6-7]

\end{document} 
| improve this answer | |
1

You can better exploit enumitem features:

\documentclass{report}
\usepackage[bottom=1cm, top =1cm]{geometry}
\usepackage{lipsum}
\usepackage{enumitem}
\begin{document}
\lipsum[1-8]
\lipsum[5][1-5]

another paragraph

consider the following cases:
\begin{enumerate}[label=\arabic*), beginpenalty=10000]
\item case 1
\item case 2
\end{enumerate}

\lipsum[6-7]
\end{document}

The advantage over shortlabels is that you can separately set label and ref and more overall flexibility.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.