Interconnect LibreOffice documents with hyperlinks

Interconnecting local documents with hyperlinks is an effective way to interweave a web of information, based on which we can further build our own knowledge database by categorizing and tagging. The more the interconnections, the more convenience for review and comparison. If relative URLs with respect to the file system are adopted, as long as the structure of the whole document tree is stable, these hyperlinks are still effective when the documents have been transferred to another computer.

For creating a hyperlink in LibreOffice, I used to make it point to a specific heading in the target Writer document, so that when clicking on the link, LibreOffice would jump to this heading, which is like the anchor in HTML.

However, I’ve recently found out that if a new chapter or section is inserted before the target heading, the existing hyperlinks pointing to it will become incorrect. This is because they are handled by LibreOffice via the automatic numbering of the headings instead of the heading content. Once the heading number is changed, hyperlinks to it will fail.

Therefore, the correct way to create hyperlinks to a specific point in a LibreOffice document is to use a named bookmark. To classify differet types of bookmarks, we can use a specific prefix in the bookmark name, just as we often create a label in a LaTeX document. For example, we can use

  • sec- for a heading,

  • eqn- for an equation,

  • fig- for a figure,

  • tab- for a table and

  • src- for pseudocode.

For linking to a target in a same document, the normal cross reference mechanism provided by LibreOffice can be relied on.

posted @ 2021-12-03 21:42  皮波迪先生  阅读(48)  评论(0编辑  收藏  举报