
텍스트를 ":" 기호 또는 다른 기호 아래에 정렬하고 싶습니다. 예를 들어 다음과 같은 것을 원합니다.
First thing : Blablablabla ...
Blablabla
Second : blablablabla
blabla
그리고 어떻게 해야 할지 모르겠습니다. {enumerate}, {itemize} 또는 {description}과 같은 많은 환경을 시도했지만 그 중 아무 것도 작동하지 않았습니다.
내가 원하는 대로 어떻게 할 수 있나요?
감사합니다.
감사합니다. 하지만 별로 도움이 되지 않았습니다. 사실 저는 기사의 참조와 같이 나머지 텍스트를 정렬하기 전에 제가 원하는 것을 작성하고 싶습니다.
[Friedman1967] Here there is the reference
which is long.
[Zu2014] Here is an other, the alignment is different.
but it is stil coherent.
제가 아주 명확한지 모르겠습니다. 죄송합니다.
답변1
원하는 정렬을 얻는 한 가지 방법은 사용자 정의 매크로를 정의하는 것입니다.
노트:
- 패키지
showframe
페이지 여백을 표시하는 데만 사용되었습니다. 실제 사용 사례에서는 필요하지 않습니다.
암호:
\documentclass{article}
\usepackage{showframe}
\newlength{\LabelWidth}
\newcommand*{\AlignedText}[2]{%
\par\noindent\textbf{#1:}
\settowidth{\LabelWidth}{\textbf{#1} }%
\parbox[t]{\dimexpr\linewidth-\LabelWidth-\parsep\relax}{#2\strut}%
}
\begin{document}
\AlignedText{Friedman1967}{Here is the reference
which is quite long and spills onto a second line.}
\AlignedText{Zu2014}{Here is an other, the alignment is different,
but it is still coherent, and also takes more than one line.}
\end{document}