Text field formula for odd/even page numbering

Discuss the word processor
Post Reply
eeigor
Posts: 214
Joined: Sun Apr 12, 2020 10:56 pm

Text field formula for odd/even page numbering

Post by eeigor »

Please help me make a formula for the text field of a page, so that only odd (or even) pages are numbered sequentially, in increments of 1. That is: page 1 - number 1, page 2 - "", page 3 - number 2, page 4 - "", page 5 - number 3, and so on, if you number the odd pages.
Sometimes you have to number the sheets, not the pages. For example, if the document is printed on both sides of the sheet, and only the sheets are numbered sequentially.

Attached file - How do I do the same in LO Writer?
Open only in MS Word, see only the formula in the header. Press Alt+F9 to display the formula in the header.
Formula:
{ IF{ MOD({ PAGE };2) }=0{ =INT({ PAGE }/2+1) } }
Attachments
Word-example.docx
(109.4 KiB) Downloaded 74 times
Ubuntu 18.04 LTS • LibreOffice 7.5.3.2 Community
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Text field formula for odd/even page numbering

Post by Zizi64 »

For example, if the document is printed on both sides of the sheet, and only the sheets are numbered sequentially.
It is better to numbering all of the pages of an official document. I do not know if that "sheet numbering" is exist in the AOO/LO Writer...

https://ask.libreoffice.org/t/writer-ho ... ages/32951
Last edited by Zizi64 on Thu Jun 01, 2023 7:50 pm, edited 1 time in total.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
eeigor
Posts: 214
Joined: Sun Apr 12, 2020 10:56 pm

Re: Text field formula for odd/even page numbering

Post by eeigor »

The question is, is it possible to adapt a formula from MS Word here. Or is it possible to solve this problem with a macro?
Ubuntu 18.04 LTS • LibreOffice 7.5.3.2 Community
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Text field formula for odd/even page numbering

Post by RoryOF »

As far as I remember, one cannot manipulate the Page field as you suggest. It might be possible to manipulate a user defined sequential field, but I don't know for certain.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Text field formula for odd/even page numbering

Post by JeJe »

The attached document has alternate page styles (I’ve just used the built in Left Page and Right Page) and I've manually set the page number for each Left Page to be only 1 more than the last.
Attachments
Alternate page numbering.odt
(12.67 KiB) Downloaded 42 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Text field formula for odd/even page numbering

Post by JeJe »

Another approach would be to use a text frame in place of the header on alternate pages (anchored to the page) together with a numbering field.

(Edit: You just have to copy and paste the text frame onto further alternate pages to extend this)
Attachments
text frames with Number Range Field.odt
(11.83 KiB) Downloaded 39 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply