Generalhow to reset custom counter for every page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
mappo
Posts: 25
Joined: Thu Nov 29, 2007 11:19 am

how to reset custom counter for every page

Post by mappo »

I'm helping some people converting a play script from a dozen .doc files to LaTeX.

Currently I'm editing the package sides. I want to number the lines in the
script like this <page>.<lineN> where page of course is the standard page counter
and lineN my own, already implemented counter of lines.

The thing is that I'd like lineN to reset to 1 at the start of every new page in the
output document.

I've looked at \numberwithin, but I never got it to work and a package named chappg
but it seems to do the opposite - reset page in every chapter.

Any suggestions?
If you don't recycle, you're throwing it all away.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

how to reset custom counter for every page

Post by localghost »

Seems to be a job for the perpage package from the bigfoot bundle.


Best regards
Thorsten¹
User avatar
mappo
Posts: 25
Joined: Thu Nov 29, 2007 11:19 am

Re: how to reset custom counter for every page

Post by mappo »

The doc looks very promising. I'll check it out - thank you!
If you don't recycle, you're throwing it all away.
Post Reply