2
votes
2answers
66 views

Automate a running counter through a document

The following minimal example demonstrates my situation: \documentclass{article} \usepackage{calculator} \newcommand{\pts}{0} \begin{document} \ADD{\pts}{3}{\pts}\pts \ADD{\pts}{3}{\pts}\pts ...
8
votes
2answers
235 views

How can you make custom counter display types?

I'm a comp sci prof working on an exam for my students in LaTeX, using the exam class. I like to throw in a few in-jokes here and there. Unfortunately, the class breaks if you try to use 0-indexing on ...
13
votes
3answers
953 views

How to set a counter to double the value of another counter?

The title says it. Lets have to counters: \newcounter{myCount} \newcounter{anotherCount} I set myCount to some value for example 10 \setcounter{myCount}{10} How do I set counter anotherCount to ...
16
votes
3answers
611 views

square root of number in counter

I would like to get the square root of a number which I have stored into a counter. I have been using the calc package for summation and multiplication operations, but I cannot find anything like ...
13
votes
4answers
613 views

Dividing dimensions to get a count

Is there a way to divide two dimens and get a count? For example, if I have a box that doesn't fit on a single page, and I want to know the number of pages I'd need for the box (i.e., \heightofbox / ...
9
votes
2answers
846 views

“Arithmetic overflow” error

factorials up to 12 are handled.How can make it to compute beyond that? Error: “Arithmetic overflow \documentclass{article} \begin{document} \newcount\n \newcount\p \newcount\m ...
12
votes
3answers
1k views

How can I calculate the difference of 2 counters (pageref)?

How can I calculate the difference between 2 counters (like page numbers), so that pdfLateX outputs "3" in the last line of my example? and how could I calculate the difference between the "current" ...