On Thu, Sep 05, 2002 at 08:43:04PM +1000, John Sheahan wrote:
> > It is possible using latex code:
> > \newcounter{tmp}
> > \setcounter{tmp}{0}
> > \addtocounter{tmp}{10}
> > \addtocounter{tmp}{5}
> > \arabic{tmp}
> > 
> > To save typing, you can use
> > \newcommand{\add}[1]{\addtocounter{tmp}{#1}}
> > and then you can write \add{10} instead of \addtocounter{tmp}{10}
> 
> secondly, I want to gather a few numbers from random sections together
> in the summary chapter.    And to be really difficult my summary is at
> the start of the document.  \arabic{blah} appears to work as long as the
> summary is after the sum.

Add the end of your document, add 
\addtocounter{tmp}{-1}
\refstepcounter{tmp}

and then insert a label, e.g. "foo" (after the code above).
Then in the place you want the sum, insert a reference to the label.

BTW, when you time \add{3}, you will not see the number 3 in the output.
If you want the number to always appear in the output, define the \add
command as follows:

\newcommand{\add}[1]{#1\addtocounter{tmp}{#1}}




> 
> Given the number of documents I've read where there are obselete 
> sections after a couple of changes, many word processors must have
> this problem.  
> 
> regards, John

Reply via email to