How To, in footer, insert formula, like NextPage = Page Number +1

Hi, My illustrious friends!

Suppose I am writing a legal document and wish to express continuity by writing, " Continued to Page ‘so and so’ " where the ‘so and so’ actually changes as per the next page number.

How to write that formula, such as “Fields → Insert → Others → Formula” and the said required page number would be placed at the cursor position?

I should also be able to save the formula as a user defined formula with name as NextPage.

There is already one in “Fields → Document → Page → Next Page” but at the end of the page count I also like to remove the comment “Continued to …”

My regards

_________________________________________________

Further to m.a.riosv’s help post. I attach this file and lay down further clarification…

29012016.odt

__________________________________________________

To Pierre-Yves Samyn.

Already thanked :slight_smile: Actually, Got_it.odt is what I wanted. Yes, understood your point of view.

How did you accomplish the task, please elaborate. I tried but failed.

What about doing the job with code? Is that possible? Could we use codes in header / footer?

I will elaborate those comments:

I want to use a code which would take care of this issue, like a branch step with if-elif-then etc., in header and footer.

Like, if Page Number = Page Count then " "; elif “Continue to Page Page Number” in footer. Any help on this please? Like if Page Number = 1 then " "; elif "Continued from Page ‘Privious Page’ " in header. Any help on this please?

I want to place those codes on the header and footer respectively…

[I shifted the queries regarding “creating a new, and changing, page styles” to a new thread, [How to create and change a page style in a final document?](How to create and change a page style in a final document?)
My regards.

_________________________________________________



@Pierre-Yves Samyn
On 1st February:

I checked your edited file trying to find clues. It appears that you don’t activate Header in the first page for the Default style. Is it so? Then, for the second page you apply the preformatted style and use header.

I have rarely had this kind of scenario that demands my learning Style and Formatting.

Please be my master!

Regards

________________________________________________

Thanks for thanks. As you can see here a PAGE variable gives total number of pages but we have not a variable for testing the current page. Moreover, by definition, what is put in the header/footer, applies to all pages applying this style. A “fragile” possibility is to create bookmarks to pages, allowing to insert somewhere else a reference to the page where the bookmark is.
continued…

More…

I say it is “fragile” because the bookmarks can be easily removed by the user. So my answer is no, “using codes” does not sound good for me.

Regards

Which means codes can be incorporated. Then why not try? Are you aware of coding these Objects like Page Number, PreviousPage or NextPage? Do the Open Office programmers visit this forum? How can I appeal to them?

Hi

In LibreOffice page styles manage page layout: size, orientation, margins, background, columns, borders, and headers and footers.

If a document contains pages differing from the other on one (or more) of these attributes, apply a page style for the desired presentation.

So, and sorry if I misunderstood the question, the solution seems to me to apply a different page style for the first and last page as in the Continued.odt attached.

Regards

Thanks again for helping me for the second time. I had placed three consecutive comments below. Please suggest if the work is possible with code like if-elseif-then ?

@PYS
I have a query, which as been posted in the query. I don’t see how you omitted the first page Header? I could see the change in last page.

Hope you will reply.
Regards

I applied the First Page style to the first page. This style does not display header or footer. Moreover it is automatically followed by a “Default Style” page. This parameter in the Organizer tab lists Next Style.

Regards

You are great! How do you get to know these nitty-gritty?

Like I came to know for the 1st time by opening Format/Page that First Page style is followed by Default Style.

Does the link that you have sent for the help file contain these details? I am surprised how much there is to know!!!

Kudos, Master!

@PYS

Aided by ur file and ideas I created a “Last Page” style, and achieved d desired results.

Oh! After keen observation I found out dat u were easily able(not diminishing ur position as my teacher) to incorporate d desired becos d doc was petty by ur standards.

Obsrving ur inputs and advice I could do d same wid a continuous (essay) documnt. Thnx!!!

Really! I admit dat u knew a gr8 deal. Hadn’t I engaged you, dis would have been forever out of my reach.

I think you can do it with cross reference, where you can select what kind of reference use.

https://help.libreoffice.org/Writer/Cross-references

Attached a sample file, remember update in Menu/Tools/Update when referenced pages change.

ContinueIn.odt

Hi!
Thank you for your inputs. There are two issues:
For me the issue is about repetitive work, like pagination. For this we need header and footer.
In the first page, “continued from page” is irrelavant. In the last page, "Continued on Page " is nonsense.

I want to use a code which would take care of this issue, like a branch step with if-elif-then etc., in header and footer.
…Continued

Like,
if Page Number = Page Count then " "; elif “Continue to Page Page Number” in footer.
Any help on this please?
Like if Page Number = 1 then " "; elif "Continued from Page ‘Privious Page’ " in header.
Any help on this please?

I want to place those codes on the header and footer respectively…

Thank you for replying…

My regards.

If you use in Header/Footer Fields from:

Insert->Fields->More Fields… then Tab:Document->Page you get a selection in center column

Pagenumbers, Previous Page, Next Page.

Any extra text “continued…” will have to be typed in Header/Footer.

My dear Sir, while I appreciate your intent to help, have you, I am most humbly asking, read the question and solution required before posting your answer?