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} 

1 Answers1

3

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

Bernard
  • 271,350