I have a environment to number the paragraphs in it, if I have to ignore some paragraphs in the environment which needn't be numbered, eg: I want to ignore numbering of the \lipsum[6-7]
, how to make it?
The whole codes of the environment are here:
\documentclass{book}
\usepackage{mparhack} % get marginpars to always show up on the correct side (need to compile twice)
\usepackage{lipsum} % for dummy text
% change this to get the formatting you want
\newcommand{\parnum}{\bfseries\arabic{parcount}}
\newcounter{parcount}
\newenvironment{parnumbers}{%
\par%
\everypar{\stepcounter{parcount}\leavevmode\marginpar[\hfill\parnum]
{\parnum}}%
\setcounter{parcount}{0}%to restart numbering in every environment
}{}
\begin{document}
\begin{parnumbers}
\lipsum[1-4]
\end{parnumbers}
\begin{parnumbers}
\lipsum[5-8]
\end{parnumbers}
\begin{parnumbers}
\lipsum[9-10]
\end{parnumbers}
\end{document}