# crop-package interfering with paragraph counter using everypar

Steven B. Segletes has devised a well working way to count paragraphs that doesn't seem to interfere with all the (many) packages that I am using in my book. Apart for one exception: The crop-package will count its marks and header-info as paragraphs.

\documentclass[a5paper]{article}

\usepackage{lipsum}

\usepackage[cam,a4,center]{crop}

\newcounter{parcount}
\let\oldep\everypar%
\newenvironment{enumpars}
{\newtoks\everypar%
\setcounter{parcount}{0}%
\oldep{\the\everypar\stepcounter{parcount}%
\par}{\global\let\everypar\oldep\par}

\begin{document}

\begin{enumpars}
\lipsum[1-5]
\end{enumpars}

\lipsum[6-8]

\begin{enumpars}
\lipsum[9-14]
\end{enumpars}

\end{document}


Would there be a way to "shield" \everypar perhaps by saving its content before crop starts its working?

With a current LaTeX you can try this. But in a real document there can be more paragraphs appearing in wrong places

\documentclass[a5paper]{article}

\usepackage{lipsum,etoolbox}
\newbool{parabool}

\usepackage[cam,a4,center]{crop}

\newcounter{parcount}

\newenvironment{enumpars}
{\setcounter{parcount}{0}%
\booltrue{parabool}\par}
{}

\makeatletter
\preto\CROP@@@marks{\boolfalse{parabool}}
\makeatother
\begin{document}

\begin{enumpars}
\lipsum[1-5]
\end{enumpars}

\lipsum[6-8]

\begin{enumpars}
\lipsum[9-14]
\end{enumpars}

\end{document}