3

I'm trying to get rid of indentation in enumerate. The code below shows the indentation with enumerate, and then the only partial fix I could implement. With enumitem package I could avoid indentation on the 'count' line through leftmargin=*, but there is still indentation in the text. How could I fix that?

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{blindtext}
\begin{document}

\blindtext

\begin{enumerate}
\item Case $a\in B$

\blindtext

\item Case $a\in C$

\blindtext

\end{enumerate}

\begin{enumerate}[leftmargin=*]
\item Case $a\in B$

\blindtext

\item Case $a\in C$

\blindtext

\end{enumerate}

\end{document}
Torbjørn T.
  • 206,688
Ararat
  • 534

2 Answers2

2

This requires some manual adjustment, as you have to modify the argument for widest to be the widest number in the list. As the item numbers are right aligned, only the widest run to the margin, the rest are indented a bit.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{showframe}
\begin{document}

\begin{enumerate}[label=(\roman*),widest=viii,itemindent=*,leftmargin=0pt]
\item Case $a\in B$

More text \setcounter{enumi}{7}
\item Case $a\in B$

more text
\end{enumerate}

\begin{enumerate}[widest=99,itemindent=*,leftmargin=0pt]
\item Case $a\in B$

More text \setcounter{enumi}{9}
\item Case $a\in B$

more text
\end{enumerate}
\end{document}

enter image description here

Torbjørn T.
  • 206,688
  • Watch out with this solution, as when the numbers have different widths (double or triple digits), they will hang into right margin. See difference between this result and that of http://tex.stackexchange.com/questions/29322/how-to-make-enumerate-items-align-at-left-margin – cslstr May 29 '14 at 18:36
  • @cslstr Oops, you're right. Thanks for the notice. Don't have time to look do anything about it right now, will edit later. – Torbjørn T. May 29 '14 at 18:39
  • Somehow the result is not preserved if count is set to romans:\begin{enumerate}[itemindent=,leftmargin=0pt,label=(\roman)] – Ararat May 29 '14 at 18:49
  • @capadocia I edited my answer. – Torbjørn T. May 29 '14 at 19:51
1

Maybe the wide option does what you want,if I understand well:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{blindtext}
\begin{document}

\blindtext

\begin{enumerate}[wide]
\item Case $a\in B$\\
\blindtext

\item Case $a\in C$

\blindtext

\end{enumerate}

\end{document} 

enter image description here

Bernard
  • 271,350