Bug 121146 - table of contents missing in EPUB export
Summary: table of contents missing in EPUB export
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
6.1.2.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 131410 131514 (view as bug list)
Depends on:
Blocks: TableofContents-Indexes EPUB-Export
  Show dependency treegraph
 
Reported: 2018-11-03 15:43 UTC by Kirk Sauber
Modified: 2024-11-12 19:03 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kirk Sauber 2018-11-03 15:43:02 UTC
Description:
I created a document with a Table of Contents, but when exported to epub format the Table of Contents is not there.   I have tested this in both OSX and Linux with the same result.

Also, I'd like to request an option to not include page number in the TOC function  as page numbers are frequently meaningless depending on the screen size of the viewing device.

Steps to Reproduce:
1. Create Table of Contents (TOC) for document
2. Export document to EPUB
3. View with EPUB reader -- TOC is missing

Actual Results:
TOC is missing

Expected Results:
TOC should be there


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Put TOC in the EPUB exported file
Comment 1 raal 2018-11-07 17:07:51 UTC
Confirm with Version: 6.2.0.0.alpha1+
Build ID: b0da1ca2d7a426ff13f39b21362fbcd5c0580c24
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3;
Comment 2 Xisco Faulí 2018-11-08 10:59:16 UTC
@Miklos, I thought you could be interested in this issue...
Comment 3 Cor Nouws 2018-11-08 22:02:45 UTC
Hi Kirk,

I confirm what you see. This part of export hasn't been implemented yet.

Cor
Comment 4 lbartolome 2018-11-16 18:37:30 UTC
Another issue with the TOC is that if you're exporting the epub with an odt with blank section pages (using not a master document but including these to start chapters on a right page), those pages are also included both in the TOC as section X and the epub.
Comment 5 Xisco Faulí 2020-03-19 11:43:58 UTC
*** Bug 131410 has been marked as a duplicate of this bug. ***
Comment 6 Dieter 2020-09-22 06:16:49 UTC
*** Bug 131514 has been marked as a duplicate of this bug. ***
Comment 7 Phil Stracchino 2023-12-15 13:57:06 UTC
Additional information to this:

The DYNAMIC table of contents in the .epub (visible from for example Kindle book menus) is created, and works.  However, it is broken.
— It may contain extra sections not listed in the table of contents created by the user
— If chapter numbers are used in chapter headings, then all dynamic TOC entries are truncated after the chapter number
— If chapter headings do NOT contain chapter numbers, then chapter titles in the dynamic TOC are truncated after a random number of words

Additionally, much of this only seems to work at all if page breaks are used in the export operation to determine sections.  Using headings for section breaks does not appear to work.


My workaround at this time is:
1. Insert a static Contents page AND
2. Use Sigil or Calibre to fix up the dynamic TOC in the EPUB itself after each export

Obviously these are not ideal, but they work.
Comment 8 Phil Stracchino 2024-11-12 19:03:20 UTC
Further information:  Bug #163857 suggests that rather than being influenced by chapter numbers, whether or not a TOC entry is broken depends on whether the heading line was ever edited after being initially created.  If it was created in one shot and then never touched again, the TOC entry will be correct.  If you have EVER edited that heading line, then its TOC will be broken.

In other words, this entire aspect of the broken-TOC problem appears to be a side-effect of #141187.