SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Counters
  • My Own Counters*
Como libertar um povo que preza seus correntes?
Niculau Maquiavel.
< $\LaTeX$ II | My Own Counters | Graphics >
LaTeX Listing: MyCounters.tex. PDF   ZIP*  
\documentclass{article}
 
 
%Normally counters declared in preamble

%Create counter mycounter, reset entering section
\newcounter{mycounter}[section]

\begin{document}

   \section {Introduction}

      %Atribute value to counter mycounter
      \setcounter{mycounter}{3}
      The value of \emph{mycounter}: \themycounter.
   
   
   \section {Section 1}

      %Atribute value to counter mycounter
      \stepcounter{mycounter}
      The value of \emph{mycounter}: \themycounter.
      
      \addtocounter{mycounter}{-2}
      The value of \emph{mycounter}: \themycounter.
      
\end{document}
< $\LaTeX$ II | My Own Counters | Graphics >
Messages:
0 secs.