\newpage를 포함하는 열거 환경에서 모든 \item 다음에 \vfill을 얻으려면 어떻게 해야 합니까?

\newpage를 포함하는 열거 환경에서 모든 \item 다음에 \vfill을 얻으려면 어떻게 해야 합니까?

저는 수업을 위한 메모 패킷을 만들려고 합니다. 기본적으로 한 페이지에 2~3개의 긴 질문 목록으로 구성되어 있으며, 각 질문 뒤에는 학생들이 해결책을 찾을 수 있는 공간이 있습니다. 저는 enumitem패키지를 사용하고 있는데,거의사용자 정의 목록 환경을 사용하고 수직 간격 작업을 정의 itemsep하고 수행하는 완벽한 솔루션입니다.after

\documentclass{article}
\usepackage[shortlabels]{enumitem}
\newlist{questions}{enumerate}{1} 
\setlist[questions]{label=\itshape{{Question }\arabic*.},
                    ref={Question }\arabic*,
                    leftmargin=*,
                    itemindent=*,
                    itemsep=\fill, 
                    after={\vfill},
                    resume}

\begin{document}
    \begin{questions}
        \item First Question
        \item Another Question
        \item Another Question
        \item Another Question
    \end{questions}
\end{document}

이 질문은 다음을 수동으로 삽입하여 두 페이지에 걸쳐 펼치기로 결정할 때까지 잘 작동합니다 \newpage.

\begin{document}
    \begin{questions}
        \item First Question
        \item Another Question
           \newpage
        \item Another Question
        \item Another Question
    \end{questions}
\end{document}

이 버전에서는 질문 2가 뒤에 공백 없이 1페이지 하단에 표시됩니다. questions다음과 같이 새 페이지 이전에 목록을 종료하고 나중에 다시 시작하여 문제를 해결할 수 있습니다 .

\begin{document}
    \begin{questions}
        \item First Question
        \item Another Question
    \end{questions}
           \newpage
    \begin{questions}
        \item Another Question
        \item Another Question
    \end{questions}
\end{document}

...하지만 새 페이지를 삽입하려고 할 때마다 목록을 종료하고 다시 시작하는 것은 고통스럽습니다.

enumitem 패키지를 사용하여 원하는 동작을 얻는 더 "우아한"(읽기: 더 쉬운) 방법이 있습니까? 나는 enumitem에 꽤 관심이 있고 정말 타당한 이유가 없는 한 다른 패키지로 전환하고 싶지 않습니다.

답변1

\vfil가 있는 자동이 있습니다 \newpage. 에 의해 무너지고 있었습니다 \fill.

\documentclass{article}
\usepackage[shortlabels]{enumitem}
\newlist{questions}{enumerate}{1} 
\setlist[questions]{label=\itshape{{Question }\arabic*.},
                    ref={Question }\arabic*,
                    leftmargin=*,
                    itemindent=*,
                    itemsep=0pt plus 1fil, 
                    resume}

\begin{document}
    \begin{questions}
        \item First Question
        \item Another Question
    \newpage
        \item Another Question
        \item Another Question
    \end{questions}
\end{document}

답변2

문제는 \itemsep접착제가 명령에 의해 삽입되므로 \item두 번째 페이지 상단에 있고 규칙에 따라 폐기된다는 것입니다.

TeX가 페이지를 완료하면 메모리에서 해당 페이지를 제거하기 때문에 "역추적"할 방법이 없습니다. 따라서 \vfill앞에 수동으로 추가해야 합니다 \newpage.

몇 가지 의미를 추가하면 다음을 수행할 수 있습니다.

\newcommand{\questionbreak}{\vfill\pagebreak}

예:

\documentclass{article}
\usepackage{enumitem}

\newlist{questions}{enumerate}{1}
\setlist[questions]{
  label=\textit{Question} \arabic*.,
  ref=Question \arabic*,
  leftmargin=*,
  itemindent=*,
  itemsep=\fill,
  after=\vfill,
  resume,
}

\newcommand{\questionbreak}{\vfill\pagebreak}

\begin{document}

\begin{questions}
\item First Question

\item Another Question

\questionbreak

\item Another Question

\item Another Question

\end{questions}

\end{document}

여기에 이미지 설명을 입력하세요

작은 변화를 확인하세요: \itshape인수를 취하지 않습니다. 숫자도 이탤릭체로 표시하려면 다음을 수행하세요.

label=\textit{Question \arabic*.}

관련 정보