TransWikia.com

Enumitem: no margin for roman labels

TeX - LaTeX Asked on July 14, 2021

I would simply like a roman style labeling with no index but leftmargin=* doesn’t work when combined with the label option. Here’s a MWE:

documentclass{article}
usepackage{enumitem}

begin{document}    
section*{First section - ok}   
        begin{enumerate}[leftmargin=*]
            item 1 is alligned with the letter 'F' in 'First section'
            item 2 is alligned with the letter 'F' in 'First section'
        end{enumerate}
    section*{Second section - not ok}
        begin{enumerate}[label=bfseries(roman*),leftmargin=*]
            item (i) is NOT alligned with the letter 'S' in 'Second section'
            item (ii) is NOT alligned with the letter 'S' in 'Second section'
        end{enumerate} 
end{document}

enter image description here

One Answer

By default, list labels are right-aligned. You won't notice it in arabic numerals until you exceed 9, but it is immediately apparent in roman numerals.

So I think, you are looking for align=left. Not only will that align the left side of labels with each other, but will set them to the left side of the space allocate for the label width.

documentclass{article}
usepackage{enumitem}

begin{document}    
section*{First section - ok}   
        begin{enumerate}[leftmargin=*]
            item 1 is aligned with the letter 'F' in 'First section'
            item 2 is aligned with the letter 'F' in 'First section'
        end{enumerate}
    section*{Second section - now ok}
        begin{enumerate}[align=left,label=bfseries(roman*),leftmargin=*]
            item (i) is NOW aligned with the letter 'S' in 'Second section'
            item (ii) is NOW aligned with the letter 'S' in 'Second section'
        end{enumerate} 
end{document}

enter image description here

Correct answer by Steven B. Segletes on July 14, 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