10

I converted an html source to epub with Calibre. Original 'html' source has got an individual html file for each footnote. Footnotes' files are reported in <spine> element of my content.opf, so they show up and can be navigated at the end of the book, which is an undesiderable behaviour. If I erase from the <spine> element the references to footnotes' files, footnotes are displayed in external browser instead of Calibre ebook viewer; therefore this behaviour is less desiderable than the previous one.

How can I take such footnotes out of reading order, while keeping them displayed inside ebook viewer when the reader click on their link?

Here is the typical itemref element:

<itemref idref="html88"/>

P.S. I tried linear="no" attribute in itemref elements, but actually it did not exclude the affected files from reading, it just changed the reading order, putting affected elements at the end of reading order.

1 Answer 1

8

<itemref> has linear="no" attribute exactly for this purpose.

Edit:

From the epub 2 specification

All OPS Content Documents that are part of the publication (i.e. are listed in the manifest) which are potentially reachable by any reference mechanism allowed in this specification must be included in the spine. Such reference mechanisms include, as a partial list, hypertext links within OPS Content Documents, and references by the NCX, Tours and Guide.

and

For each itemref, the publication author may specify the optional linear attribute to designate whether the associated OPS Content Document is primary (linear="yes", which is the default when linear is not present) or auxiliary (linear="no".) It is important that the publication author include some kind of internal reference, such as a hypertext link, to any OPS Content Document that is declared to be auxiliary; it is recommended that references be added to NCX for all auxiliary content. At least one itemref in spine must be declared primary.

Specifying whether an OPS Content Document is primary or auxiliary is useful for Reading Systems which opt to present auxiliary content differently than primary content. For example, a Reading System might opt to render auxiliary content in a popup window apart from the main window which presents the primary content. (For an example of the types of content that may be considered auxiliary, refer to the example below and the subsequent discussion.)

Reading Systems are not required to differentiate between primary and auxiliary content, and for the requirements and recommendations given in this section may consider all OPS Content Documents in spine to be primary, regardless of the value of the linear attribute.

This means, all items which are referenced, as footnotes in your case, must be included in the spine. They can be declared as auxilary, with linear=no, but it is up to reading system, how it deals with that.

More advanced readers, like Azardi or Readium, works correctly and display auxilary items only on request (link click). Others, like ADE, or Calibre in your case, work in the other way.

As I think you use tex4ht for conversion from LaTeX to html, you may try to generate inline footnotes, which doesn't make new file for each footnote, but are collected at the end the html file with:

htlatex filename "xhtml, fn-in"
3
  • I tried linear="no" attribute in itemref elements, but actually it did not exclude the affected files from reading, it just changed the reading order, putting affected elements at the end of reading order.
    – mmj
    Jan 12, 2014 at 10:24
  • @mmj see my edited answer
    – michal.h21
    Jan 12, 2014 at 11:53
  • Great, avoiding the creation of one html file for each footnote during tex to html conversion is a good way to solve this problem in advance. Thanks.
    – mmj
    Jan 12, 2014 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.