The \newcounter{<counter-name>}[<outer-counter>]
commands will define a new counter. For example, \newcounter{example}[section]
command creates a new counter called example
that will be reset every time the section counter is increased.
But for paragraph counter, the \newcounter{<counter-name>}[paragraph]
doesn't work.
Here is the MWE:
\documentclass{article}
\newcounter{sentencenum}[paragraph]
\newcommand{\sno}[0]{\refstepcounter{sentencenum}$_{\arabic{sentencenum}}$}
\begin{document}
\sno{}Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
\sno{}Ut purus elit, vestibulum ut, placerat ac,adipiscing vitae, felis. Curabitur dictum gravida mauris.
\sno{}Nam arcu libero, nonummy eget, consectetuerid, vulputate a, magna.
\sno{}Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus etnetus et malesuada fames ac turpis egestas.
\sno{}Mauris ut leo. Cras viverra metus rhoncus sem.
\sno{}Nulla et lectusvestibulum urna fringilla ultrices.
\sno{}Phasellus eu tellus sit amet tortor gravida placerat.
\sno{}Integer sapien est,iaculis in, pretium quis, viverra ac, nunc.
\sno{}Praesent eget sem vel leo ultrices bibendum.
\sno{}Aenean faucibus.
\sno{}Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla.
\sno{}Curabitur auctor semper nulla.
\sno{}Donec variusorci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orcidignissim rutrum.
%
% Bug: The second paragraph should reset the counter value of `sentencenum` since here start a new paragraph
%
\sno{}Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi.
\sno{}Morbi auctor lorem non justo.
\sno{}Namlacus libero, pretium at, lobortis vitae, ultricies et, tellus.
\sno{}Donec aliquet, tortor sed accumsan bibendum,erat ligula aliquet magna, vitae ornare odio metus a mi.
\sno{}Morbi ac orci et nisl hendrerit mollis.
Suspendisseut massa.
\end{document}
\paragraph{<title>}
...\paragraph
.\paragraph
command is misleading you. It is not executed when a paragraph is started. It’s very unfortunate that Leslie Lamport chose it to mean\subsubsubsection
.