1

I like a particular description alignment:

  • The label aligned to the right
  • The description aligned to the left

enter image description here

In LaTeX I have been doing it manually, so I'd like to configure the description environment to do this. Any one has a tip?

\documentclass{article} 
\usepackage{enumitem}

\begin{document}

I'd like a description alignment like this:

\begin{tabular}{rl}
\textbf{E1:} & Example item 1 \\
\textbf{Long E2:} & Example item 2 \\
\textbf{Long long E3:} & Example item 3 \\
\end{tabular}

How to do it with description environment
or enumitem settings?

\end{document} 
  • In many cases, a tabular environment is better suited than a list, in my point of view, as you have achieved already, apart from the right aligned description labels, which look awkward to me – user31729 Feb 15 at 21:04
  • 1
    Possibly related: Enumitem: Right align the label – leandriis Feb 15 at 21:09
2

Here is a solution with enumitem and calc:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{enumitem, calc}

\begin{document}

I'd like a description alignment like this:

\begin{tabular}{rl}
\textbf{E1:} & Example item 1 \\
\textbf{Long E2:} & Example item 2 \\
\textbf{Long long E3:} & Example item 3 \\
\end{tabular}

How to do it with description environment
or enumitem settings?

\begin{description}[labelwidth= \widthof{\bfseries Long long E3:}, align =right]%
 \item[E1:] Example item 1
 \item[Long E2:] Example item 2
 \item[Long long E3:] Example item 3
\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.