\topsep, \itemsep, \partopsep, \parsep - 각각 무엇을 의미합니까(그리고 아래쪽은 무엇입니까)?

\topsep, \itemsep, \partopsep, \parsep - 각각 무엇을 의미합니까(그리고 아래쪽은 무엇입니까)?

그만큼enumitem패키지 문서말한다:

\topsep, \itemsep, \partopsep, \parsep?

네, 그렇게 말하는 것은 아니지만 이러한 차원이 무엇을 의미하는지 설명하지도 않습니다. 각 항목이 무엇을 의미하는지 다이어그램으로 확인할 수 있나요? 그리고 에 해당하는 것은 무엇입니까 \bottomsep?

답변1

레슬리 램포트의 책,LaTeX: 문서 준비 시스템(1994)에는 113페이지에서 요청한 것과 같은 그림이 있는데, 이는 무엇보다도 목록 하단의 수직 공간이 항상 상단의 공간과 동일하다는 것을 설명합니다. 후자는 상황, 즉 목록이 수직 모드에서 시작되었는지 여부에 따라 달라집니다.

이것은 "The LaTeX Companion"의 해당 그림입니다.

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

답변2

알겠습니다. 사진이 포함된 질문을 하셨으니 사진으로 답변해 드리겠습니다.

요약

  • \itemsep= 목록의 각 항목 뒤에 세로 공백이 추가됩니다.
  • \parsep= 목록의 각 단락 뒤에 세로 공백이 추가됩니다.
  • \topsep= 목록 위와 아래에 수직 공간이 추가되었습니다.
  • \partopsep= 목록 위와 아래에 수직 공간이 추가되지만 목록이 새 단락을 시작하는 경우에만 해당됩니다.

샘플 문서

\documentclass[]{article}
\usepackage[margin=1in]{geometry}
\parindent=0pt
\usepackage{enumitem}
\usepackage{fancyvrb}
\DefineShortVerb{\|}
\newcommand{\longline}{This is a line of text that will form a paragraph which we can use in various places.\par}
\newcommand{\printvalues}{topsep=\the\topsep; itemsep=\the\itemsep; parsep=\the\parsep; partopsep=\the\partopsep}
\begin{document}
\hrulefill
\begin{enumerate}[topsep=0pt,itemsep=0pt,parsep=0pt,partopsep=0pt]
\item\printvalues
\item With all |*sep| values set to 0pt there is no space above or below the enumeration nor between the items or paragraphs within the items.
\item\longline
\end{enumerate}
\hrulefill\par
\hrulefill
\begin{enumerate}[topsep=0pt,itemsep=20pt,parsep=0pt,partopsep=0pt]
\item\printvalues
\item When we set |\itemsep| then this much space is placed between items but no space between paragraphs within an item.
\item\longline\longline
\end{enumerate}
\hrulefill\par
\hrulefill
\begin{enumerate}[topsep=0pt,itemsep=0pt,parsep=20pt,partopsep=0pt]
\item\printvalues
\item When we set |\parsep| then this much space is placed after  every paragraph within an item.  This will effectively also separate items too, since each single paragraph item will have the |\parsep| space after it.
\item\longline\longline
\end{enumerate}
\hrulefill\par

\hrulefill
\begin{enumerate}[topsep=20pt,itemsep=0pt,parsep=0pt,partopsep=0pt]
\item\printvalues
\item When we set |\topsep| this much space is placed above and below the enumeration. 
\end{enumerate}
\hrulefill
\begin{enumerate}[topsep=0pt,itemsep=0pt,parsep=0pt,partopsep=20pt]
\item\printvalues
\item When we set |\partopsep| this much space will be placed before and after a list only if the list is preceded by a |\par| (i.e., starts a new paragraph)
\item This enumerate is not preceded by a |\par| so no space is added.
\end{enumerate}
\hrulefill\par
\hrulefill\par
\begin{enumerate}[topsep=0pt,itemsep=0pt,parsep=0pt,partopsep=20pt]
\item\printvalues
\item When we set |\partopsep| this much space will be placed before and after a list only if the list is preceded by a |\par| (i.e., starts a new paragraph)
\item This enumerate is  preceded by a |\par| so space is added.
\end{enumerate}
\hrulefill
\end{document}

코드 출력

관련 정보