How to have two different page numbers in a page header?

Hi all,
I’m trying this but with no success. I want to insert two different page numbers in the page header: one to indicate the current page and the other to continue a sequential counter of pages (I’m a legal translator and must register each page translated in a sequential, crescent order).
The page number is okay. For the other number (let’s call it “leaf”) I’ve tried different solutions. One is to insert a formula (Insert->Field->Other… Variables) with the value “Page+20”, to begin with 21 and so on. That worked while I was editing the document, but after I saved it and opened it again it didn’t work (it works with one-page documents, duh).
The other way was to insert a field from a database query which should give me the leaf number from the last recorded document. But it somehow didn’t work, and with this method I couldn’t find a way to add this queried value with the current page number.

I wish to put these two counters on the header, so I don’t have to keep double-checking each page to see if I didn’t scammed or repeated some leaf number.

Has anyone tried to do something similar? I tried googling it but with no sucess.

thanks in advance

Daniel

Try fields “Set Page Variable” and “Show Page Variable”

Set Page Var

Thanks John, this worked fine while I was editing the document, but when I saved, closed and reopened it, the field inserted was replaced by the sum of the offset and the total page number (for example, in a 2-page document which should have the “leaves” 37 and 38, the value printed is 38). And when I tried to redo the procedure, the result was always the same: 38.

I tried saving the document in .odt and .doc formats, but the result is always the same. Maybe it’s my libreoffice version (3.5.4.2 - Ubuntu)?

This is very strange. Several times I reload example from this topic - works fine.

Hi John, sorry but it still doesn’t work. Sorry, I don’t speak Russian, so I can’t see the discussion the people made in the link you posted. The main thing is, the reference to a page variable disapperas when I close the file and re-open it.

Do you set “page variable” to OFF before each new setting ON with offset?