TransWikia.com

How to align the enumerate items using enumitem?

TeX - LaTeX Asked by tajiri_numero_1 on April 15, 2021

I’m writing a text and I want to save as much space as I can. I’m using the package usepackage{enumitem} in order to manipulate the enumerate easily. In the following code there si a problem with the alignment

documentclass{article}
usepackage{enumitem}
usepackage{blindtext}
begin{document}
  begin{enumerate}[leftmargin=0pt, label=bfseries{Problem theenumi.-}, itemindent=*]
    setcounter{enumi}{1}item blindtext
    setcounter{enumi}{10}item blindtext
    setcounter{enumi}{2}item blindtext
  end{enumerate}
end{document} 

enter image description here

Clearly, when the counter has 2 digits, the alignment fails. How can I solve this problem? Is there another package that I can use?

One Answer

You can add align=left:

documentclass{article}
usepackage{enumitem}
usepackage{blindtext}
begin{document}
  begin{enumerate}[leftmargin=0pt, label=textbf{Problem theenumi.-}, itemindent=*,align=left]
    setcounter{enumi}{1}item blindtext
    setcounter{enumi}{10}item blindtext
    setcounter{enumi}{2}item blindtext
  end{enumerate}
end{document} 

result

Correct answer by Jinwen on April 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP