3

I would like to define a new environment which basically works very similarly to enumerate. I want to create sort of sections with the following features:

  • the numbering should go in the left margin (aligned to the first line of the section).
  • the distance above the first section is the same as the distance above in the environment enumerate. Same for the distance below the last section.
  • the distance between 2 consecutive sections equal to the distance between two items.
  • first paragraph of each section not indented, following paragraphs indented as in the main text.

As you can see, I want something in between proper sections and proper lists.

The closer I got to the solution is obtained by using

{\setlength{\leftmargini}{0pt}
\begin{enumerate}
\item This is the first paragraph

      this is the second one
\item this is a new section
\end{enumerate}
}

However, I couldn't fix the paragraphs' issue (they are spaced as in enumerate, while I want them to behave like in the text).

I am looking for a "clean" and flexible solution. I'd like for example to create an environment (which I could not do using the method above). Or, if you have other solutions, they are welcome of course. I am hardly trying not to use packages. Any help would be much appreciated!

2
  • And do these special "sections" need to have a title in its own line, like the standard sectional units? Commented Mar 2, 2014 at 0:53
  • @GonzaloMedina not necessarily, but this could be a useful option. Commented Mar 2, 2014 at 11:54

1 Answer 1

4

With the help of enumitem, you can define a new environment enumsec which does what you want (I hope):

\newlist{enumsec}{enumerate}{1}
\setlist[enumsec,1]{%
    align=right,
    leftmargin=0pt,
    parsep=0pt,
    itemsep=\topsep,
    listparindent=\parindent,
    label=\arabic*.
    }

MWE:

\documentclass{article}
\usepackage{enumitem}

\newlist{enumsec}{enumerate}{1}
\setlist[enumsec,1]{%
    align=right,
    leftmargin=0pt,
    parsep=0pt,
    itemsep=\topsep,
    listparindent=\parindent,
    label=\arabic*.
    }

\begin{document}

\noindent Some text

Some indented text

\begin{enumsec}
\item This is the first paragraph

      this is the second one
\item This is a new section
\end{enumsec}

\end{document} 

Output

enter image description here

I've defined it to be a one-level enumerate. If you need more levels or further customizations let me know.

0

You must log in to answer this question.

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