Contents | Start | End | Previous: KB0414: How to implement custom list bullets | Next: KB0416: How do I add a horizontal rule?


KB0415: How do I add cross-references to page numbers in an OpenDocument file?

You can add cross-reference to page numbers for OpenDocument (ODT) files.

Use the menu command Format | Insert | Links | Cross-reference. Select Bookmark as the reference type and Page as the format.

After updating all fields in LibreOffice, this will show as a page number in ODT, and "here" in your ebook. You can change the translation for "here" using a string table: see How to adapt Jutoh to your language.

Unfortunately, it won't insert the word "page" automatically, so that's a bit of a problem when generating ebook as well as an ODT file. To work around this, place the keyword %PAGE% in your content, e.g:

See %PAGE%here

where 'here' is what Jutoh shows after inserting the cross-reference.

Then, create two string tables - one with the variable PAGE set to nothing, and one with PAGE set to "page ". Note the space after "page" since we're adding or removing a whole word. Then set the appropriate Project string table value in each configuration, and enable the configuration option Replace strings in context.

Now compiling with each configuration will show "See here" or "See page 5" as required.


Contents | Start | End | Previous: KB0414: How to implement custom list bullets | Next: KB0416: How do I add a horizontal rule?