I've defined a shortcut to create boxed questions like this:
\usepackage{enumitem}
\usepackage{mdframed}
\newcommand{\questionlabel}{Question }
\newcommand{\restorequestionlabel}{\renewcommand{\questionlabel}{Question }}
\newenvironment{questions}
{\begin{enumerate}[align=left,label=\textbf{\questionlabel\arabic*.}, wide]}
{\end{enumerate}}
\newcommand{\itembr}{\item\mbox{}}
\newcommand{\question}[1]{\itembr\begin{mdframed}#1\end{mdframed}}
When used like this usually produces what I want:
\begin{questions}
\question{Lorem ipsum dolor sit amet?}
consectetur adipiscing elit
\question{sed do eiusmod tempor}
incididunt ut labore et dolore
\end{questions}
Unfortunately, sometimes the page break occurs between the label Question ?. and the top of the box. I'm using mdframed and I do want the boxes to split across the pages, but not before the first line.
I've tried putting \nopagebreak in different places but it didn't work. I've seen other posts suggesting to use minipage but is not ideal since it wouldn't allow page breaks at any other line.
