목록 항목의 모든 줄을 같은 정도로 들여쓰기

목록 항목의 모든 줄을 같은 정도로 들여쓰기

enumitem 패키지를 사용하고 있는데 다음 효과를 얻기 위해 가로 간격 매개변수( leftmargin, itemindent, labelsep, labelindent, ) 를 설정하는 데 문제가 있습니다 .labelwidth

LabelGoesHere     The quick brown fox jumped over the lazy dog. The
                  quick brown fox jumped over the lazy dog. The quick
                  brown fox jumped over the lazy dog. The quick brown
                  fox jumped over the lazy dog.

즉, 첫 번째 줄(레이블 제외)과 다른 줄은 모두 같은 지점에서 시작됩니다. 첫 번째 줄이 아닌 줄의 경우에는 정상적으로 작동합니다(여백에서 2cm 떨어진 곳에 정렬).

\begin{description}[
  leftmargin=2cm,
  itemindent=0cm
]

하지만 첫 번째 줄이 문제를 일으키고 있습니다. 어떻게든 라벨의 너비를 사용해야 하나요? !또는 을 사용해야 합니까 *?

추신 - 정렬이 발생하는 선의 시작 부분부터 목록에 사용된 모든 항목 레이블에 맞는 데 필요한 최대 거리와 고정된 여유 공간을 만드는 데 도움을 줄 수 있다면 보너스 포인트입니다.

답변1

충분히 큰 왼쪽 여백을 선택하거나 다음 multiline 스타일을 사용하십시오.

\documentclass{article}
\usepackage{enumitem}
\begin{document}


%
\begin{description}[leftmargin=2.5cm, style=multiline]
  \item[Label Goes Here] The quick brown fox jumped over the lazy dog. The
        quick brown fox jumped over the lazy dog. The quick
        brown fox jumped over the lazy dog. The quick brown
        fox jumped over the lazy dog.
\end{description}}

\begin{description}[style=sameline, leftmargin=3.2cm]
  \item[Label Goes Here] The quick brown fox jumped over the lazy dog. The
        quick brown fox jumped over the lazy dog. The quick
        brown fox jumped over the lazy dog. The quick brown
        fox jumped over the lazy dog.
\end{description}
}
\end{document} 

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

답변2

내가 얻은 최고의 것이 여기 있습니다. 이것은 작동하지만 "올바른 것"이 아닐 수도 있습니다.

\begin{description}[
  leftmargin=2cm,
  itemindent=0cm,
  labelwidth=1.75cm,
  labelsep=0.25cm,
  labelindent=0cm
]

따라서 이렇게 하면 라벨과 항목 텍스트 사이에 최소 0.25cm의 여유 공간이 보장되고 정렬은 여백에서 2cm가 됩니다.

관련 정보