带有全宽、框架框和枚举的不受欢迎新页面

带有全宽、框架框和枚举的不受欢迎新页面

我如何才能防止问题 3 被推到这里的第三页?是什么导致了这种异常行为?

\documentclass{article}


\usepackage[margin=1in]{geometry}
\usepackage{fullwidth}
\usepackage{lipsum}
\newcommand{\answerspace}[1]{\begin{fullwidth}[width=\textwidth,skipabove=0pt,skipbelow=10pt]\framebox[\textwidth]{\rule[-.3\baselineskip]{0pt}{#1}}\end{fullwidth}}%

\begin{document}
    \lipsum[1-5]
\begin{enumerate}
    \item What is 1+1?
\answerspace{3cm}
    \item What is 2+1?
\answerspace{5cm}
\item \lipsum[1]
\end{enumerate}
\end{document}

答案1

嗯,这是可行的:

\documentclass{article}


\usepackage[margin=1in]{geometry}
\usepackage{enumitem}
\usepackage{lipsum}
\newcounter{indentlevel}
\newcommand{\answerspace}[1]{\setlength{\parindent}{-\value{indentlevel}\leftmargin}\par\framebox[\textwidth]{\rule[-.3\baselineskip]{0pt}{#1}}\par}%

\begin{document}
    \lipsum[1-5]
\begin{enumerate}[before*=\stepcounter{indentlevel},after*=\addtocounter{indentlevel}{-1}]
    \item What is 1+1?
\answerspace{3cm}
    \item What is 2+1?
\answerspace{5cm}
\item \lipsum[1]
\end{enumerate}
\end{document}

相关内容