Creating an Epub file with a clickable TOC using Libreoffice and Google Docs

We recommend you bookmark this blog. Trying to find helpful information in forums usually just ends in making you frustrated and angry. This blog does not speculate or guess. If we post it, we've tried it and it works.

In LibreOffice: Create a LibreOffice Writer document.

Format the document using Styles, using Headings (1,2,3,4 etc) for TOC levels (example: Heading 1 for Chapter name; Heading 2 for Chapter Subtopic; and so forth).
  1. Insert a Table of Contents into the document (Insert, Table of Contents and Index)
  2. “Create From” “Additional Styles” Select the Heading levels you used in your document (Heading 1, Heading 2, Heading etc.). 
  3. Select only as many levels as you want to see in your TOC.

To Create a PDF in LibreOffice

  1. File, Export to PDF
  2. Choose “Archival” and “Export Outlines” (in addition to other Default settings).

To Create an epub from a LibreOffice Writer file

DON’T USE THE LIBREOFFICE FUNCTION (File, Export to Epub) if you want to create an epub that includes a TOC with functioning links. You might be able to capture the TOC, but none of the TOC links are clickable (as of 2024-01-30, there are forums in which this has been submitted as an error in LO).

Instead:

  1. Upload your LO .odt file to Google Drive.
  2. In Google Drive, right-click the uploaded .odt document and select Open with Google Docs.
  3. In the newly-created Google Doc, select File, Download, Epub publication.
  4. Choose the location where you want to save the epub and click Save.
Now you have an epub on your desktop that has a TOC with clickable links. What to do with your new epub? Well, that depends on what your end-game is. In my case, I convert public domain books for my own reading and to either sell or make available free to others. On my desktop, creating an epub as described in this post allows me to upload it directly from my desktop to my Google Play Books collection for reading on my desktop or my smart phone. On my desktop, I can also open the epub file directly with my Calibre ebook viewer application. (Note that this ebook still will not be accessible to Foliate, and has not been tested with any other ebook viewers for desktops or phones.)

Notes:

Presumably, the procedures in this post would also work with a Microsoft Word document.
My OS is Ubuntu Linux. My word processor is LibreOffice Writer (also available for Windows). 
Other book creators are certain to have other software (Sigil, etc.) and methods for creating ebooks. I offer mine because it involves no expense (unless you pay for extra Drive space), it is simple, and it works. 

Comments

  1. Super, thank you. I have been struggling with the epub export option as LO does not include headings 2, 3, etc in the epub's native ToC.

    ReplyDelete

Post a Comment

Only comments that improve or disprove the contents of the posts on this blog will be approved. Opinions and speculations generally will not be approved. "Self-serving" links will not be approved. Product and advertising links will not be approved, but plain text recommendations might be approved. No form of vulgarity or cursing will be approved. No personal disparaging remarks will be approved. All comments become the property of this blog immediately upon the member's/reader's posting of the comment. All comments may be rejected or edited without recourse to or by the commenter. By posting, you agree to hold harmless this blog, its owner, editors, administrators and contributors, even if your post is approved as-is.

Popular posts from this blog

LibreOffice Freeze and Slowdown - "Memory" and "Undo" Settings

Compose Key versus Special Character Function in LO Writer