8

I do this

\documentclass[12pt]{article}
\usepackage{enumitem}
\setlist[enumerate]{labelwidth=3cm,labelsep=0.5cm,leftmargin=4cm,align=left}

\begin{document}    
\begin{enumerate}[label=  Example \arabic*:]
\item 5 + 7 = 12
\item 9 + 1 = 10
\end{enumerate}

\end{document}

enter image description here

as you can see 1: and 2: are not aligned.

since I use a different font, it has different widths for 1 and 2. How can I align by leftmost letter (E) and :.

So I get something like

   Example   1:
   Example  11:
1
  • 1
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
    – jub0bs
    Jan 19, 2014 at 11:33

1 Answer 1

10

You can add \hfill between Example and \arabic*:, but you have to adjust labelwidth and labelsep:

\documentclass[12pt]{article}
\usepackage{enumitem}
\setlist[enumerate]{labelwidth=2.2cm,labelsep=1.3cm,leftmargin=4cm,align=left}

\begin{document}
\begin{enumerate}[label={Example\hfill\arabic*:}]
\item 5 + 7 = 12
\item 9 + 1 = 10
\item 9 + 1 = 10
\item 9 + 1 = 10
\item 9 + 1 = 10
\item 9 + 1 = 10
\item 9 + 1 = 10
\item 9 + 1 = 10
\item 9 + 1 = 10
\item 9 + 1 = 10
\end{enumerate}

\end{document} 

Output:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .