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}
7
  • this looks a lot like itemize, removing natural indent
    – cmhughes
    May 29, 2014 at 16:57
  • possible duplicate of itemize, removing natural indent
    – cmhughes
    May 29, 2014 at 16:58
  • @cmhughes although I also voted for closing as duplicate, now I realize it it's not; leftamrgin=* alone (the answer in the alleged duplicate) doesn't do what is requested here. May 29, 2014 at 17:03
  • @GonzaloMedina ok - I have retracted my vote
    – cmhughes
    May 29, 2014 at 17:20
  • 1
    @cmhughes I didn't know one could retract the vote. How is it done? May 29, 2014 at 17:22

2 Answers 2

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

4
  • 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 tex.stackexchange.com/questions/29322/…
    – cslstr
    May 29, 2014 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. May 29, 2014 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, 2014 at 18:49
  • @capadocia I edited my answer. May 29, 2014 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

You must log in to answer this question.

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