to show roman numbers (“i”, “ii”, …) on the pages of the outline
then reset the page counter to 1
and to show arabic numbers within the header of the rest of the document
How can this be achieved?
Resetting the page number by counter(page).update(1) when starting “the rest of the document” doesn’t affect the number displayed in the header of the first page. There it shows the next page number after the outline (e.g. if the outline has numbers 1 and 2, then it shows 3).
And I have the problem when changing the number style (roman/arabic), that it doesn’t affect the display of the number in the header.
whether the first or the second pagebreak is weak shouldn’t matter, but one must be weak. This will make sure that the counter is updated after any footer on the old page, but before any header on the new page.
Even then, I have updated the counter to 0, since it is incremented at the beginning of each page: setting it to 1 would lead to the first shown page number being 2, which is intended behavior.
Unless you have both header and footer with line numbers, updating to zero is sufficient and the correct solution. If you have both, doing the between-page-trick is additionally necessary.