![\newpage를 포함하는 열거 환경에서 모든 \item 다음에 \vfill을 얻으려면 어떻게 해야 합니까?](https://rvso.com/image/472713/%5Cnewpage%EB%A5%BC%20%ED%8F%AC%ED%95%A8%ED%95%98%EB%8A%94%20%EC%97%B4%EA%B1%B0%20%ED%99%98%EA%B2%BD%EC%97%90%EC%84%9C%20%EB%AA%A8%EB%93%A0%20%5Citem%20%EB%8B%A4%EC%9D%8C%EC%97%90%20%5Cvfill%EC%9D%84%20%EC%96%BB%EC%9C%BC%EB%A0%A4%EB%A9%B4%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%ED%95%B4%EC%95%BC%20%ED%95%A9%EB%8B%88%EA%B9%8C%3F.png)
저는 수업을 위한 메모 패킷을 만들려고 합니다. 기본적으로 한 페이지에 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*.}