1

I want to align my text under the symbol ":" or another, for example I want something like that :

 First thing : Blablablabla ...
               Blablabla
 Second : blablablabla
          blabla

And I don't know how to do it, I tried many environments, like {enumerate} or {itemize} or {description} but none of them worked.

How can I do something like I want ?

Thank you.


Thank you, but it didn't help me much : in fact I want to write what I want before having the remaing text aligned, for example for the references in an article :

[Friedman1967] Here there is the reference
               which is long.
[Zu2014] Here is an other, the alignment is different.
         but it is stil coherent. 

I do not know if I am very clear sorry.

  • There is a similar question already solved here. It uses the package enumitem. I hope this helps. – jatorre Dec 14 '14 at 11:44
  • Welcome to TeX SX! What you want is not quite clear. You have a list, and you want lines after the first to be aligned with the colon? – Bernard Dec 14 '14 at 11:45
  • Yes, you understand well, it is like the examples I gave. So whar do I need to do ? – Mickael Dec 15 '14 at 6:27
2

One way to obtain the desired alignment is to define a custom macro:

enter image description here

Notes:

  • The showframe package was used just to show the page margins. It is not needed in your actual use case.

Code:

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.