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?

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

2 Answers 2

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} 
2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .