I'm a new user of this forum (and of any forum !).
I don't speak or write English easily (I think you have already understood this ).
I read the board rules and I apologize if I don't respect some rules.
I've searched on the forum but I probably miss the answer. My English is so bad that it's possible I read the answer but I don't understand it.
My question :
I try to use the memoir class to do a document with this page numbering:
"<part number> - <chapter number> - <page number> / <number of pages of the current chapter>".
But I don't have any idea on how to obtain the number of the last page of the chapter.
Thanks for the help, and if not thanks for the reading (I think my post it's probably not easy to read).
That's a very unusual numbering style. I would think again, if such a numbering is really required, since implementing it would be a bit challenging. I would start this way:
Hook into the \chapter command or a related one, to automatically place a label, for example:
If you need calculations, such as page number minus pages of chapter, use the calc package.
However, in my opinion numbering such as I - 1 - 12 / 19 is very strange and I think it's not very useful for the original purpose of page numbering: to look up pages using the numbers you got from the table of contents. It looks more like "look, I can count in a complex way and I've got a lot to count." Also, a total number of pages in a chapter is not useful for look-up. Sometimes, numbering such as 1 of 17 is used in presentations, where the audience may wish to know how much slides are left.
I simply would not do this, saving a lot of time which could be used to improve the content and the layout.
A little explanation : i'm a teacher and i want to give to my students a lot of sheets concerning functions, probability, ... but each of them are fragmented in several intermediate curses and those intermediate curses are given like this : some curse about function, some curse about proba then function ... so i want a numbering which permit to the pupils to "easily" know if they have all the pages of a chapter (and so my question) and to keep the sheets in the "logical" way (all sheets about functions in one part, ...).
I prefer a hard numbering but a "sure" numbering (because i'm not sure that my students are well ordonned). But if someone has a better idea i listen with attention.
Sorry Stefan_K, i've closed the post (edited now) but i've been a little blind : the code works well for all pages but not for the last page of the chapter just before a new part where the number printed is the number of the first page of the first chapter of the new part.
To be clear : with the code below, the page (not blank) before the second part is numbered "I : 1.2 / 2.1" but the correct numbering is "I : 1.2 / 1.2"
It works like if \part acts after the corresponding page is created (so it's a chapter page and not a part page when the \pageref is computed).
I tried very boldly some things : \patchcommand{\part}{\clearforchapter}{} to simulate a new chapter and stop the numbering for exemple but it doesn't work (some conditionals too with respect to the sectioning degree).
I tried to understand what happens : it seems to me that the state of the page ("chapter" and not "part") is not good or the effect of the cross-reference come too soon.
But i see truly that i don't understand nothing : i read that the \pageref print the number of the page where the \label command appears so the \label is processed at the end of the building of the chapter and not at the first page of the chapter ? or \chapter (or \clearforchapter) is processed on each page of the current chapter ?