[Tex/LaTex] Numbered paragraphs

numberingparagraphs

I would like to write something with numbered paragraphs – for those who know it the style should be the same of EGA. So instead of having something like

blah blah

Theorem 2.1

blah blah

Proof

blah blah

more content after the proof

I would like to have something like

2.1 blah blah

2.2 Theorem. blah blah

2.3 Proof. blah blah

2.4 more content after the proof

Is there a simple way to get this result?

Best Answer

You probably don't want to number all paragraphs. I would do something like this:

\documentclass[a4paper]{article}
\usepackage{amsthm}
\swapnumbers

\newtheorem{num}{\unskip}[section]
\newtheorem{thm}[num]{Theorem}
\newtheorem{demo*}[num]{Proof}
\newenvironment{demo}
  {\pushQED{\qed}\begin{demo*}}
  {\popQED\end{demo*}}

\begin{document}
\section{Start}
\begin{num}
This is a numbered paragraph.

Actually it has two paragraphs.
\end{num}

\begin{thm}
This is a theorem.
\end{thm}

\begin{demo}
This is its proof.
\end{demo}
\end{document}