Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!

share|improve this question
    
And do these special "sections" need to have a title in its own line, like the standard sectional units? –  Gonzalo Medina Mar 2 at 0:53
    
@GonzaloMedina not necessarily, but this could be a useful option. –  user2892453 Mar 2 at 11:54

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.