0

I'm currently building epubs by hand (ok, I do cheat and use Calibre's epub editor from time to time). And through some curse from a dying sorcerer everything I'm doing is:

  1. One of a series/trilogy/etc
  2. Has a subtitle
  3. Is part of a "franchise" (think, Star Trek or Marvel MCU or something like that)

I cannot find anything in the epub 3 specification that details how to impart this metadata into the opf. I understand that even if I do so, it's unlikely that many apps will be able to make use of the metadata, but I was hoping to do so correctly anyway (for future-proofing).

Is there no way to do any of these properly? If it were only one or the other and not all of them, I might just use colons to separate these out as in Title: Subtitle or Franchise: Title or X Trilogy (1): Title. But with it as it is, if you do that then it's difficult to tell which is which.

1
  • 2
    While it's Calibre specific, there is a calibre:series and calibre:series_index entries it can embed in the metadata.
    – StarGeek
    Jul 9 at 1:40
1

Calibre allows you to edit metadata, though I don't know if it's just that stored in Calibre's database, as opposed to that in the .epub file itself.

However, there are word processors, e.g., free LibreOffice's Writer, that can create .epub documents and edit the metadata using an extension, such as Writer2ePub. Writer itself, without that extension, can export to .epub and can edit metadata, but apparently omits images.

2
  • 2
    I believe that Calibre stores the metadata in the metadata.opf file that is in the same directory as the epub. But there is a ModifyEPub plugin that will embed the metadata into the file.
    – StarGeek
    Jul 9 at 1:35
  • @StarGeek Calibre's editor allows you to butcher the metadata.opf if you like (though do it wrong, and it's no longer a valid epub). I'm familiar with Dublin Core and other standards, but not familiar enough to answer my own question.
    – John O
    Jul 9 at 4:49
1

The correct way to include these according to the EPUB 3.2 standard is as follows. For each of the "titles", you'd include a title element along with a meta element to specify which sort of title it is. Each title element needs its own (arbitrary) unique id, and each meta element will reference that.

<dc:title id="t1">A Dribble of Event Horizon</dc:title>
<meta refines="#t1" property="title-type">main</meta>

<dc:title id="t2">When Good Wormholes Go Bad</dc:title>
<meta refines="#t2" property="title-type">subtitle</meta>

The trouble is, of course, that there are only a few recognized title-types. Those are "main, subtitle, short, collection, edition and expanded".

https://www.w3.org/publishing/epub3/epub-packages.html#sec-title-type

But, one might also use "series" and "franchise" and have it be close to the formal spec.

<dc:title id="t3">The Defective Gates Trilogy</dc:title>
<meta refines="#t3" property="title-type">series</meta>

<dc:title id="t4">Stargate SG-1</dc:title>
<meta refines="#t4" property="title-type">franchise</meta>

It is also possible to use the schema attribute to specify a new list of title-types, though I still haven't managed to make sense of that yet.

Additionally, there should probably be a "display-seq" meta element for each title. This tells the app which order to display those titles in. Again, each will reference the title's id directly.

<dc:title id="t1">A Dribble of Event Horizon</dc:title>
<meta refines="#t1" property="title-type">main</meta>
<meta refines="#t1" property="display-seq">3</meta>

<dc:title id="t2">When Good Wormholes Go Bad</dc:title>
<meta refines="#t2" property="title-type">subtitle</meta>
<meta refines="#t2" property="display-seq">4</meta>

<dc:title id="t3">The Defective Gates Trilogy</dc:title>
<meta refines="#t3" property="title-type">series</meta>
<meta refines="#t3" property="display-seq">2</meta>

<dc:title id="t4">Stargate SG-1</dc:title>
<meta refines="#t4" property="title-type">franchise</meta>
<meta refines="#t4" property="display-seq">1</meta>

This would make the app think that the full title might be something like Stargate SG-1: The Defective Gates Trilogy, A Dribble of Event Horizon: When Good Wormmholes Go Bad. I don't believe any apps make use of this though, so it's mostly theoretical.

However, it should be noted that even this doesn't actually specify which book in the trilogy it would be, or group it together with other books that it might belong with.

To do that, the metadata.opf file will also have to define a collection, and mark the book as a member of it. This is also done with another meta element. As before, the id for these can be arbitrary.

<meta property="belongs-to-collection" id="c01">The Defective Gates Trilogy</meta>
<meta refines="#c01" property="collection-type">series</meta>

The only proper values for collection-type are "series" and "set". Series is pretty much what you'd think it is, and "set" is for those books which would be sold all at once. Think encyclopedias, or "boxed sets". I really don't see the point of the latter, since at least with ebooks, publishers seem likely to just sell them as omnibus editions where everything is in a single file. Note that these values might also be extended with a custom "scheme", hypothetically. If you can figure that out.

Also, such a book as the question asked might reasonably belong to two collections, the second being a "franchise"... but series seems incorrect for that, since such a book rarely belongs in a specific order or sequence within the greater collection of the franchise books. Agatha Christie's stuff comes to mind, where there were many Miss Marple or Poirot books, but they weren't intended to be read in any particular order.

To specify which book of the trilogy, you add a group-position.

<meta property="belongs-to-collection" id="c01">The Defective Gates Trilogy</meta>
<meta refines="#c01" property="collection-type">series</meta>
<meta refines="#c01" property="group-position">2</meta>

Note: This is a fictitious book. I have and never will write Stargate SG-1 fan fiction, and if I did they would have better titles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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