I have defined a new counter that keeps increasing each time I call the macro that's using it. How can I print the counter value minus one? Something like \value{\theCounter-1} but formatted for text?
MWE
\documentclass{article}
\usepackage{parskip}
\newcounter{myCount}
\setcounter{myCount}{1}
\newcommand\newSec[1]{\par\underline{\textsc{newSec}~\themyCount}\hspace{0.5em}{\footnotesize(#1~number)}\stepcounter{myCount}\par}
\begin{document}
\newSec{2}
Some text
\newSec{5}
Here I refer to the counter used before it was incremented: \themyCount. Should print 2.
\end{document}
\setcounter{myCount}{0}and move the set counter\par\stepcounter{myCount}beforeunderline. – Sigur Nov 04 '14 at 12:43\labelit, you may get a page break between the heading and the text and everything else the section heading code takes care of isn't taken care of. – David Carlisle Nov 04 '14 at 12:52examclass. Good thought about incrementing the counter first. Solves it! – Holene Nov 04 '14 at 12:53