0

I use minipage as a way to prevent page break in the middle of something. Most of the time, it is for preventing page break in middle of some "small" enumerated list as it looks ugly to have enumerated list start on one page and continue to the next.

I tried other solutions such as How to prevent a page break before an itemize list? but that did not work for me, as I still got page break in middle of one enumerated list in my actual long document.

minipage works for all cases, but I have small problem. It makes the enumerated list look "bad". Spacing is lost above and below (even though I have empty line before and after the minpage) and the whole list is shifted more to the right more now than before, which is not good.

Here is a MWE, with and without minipage showing the effect.

My question is what to do to keep the enumerated list looking the same as when not using minipage, but still use minipage to prevent page breaks? I prefer solution that uses minipage instead of having to fix the enumerated list itself, as I use minipage for other things where I do not want page break in the middle of, and not just for lists. longtime ago I used to use samepage package, but I had some issues and I stopped using it.

Using minipage

enter image description here

Not using minipage (better formatted)

enter image description here

Code

\documentclass[12pt]{article}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amstext} 
\usepackage{amsmath}
\usepackage{xspace}
\usepackage{theorem}

\begin{document}
Knowing the order of the poles of $r$ and $\mathcal{O}(\infty)$ is all what 
is needed to determine the necessary conditions for each case. These conditions are
the following

\begin{minipage}{\textwidth}
\begin{enumerate}
\item Case $1$. Either no pole exists, or if poles exist, the order must be either one or even. 
If $\mathcal{O}(\infty)$ is less $3$, then it must be even otherwise it can be even or odd.

\item Case $2$. $r$ must have at least one pole which is either of order 2 or odd order greater than 2. 
There are no conditions on $\mathcal{O}(\infty)$.

\item Case $3$. $r$ must have a pole of either order $1$ or $2$. No other order is allowed. 
$\mathcal{O}(\infty)$ must be at least $2$.
\end{enumerate}
\end{minipage}

If the conditions for each case are not satisfied then there is no need to try that 
case as there will be no Liouvillian solution to the DE. 

\end{document}

This is screen shot from my actual document showing case where enumerated list spans one page when not using minipage

enter image description here

1
  • 1
    your minipage is indented (so is overfull by same amount) , wrap in begin{center} end{center} Commented Oct 24, 2022 at 13:58

1 Answer 1

1

Unrelated to the list, a minipage is positioned like a letter, so here it is starting a paragraph so indented by \parindent and since it is full width it makes an overfull line by the same amount.

Don't ignore warnings!

Overfull \hbox (17.62482pt too wide) in paragraph at lines 14--26

enter image description here

\documentclass[12pt]{article}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amstext} 
\usepackage{amsmath}
\usepackage{xspace}
\usepackage{theorem}

\begin{document}
Knowing the order of the poles of $r$ and $\mathcal{O}(\infty)$ is all what 
is needed to determine the necessary conditions for each case. These conditions are
the following

\begin{center}
\begin{minipage}{\textwidth}
\begin{enumerate}
\item Case $1$. Either no pole exists, or if poles exist, the order must be either one or even. 
If $\mathcal{O}(\infty)$ is less $3$, then it must be even otherwise it can be even or odd.

\item Case $2$. $r$ must have at least one pole which is either of order 2 or odd order greater than 2. 
There are no conditions on $\mathcal{O}(\infty)$.

\item Case $3$. $r$ must have a pole of either order $1$ or $2$. No other order is allowed. 
$\mathcal{O}(\infty)$ must be at least $2$.
\end{enumerate}
\end{minipage}  
\end{center}

If the conditions for each case are not satisfied then there is no need to try that 
case as there will be no Liouvillian solution to the DE. 

\end{document}

You must log in to answer this question.

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