Answers.Body: <p><code>&lt;itemref&gt;</code> has <code>linear="no"</code> attribute exactly for this purpose.</p>
  
  <p>Edit:</p>
  
  <p>From the <a href="http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm" rel="nofollow">epub 2 specification</a></p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>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. </p>
    
    <p>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.) </p>
    
    <p>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.</p>
  </blockquote>
  
  <p>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 <code>linear=no</code>, but it is up to reading
  system, how it deals with that.</p>
  
  <p>More advanced readers, like <code>Azardi</code> or <code>Readium</code>, works correctly and display auxilary items only on request (link click). Others, like <code>ADE</code>, or <code>Calibre</code> in your case, work in the other way. </p>
  
  <p>As I think you use <code>tex4ht</code> for conversion from <code>LaTeX</code> to <code>html</code>, you may try to generate inline footnotes, which doesn't make new file for each footnote, but are collected at the end the <code>html</code> file with:</p>
  
  <pre><code>htlatex filename "xhtml, fn-in"
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-12T10:24:58.377Z
Answers.Text: 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.
Answers.UserDisplayName: mmj
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-12T11:53:54.287Z
Answers.Text: @mmj see my edited answer
Answers.UserDisplayName: michal.h21
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-12T16:04:39.160Z
Answers.Text: 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.
Answers.UserDisplayName: mmj
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-10T19:07:34.607Z
Answers.LastActivityDate: 2014-01-12T11:53:32.037Z
Answers.LastEditDate: 2014-01-12T11:53:32.037Z
Answers.UserDisplayName: michal.h21
Body: <p>I converted an <code>html</code> source to <code>epub</code> with Calibre. Original 'html' source has got an individual <code>html</code> file for each footnote. Footnotes' files are reported in <code>&lt;spine&gt;</code> element of my <code>content.opf</code>, so they show up and can be navigated at the end of the book, which is an undesiderable behaviour. If I erase from the <code>&lt;spine&gt;</code> 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.</p>
  
  <p>How can I take such footnotes out of reading order, while keeping them displayed inside ebook viewer when the reader click on their link?</p>
  
  <p>Here is the typical <code>itemref</code> element:</p>
  
  <pre><code>&lt;itemref idref="html88"/&gt;
  </code></pre>
  
  <p>P.S. I tried <code>linear="no"</code> attribute in <code>itemref</code> 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.</p>
  
Tags: <epub>
Title: Epub OPF 'spine' element: how to exclude an html file from linear reading order, while allowing it to be accessed from a link
UserDisplayName: mmj
ThreadText: # Epub OPF 'spine' element: how to exclude an html file from linear reading order, while allowing it to be accessed from a link
  
  (Asked by: username_0 on 2014-01-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.
  
  **Tags:** epub
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-01-10. Score: 8 | Accepted answer
  
  `<itemref>` has `linear="no"` attribute exactly for this purpose.
  
  Edit:
  
  From the [epub 2 specification](http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm)
  
  > 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"
  
  ```
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_1**: @username_0 see my edited answer  
  > **username_0**: 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.  
  
  ---
  
  