# 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 :-) 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 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? 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.
Regards
________________________________________________

edit retag close merge delete

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...

( 2016-01-30 13:33:10 +0200 )edit

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

( 2016-01-30 13:34:29 +0200 )edit

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?

( 2016-01-30 14:25:56 +0200 )edit

Sort by » oldest newest most voted

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

more

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 ?

( 2016-01-29 19:16:52 +0200 )edit

@pierre-yves samyn
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.

( 2016-02-01 11:01:27 +0200 )edit

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

( 2016-02-01 16:52:53 +0200 )edit

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!

( 2016-02-01 18:13:45 +0200 )edit

@pierre-yves samyn
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.

( 2016-02-01 18:59:51 +0200 )edit

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.

more

( 2016-01-29 18:55:36 +0200 )edit

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

https://help.libreoffice.org/Writer/C...

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

ContinueIn.odt

more

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

( 2016-01-29 04:50:50 +0200 )edit

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?

( 2016-01-29 04:52:59 +0200 )edit

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