テキストを「:」などの記号の下に揃えたいのですが、たとえば次のようなものにしたいです:
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
目的の配置を取得する 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}