Page numbers issue with RST generated file

Discuss the word processor
Post Reply
bryanvick
Posts: 3
Joined: Thu Sep 02, 2010 6:59 pm

Page numbers issue with RST generated file

Post by bryanvick »

The attached document has "Page x of y" in the footer. On Ubuntu 9.04 and OpenOffice 3.0.1, the page numbers show up. On Windows XP and OpenOffice 3.2.0, the only thing that shows in the footer is "Page". The page numbers also did not show on an Ubuntu 8.10 box with OpenOffice 2.4.

When I uncompress the odt file, and look in the styles.xml file, I see elements that seem like they should be showing the page numbers:

<text:p text:style-name="rststyle-footer">Page
<text:p text:style-name="rststyle-footer">
<text:page-number text:select-page="current" text:style-name="rststyle-footer" /> of <text:page-count text:style-name="rststyle-footer" />
</text:p>
</text:p>

Can anyone confirm the missing page numbers on any of the configurations that didn't work for me, or any other configuration?

Title Edited. A descriptive title for posts helps others who are searching for solutions and increases the chances of a reply (Hagar, Moderator).
Attachments
test.odt
(8.76 KiB) Downloaded 98 times
My operating systems and OpenOffice versions vary. 1.2.3.4
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: Page numbers don't work on Win XP OO 3.2

Post by Bill »

Turn off viewing of field names: View > Field Names
thomasjk
Volunteer
Posts: 4451
Joined: Tue Dec 25, 2007 4:52 pm
Location: North Carolina

Re: Page numbers don't work on Win XP OO 3.2

Post by thomasjk »

If I do Insert--->Fields-->Page Number in the footer, it works for me. Win 7 and V3.2.1.
Tom K.
Windows 10 Home version 1803 17134.165
LibreOffice 5.4.7.2
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Page numbers don't work on Win XP OO 3.2

Post by RoryOF »

Works on OOo 3.2.1 on Ubuntu 10.4. Make sure / View / Field Names is off. Useful to turn on / View / Field Shading, which puts a grey background (non printing) to all fields.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
bryanvick
Posts: 3
Joined: Thu Sep 02, 2010 6:59 pm

Re: Page numbers don't work on Win XP OO 3.2

Post by bryanvick »

I should have been a bit more clear.

I can insert page numbers using OpenOffice 3.2 on Windows XP. But the document I attached is being created by another program called rst2odt. It is part of the docutils package for python. It converts RestructuredText to ODT.

So, page numbers work find when I am creating documents manually with my mouse and keyboard. But for some reason this particular documents page numbers have only shown up for me in Ubuntu 9.04 with OpenOffice 3.01.

If the page numbers didn't show in any combination of OO/OS, I would think that the problem was with the rst2odt script. But the weird thing is that the documents produced by rst2odt *do* show page numbers in at least 2 configurations of OO/OS that I know of. Here is a breakdown of when it works, and when it doesn't:

Working:
- OO 3.2 on Ubuntu 10.04
- OO 3.01 on Ubuntu 9.04


Not working:
- OO 2.4 on Ubuntu 8.10
- OO 3.2 on Windows XP

Why would it work in OO 3.2 on Ubuntu, but now Windows?

I have a thread going with the rst2odt group also here:
http://news.gmane.org/gmane.text.docutils.user
My operating systems and OpenOffice versions vary. 1.2.3.4
User avatar
Hagar Delest
Moderator
Posts: 32665
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Page numbers don't work on Win XP OO 3.2

Post by Hagar Delest »

The file made by RST is rather strange.

Here is the file uploaded above (styles.xml):
RST file.png
There is a strange block of text in the footer declaration.

Here is the same file where I've just added the fields (current page of page count):
RST file with field.png
RST file with field.png (6.02 KiB) Viewed 3016 times
The strange thing is that some OOo flavors manage to see the fields. I would say that the RST generation has a problem.

On xubuntu 10.04 with the vanilla version (3.2.1), there is no field displayed.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Page numbers issue with RST generated file

Post by acknak »

Good catch, Hagar; I agree--that doesn't look quite right. I don't see how it makes sense to have nested style definitions like that.

The file also does not pass validation (http://tools.services.openoffice.org/odfvalidator):
Result for test(5).odt

This file is NOT valid

Result details:

upload:///test(5).odt/styles.xml[1,15727]:Error:attribute "ns2:default-outline-level" has a bad value: "" does not satisfy the "positiveInteger" type
upload:///test(5).odt/styles.xml[1,19754]:Error:attribute "ns2:default-outline-level" has a bad value: "" does not satisfy the "positiveInteger" type
upload:///test(5).odt/styles.xml[1,34808]:Error:attribute "ns2:default-outline-level" has a bad value: "" does not satisfy the "positiveInteger" type
upload:///test(5).odt/styles.xml[1,56661]:Error:unexpected attribute "ns3:name"
upload:///test(5).odt/styles.xml[1,101398]:Error:unexpected attribute "office:version"
upload:///test(5).odt/content.xml[1,1787]:Error:unexpected character literal
upload:///test(5).odt:Info:validation errors found
upload:///test(5).odt:Info:Generator: Docutils/rst2odf.py/1.0a
That seems to refer to a different part of the file, although [1,101398] is line 1087 in Hagar's top image.

I'm just throwing this out; I don't know what (if anything) it means.
AOO4/LO5 • Linux • Fedora 23
dkuhlman1
Posts: 1
Joined: Fri Sep 03, 2010 7:36 pm

Re: Page numbers issue with RST generated file

Post by dkuhlman1 »

I'm the one who works on that back-end for Docutils(http://docutils.sourceforge.net/) that generates .odt files from reStructuredText. The suggestion above was right. I was generating invalid XML. When I was finally able to spot and remove an extra level of nesting in the XML, the resulting documents viewed correctly on both Linux and MS Windows.

So, thanks for focusing my attention. And thanks for the link to the validator (above). That was (and will be) helpful, also.

- Dave
Dave Kuhlman
OpenOffice.org 3.2.0
Ubuntu GNU/Linux 10.04.1 LTS x86_64
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Page numbers issue with RST generated file

Post by acknak »

Good news! Thanks for the follow-up.
AOO4/LO5 • Linux • Fedora 23
Post Reply