목록 뒤의 페이지 나누기 방지

목록 뒤의 페이지 나누기 방지

내부 목록 바로 뒤에 외부 목록 끝이 올 때 페이지 나누기를 방지하려면 어떻게 해야 합니까?

두 목록 내 다른 곳에서는 페이지 나누기가 허용되어야 합니다.

MWE

\documentclass[twocolumn]{article}
\usepackage{lipsum}
\newenvironment{lista}{%
  \list{}{}%
    \item\relax
}{%
    Prevent page break before here.
  \endlist
}
\newenvironment{listb}{%
  \list{}{}%
    \item\relax
}{%
  \endlist
}
\begin{document}
\vspace*{7.5cm plus 1cm}
\begin{lista}
  \begin{listb}
    \lipsum[4]
  \end{listb}
  Permit page break before here.
  \begin{listb}
    \lipsum[4]
  \end{listb}
\end{lista}
\end{document}

답변1

내부 목록 바로 뒤에 외부 목록의 끝이 올 때 페이지 나누기를 방지하려면 \filbreak내부 목록 뒤와 그 뒤에 오는 텍스트 앞에 명령을 사용할 수 있습니다. 이 \filbreak명령은 해당 지점에서 페이지 나누기를 권장하여 내부 목록과 외부 목록 사이의 구분을 방지합니다. MWE의 업데이트된 버전은 다음과 같습니다.

\documentclass[twocolumn]{article}
\usepackage{lipsum}

\newenvironment{lista}{%
  \list{}{}%
    \item\relax
}{%
    Prevent page break before here.
  \endlist
}
\newenvironment{listb}{%
  \list{}{}%
    \item\relax
}{%
  \endlist\filbreak % Use \filbreak to prevent a page break after the inner list
}

\begin{document}
\vspace*{7.5cm plus 1cm}
\begin{lista}
  \begin{listb}
    \lipsum[4]
  \end{listb}
  \lipsum[1-2] % This text follows the inner list
\end{lista}
\end{document}

이 예에서는 환경 에서 명령 \filbreak뒤에 추가했습니다 . 이렇게 하면 내부 목록 바로 뒤에 외부 목록의 끝이 올 때 페이지 나누기를 방지하는 데 도움이 됩니다.\endlistlistb

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

관련 정보