I want to generate running headers for pages of a Bible that have the first and last verse numbers on each page. I don’t see anything obvious in the documentation or the help community. Thanks!
Patrick
I want to generate running headers for pages of a Bible that have the first and last verse numbers on each page. I don’t see anything obvious in the documentation or the help community. Thanks!
Patrick
Retrieving first and last data of some “structured” sequence can be done, though a bit tricky.
Fields in the header will show the state at start of page. So, you get the first data.
Last data is available only in the footer. Consequently, if you want it to be shown in the header, you must cheat: the field is inserted in a text frame anchored in the footer. Fortunately anchor and position are independent from each other. The frame style forces the frame to appear in the header.
The key point here is the generation of the verse number. There are several possibilities. Which one to chose depends on what you want to do with the verse number: simply tag verses, or use it also in TOC.
Please give more details on your project. Very important: my suggestions all rely on Writer features. Consequently, the document will be stable, reliable and maintainable (edits and reviews) only in .odt format. DOCX will lead to failure.
EDIT: I was a bit too optimistic. I experimented and met a difficulty where I didn’t expect it. Stay tuned, I try to get a workaround.
EDIT 2: See bug tdf#167851. Presently you can’t retrieve the correct first verse number in the page when the first paragraph has several.
Thanks! That’s a lot further along than I anticipated!
The verse numbers are already appear before the verses. Only the book names, Genesis, Exodus, etc. will appear in the TOC.
When you say “state at the start of a page,” if Genesis, Chapter 1, appear before Gen. 1:1, would I still have access to Gen. 1:1, assuming it has a distinct style for selection in the field?
Or is generation of the verse numbers tied to the population of fields for the starting verse (none appears on the starting page of a chapter) and the field on the frame for the closing verse on a page?
The particular translation I am working on at present is to be a presentation object to one of our funders in printed and bound form. So I don’t need cross-refs, indexes, maps, etc. Those may follow but at present I just need a clean looking, with a good font, kerning, etc.
Thanks again!
Patrick
By setting the verse numbers as references, I was then able to insert the references in the header.
Refer using “Referenced Text” in the header. This example isn’t entirely correct because 1:1 should not appear on the first page of a chapter. But I did it to show how the next page would appear.
Anyway, the challenge is going to be finding the first digit:digit on a page and the last one, then inserting in the header as appropriate. The verse numbering is already part of the source I am using so I don’t need the list numbering functions.
Any tutorials on Python and ODF that you could suggest for addressing the content of page objects?
I’m experimenting with formats, I may switch to double columns but I think single column doesn’t look bad and it wastes less space. Thanks in advance for any tips or pointers.
Patrick
Your screenshot shows a simplified layout: usually paragraphs contain several verses. Here by restricting paragraphs to single verse, you can apply some Heading n style to your verse to get automatic numbering.
It is then very easy to retrieve the first heading number in the header (please specify exactly how you want the verse number to look like in text (does it include chapter number?).
The last heading number is retrieved in the footer (mandatory). The trick is to put this field inside a text frame anchored in the footer by positioned in the header. Thus, data is retrieved in footer context but visually shows up at top.
Attach a sample file corresponding to the screenshot so that I get an idea about your document structure. A critical point is how you create the chapter heading. It is necessary that your two lines are a single paragraph and this paragraph is the very first in the page (no empty paragraph preceding it).
Thanks again! I have attached the sample file.
What I was hoping for was to obtain a page object, then match the first and last text of the form [0-9]:[0-9], if the text is 1:1, set no reference, otherwise, first match is insert reference left margin, second match insert reference right margin.
Verse numbering is supplied as part of the text and is NOT generated as part of the text processing. (Not a problem here but text can have discontinuous numbering.)
I can avoid confusion about the regex matches by running a script to set and insert the reference before any other headings or other materials, like a foreward, are inserted in separate parts of the document.
So I think my question has morphed to how to set and insert references in a header, based on regex matches in the text of a page object? Assuming that a regex can find all the occurrences and then take the last one.
Thanks again!
I constructed the file as flat ODF XML but the upload insisted on odf extension for uploading.
Patrick
verse-numbering-two-pages.odt (34.6 KB)
Temporary answer (I’m quite busy for the next few hours and shall come back with a better answer).
You erroneously focused your attention on processing the document in some programming language, be it a collection of shell scripts with regexp. What you are looking for can be achieved with built-in features, like cross-references.
Verse numbering can be generated by Writer and should if you want to cross-reference it automatically. I initially thought of adding auto-incrementing variable in case you have several verses per paragraph. But, you have simplified the design by restricting paragraph with a single verse. Therefore, your paragraph can be made a heading (not the best idea but it is simple to implement) with auto-numbering.
What is very bad in your layout is vertical spacing with empty paragraphs. Sooner or later this will play nasty tricks on your back. I’ll show you how to proceed in a revised version.
Your design is quite simple because you’ve reduced every paragraph to single verse.
You must first structure adequately your document. I chose:
Your verses will be styled Heading 10, the least significant level. This is an abuse because verses are not headings. There is also an abuse because I leave a huge gap between real heading levels and level 10 abusively used for narrative.
Level 10 is numbered to provide automatically the verse number. It is reset when you enter a new chapter (benefit of the heading numbering feature). Heading 10 is customised to look like Body Text to visually hide the abuse. Also a specific character style Verse Number is applied on the number.
All empty paragraphs are removed. Spacing is configured in Heading 10, Indents & Spacing
tab.
This takes care of the global structure.
The header allows to retrieve heading state at top of page. Consequently, I insert in the header two fields with Insert
>Fields
>More fields
:
Document
tab, Type Heading, Format Heading number without separator, Up to level: 2The header is styled Header (customised with direct formatting removed).
On first page of chapter, the first paragraph is a Heading 1, consequently the Heading 2 does not exist yet and the returned value is empty; same for level-10. This leaves only the colon separator. It can be eliminated by configuring specially the page style.
Retrieving last verse in the page requires to collect it from the footer where this information is available. Since you want it displayed in the header, you must use a feature which decorrelate context information from position: a frame.
I create a (text) frame in the footer. Inside the frame I insert the same fields as in the header, exactly the same, with style Header applied (to make it look exactly like the header). An ad-hoc frame style is applied to the frame Last Verse Ref.
Last Verse Ref is configured AutoSize at Right of Paragraph text area and 2cm From top of Entire Page. Wrap
Spacing and Borders
Padding are set to zero to facilitate alignment with data already in the header.
EDIT: if you want to move the frame somewhere else or tune its position, don’t do this with the mouse. It would add direct formatting you would not be able to get rid of and it would mess up the layout. Proceed exclusively be modifying the frame style. END OF EDIT
You’re done. Simply add your verses. They are automatically numbered and the header display needed information.
The general layout may be refined but you get the idea.
verse-numbering-two-pages-ajl.odt (49.0 KB)
You wonder about 2-column layout. Here is a complex example where the requirement was not about verse numbering (note that there are several verses in each paragraph) but about having both footnotes and margin notes.
ComplexLayoutExample.odt (43.7 KB)
Thanks! I’ve been away at a conference. Much appreciated.