Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom page header in ODT documents #1505

Closed
Tracked by #1269
xahodo opened this issue Aug 16, 2023 · 11 comments · Fixed by #1675
Closed
Tracked by #1269

Custom page header in ODT documents #1505

xahodo opened this issue Aug 16, 2023 · 11 comments · Fixed by #1675
Assignees
Labels
build tool Component: Exports or the build tool enhancement Request: New feature or improvement next release Note: Features planned for next release

Comments

@xahodo
Copy link

xahodo commented Aug 16, 2023

Submitted manuscripts usually have a front page which lists the author's contact details, word count, and the name of the novel, below which is the author's name.

On the second page, the page count usually is expected to start (by editors, agents, and the like). They usually expect the page header to look a certain way. They are very specific about this and the odds of rejection increase if you do not comply with their specific requirements.

Would it be possible to have the build tool create a custom page heading when exporting to LibreOffice format?

In LibreOffice getting a custom heading involving done, which starts on another page than the first page is usually quite the nightmare to get done involving page styles, messing extensively with headers. Woe thee when you make one mistake. If I could tell the project builder to generate one for me, that would spare me a lot of frustration in LO later on.

The interface could be something like a simple textbox where I enter some text with a checkbox (whether or not it's wanted for inclusion), perhaps a drop down list for alignment (left, right, or middle) and a text box for a page number where the first heading should start appearing.

You could even have multiple (a Roman numeral section and a Arabic numeral section, for example). If you do this, a per item numeric type would be handy.

@xahodo xahodo added the enhancement Request: New feature or improvement label Aug 16, 2023
@vkbo
Copy link
Owner

vkbo commented Aug 22, 2023

Editing the text of the page header in LibreOffice is trivially simple. You just click it and type what you want. So I don't really see the need here. But sure, making it a text box in the Build Tool isn't a big deal either. Adding an option to include/exclude it from first page, as well as alignment, is also straightforward.

I'm not sure about the Arabic/Roman bit. The page numbers are generated by LibreOffice, not novelWriter.

@vkbo vkbo self-assigned this Aug 22, 2023
@vkbo vkbo added build tool Component: Exports or the build tool planned Note: Feature planned for a later release labels Aug 22, 2023
@vkbo vkbo added this to the Build Tool Rewrite milestone Aug 22, 2023
@vkbo vkbo mentioned this issue Aug 22, 2023
28 tasks
@xahodo
Copy link
Author

xahodo commented Aug 22, 2023

The difficult bit with the custom header is most certainly not actually creating it, nor on which page it needs to start.

The difficult bit is things like this: title - author - page number. The point being that the page count should start with 1, on page 2 (or whatever other page), while including the string. I have wrestled with LO over this and lost my sanity.

Now, I could start wrestling with page styles and include it that way, but I have not figured out how to get what I want that way as it's also not trivial.

@vkbo
Copy link
Owner

vkbo commented Aug 22, 2023

Ah, I see. The problem here is, as I indicated, that novelWriter doesn't actually do any of that. It's all in the word processor. OpenDocument is an open standard, as implied by the name, so I cannot tailor it for LibreOffice either. It's compatible with a bunch of office apps.

If there is a way to tune some of this that is part of the actual standard, then maybe I can add some more features. However, this takes a bit of research. The standard schema is available here.

@vkbo
Copy link
Owner

vkbo commented Aug 22, 2023

You can export a sample document as fodt, and manually edit the XML file and test. It's basically how I built the entire ODT feature of novelWriter from scratch 😄

@vkbo
Copy link
Owner

vkbo commented Aug 22, 2023

Ok, adding text:page-adjust="-1" to the text:page-number element in style:header seems to do the trick with page number offsets.

  <office:master-styles>
    <style:master-page style:name="Standard" style:page-layout-name="PM1">
      <style:header>
        <text:p text:style-name="Header">Sample Project / Jane Smith / <text:page-number text:select-page="current" text:page-adjust="-1">2</text:page-number></text:p>
      </style:header>
      <style:header-first>
        <text:p text:style-name="Header" />
      </style:header-first>
    </style:master-page>
  </office:master-styles>

@vkbo
Copy link
Owner

vkbo commented Aug 22, 2023

I've considered before to make a proper set of cover page options, which wasn't really possible until the new build tool redesign. Perhaps it's time to add a "Cover Page" tab to the build settings. I could start with adding the points listed here:

https://self-publishingschool.com/manuscript-format/

@xahodo
Copy link
Author

xahodo commented Sep 2, 2023

I have my reservations about messing with LO files, because I don't know how LO will respond to fun things like typos or missing elements.

It would be great if there's an option to create a front page of the manuscript. It would be even better if you can tweak it in all kinds of ways. F.e.: author info top left or top right? What to include with author info?

@vkbo
Copy link
Owner

vkbo commented Sep 2, 2023

By editing the Open Document files, I meant in order to figure out how to make it do what you want it to do, so I can implement it in novelWriter. I did not mean as a way to create the desired result.

The way novelWriter creates ODT and FODT docs is by generating the raw XML according to the document standard. The standard is hard to read and follow, so the easiest way is to experiment. You can do it on a sample document.

@xahodo
Copy link
Author

xahodo commented Sep 11, 2023

It appears novelwriter is already doing what I asked for. Except for 1) page numbering should start with "1", no matter which page the page numbering actually starts on; and 2) some customization options for this would be nice.

I sincerely apologize for not doing my homework.

@vkbo
Copy link
Owner

vkbo commented Sep 11, 2023

novelWriter doesn't do any numbering as I've said. The current scheme is the default, and I only hide it from the first page, as is customary. To change which page is number 1 you have to change what number the counter starts on to -1 or -2, depending on what result you want.

I'll try and add some more customisation options.

@vkbo vkbo modified the milestones: Build Tool Rewrite, Release 2.3 Beta 1 Jan 27, 2024
@vkbo vkbo added next release Note: Features planned for next release and removed planned Note: Feature planned for a later release labels Jan 27, 2024
@vkbo vkbo linked a pull request Jan 28, 2024 that will close this issue
6 tasks
@vkbo vkbo changed the title [Build tool]Custom page header Custom page header in ODT documents Jan 28, 2024
@vkbo
Copy link
Owner

vkbo commented Jan 28, 2024

PR #1675 adds the following two options to the Manuscript Build Settings dialog on the Output page:

image

I believe this solves the request.

@vkbo vkbo closed this as completed Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build tool Component: Exports or the build tool enhancement Request: New feature or improvement next release Note: Features planned for next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants