In the following example, I want the resulting pdf to show the values of 300 and 500, but they do not print.

\documentclass{article}
\begin{document}

\newcounter{fund}

My first funding was worth \$\fund{300}. My second funding was worth \$\fund{500}.

Thus, in total, my funding was \$\thefund. \end{document}  Is there a way I can print this value without the redundant: My first funding was worth \$300. \fund{300}


Thanks.

• There's no command within \fund that prints the current value of the counter! Either use #1 for the increment value to be printed or \thefund for the total counter.
– user31729
Feb 21 '16 at 20:59

I am not sure this is meant (and I don't recommend it anyway), but here is the definition of \fund that adds an increment value and prints this value of the fund counter.

\documentclass{article}
\newcounter{fund}
My first funding was worth \$\fund{300}. My second funding was worth \$\fund{500}.