1

when i use this command:

\begin{description}
    \item[label1] text1
    \item[label2] text2
\end{description}

If text1 or text2 are longer then one line the second line (for example of text1) is not well aligned with the written 'label1'. How can I solve?

Edit: I want the c in figure to be aligned with the A.

enter image description here

  • 1
    welcome to tex.se! that we will can help you, you should show small but complete document with your description list. also you should better described what you mean with "not well aligned". – Zarko Jun 15 '18 at 10:56
  • By "not well aligned", do you mean "the left-hand edge is indented"? If so, do you want to cancel the hanging indentation? Please advise. – Mico Jun 15 '18 at 11:03
  • @user254087 - Actually, "exactly as described by Mico" doesn't seem to be correct: I was asking if the the hanging indentation should be set to zero. In contrast, your follow-up posting seems to be suggesting that the hanging indentation should be increased considerably -- to the full width of the label, e.g., "label1". – Mico Jun 15 '18 at 11:43
  • Oh, I had misunderstood. I hope it's more clear with the picture – user254087 Jun 15 '18 at 11:45
  • I think what you want is to replace description by itemize. – Sigur Jun 15 '18 at 11:47
0

A solution with calc, which lets you align the description left margin on the item text you want:

\documentclass{article}
\usepackage{enumitem}
\usepackage{calc} 

\begin{document}

\begin{description}[leftmargin=\widthof{\textbf{Label 1}\hspace*{\labelsep}} ]
  \item[Label 1] Some description text. Some description text. Some description text. Some description text.
  \item[Label 2] Description text for label 2. Description text for label 2.Description text for label 2. Description text for label 2.
  \item[Another label] Description text for another label. Description text for another label. Description text for another label. Description text for another label.
\end{description}

\end{document} 

enter image description here

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.