Contents | Start | End | Previous: Chapter 26: Using Jutoh’s Proofing Tools | Next: Chapter 28: Troubleshooting Your Book


CHAPTER 27: ADVANCED TOPICS


 

This chapter describes a variety of advanced topics that the newcomer to Jutoh can most likely ignore.

Embedding media

Jutoh lets you embed audio and video into Epub and Kindle books. This is only supported in some readers (for example, Apple Books), and Amazon may not accept Kindle files containing multimedia (and media in locally-transferred Kindle files may be blocked).

For video in Apple Books, Apple recommends that you use H.264 compression at VGA resolution. The poster image should be 150x300 pixels. Audio should be stereo, AAC/MP4, 256kps, encoded using iTunes.

Amazon’s guidelines for formatting Kindle books, with information about audio and video formats, is available at:

kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf

To embed a media object, follow these three steps.

  1. Add a media document. Use the Documents toolbar button or Document | Add Media Document menu command. Select a media file when prompted. A copy of this file will be added to the project (it may take a long time if the file is large) and you can change the file name to be used and other parameters.

  2. Insert a media object into your content. Use the Insert | Media Object command on the Format menu or the context menu, and when prompted, choose the file name from the list of media objects currently in this project. Enter other parameters if you wish, such as a title, and fallback text to show if the reader does not support the audio or video tags.

  3. Ensure media objects are switched on in your configuration. Under the Images and Media group in your configuration, check that Generate media objects is enabled. If you switch this off, no media files will be included in the book and the media tags will not be included in the XHTML.

You can also use media documents and objects to insert images. The image won’t show up in the editor when you insert a media object that references the media document, but there is an advantage – you could add several media documents with the same name, at different resolutions, and use configurations to selectively include and omit media documents from the generated ebook. You do this by specifying tags in your media document, (for example, ‘hires’, ‘lores’) and then specifying tags in the configuration options Include media documents matching tags and Exclude media documents matching tags. This technique is also useful for very large images that take a long time to load into the editor when inserted directly.

Understanding encodings

When importing text files, Jutoh needs to know what the encoding of your files is, since otherwise the files are just streams of bits that could represent anything. A ‘standard’ ASCII file only represent the basic symbols, whereas files encoded in Unicode can represent most symbols in use on the planet. Jutoh’s favoured Unicode encoding is UTF-8, in which plain text is encoded with one character per symbol (and so is readable in any text editor) and more complex symbols are represented by two or more characters.

When you save text from a word processor, you need to make sure it’s going to write using the encoding that you’ve specified in the New Project Wizard or Project Properties. For example, when saving a document as plain text from Microsoft Word, Word will show you a further dialog. Click on Other encoding and select ‘Unicode (UTF-8)’. Don’t check Insert line breaks, since you want each paragraph to be one line.

If you forget to save in the right encoding, you may be able to fix it, as follows. When you get an Jutoh error indicating an encoding problem (or the file doesn’t show properly in the finished book or the editor), open the file in an encoding-savvy application such as Programmer’s Notepad. It should auto-detect the encoding, which you can check by typing Alt+Enter to see the document’s properties. Now select the whole document and copy it to the clipboard. Create a new file, change the encoding to UTF-8 in the document’s properties, and paste the text into it. Save this over the original file – it’s now in the correct encoding.

If you can’t change the encoding of the original file, you can specify it in the Import Options section of the New Project Wizard, or the Options page of Project Properties if you’re importing a file after initial project creation. Also, if you are importing HTML or Epub and the encoding is missing from one or more HTML files, Jutoh will use this setting – it will also warn you about the missing encoding so you can go back and specify it. For example, if the file was created on Windows without specifying UTF-8, you could try the value ‘Windows Western European’.

You can specify an encoding for HTML, Epub and text files that you compile with Jutoh. This is controlled by the configuration option Content encoding. Normally, it’s best to leave it as the UTF-8, the default setting.

Guide types

Each document in a book can have a ‘guide type’ which is written to the guide section of the Epub or Kindle file, and indicates the role of the document. You can set the guide type by right-clicking on the document in the outline, selecting Properties to show the Document Properties dialog, and then changing the Guide type selection.

These are the possible guide types:

When Jutoh generates a section without it being present in the project outline (for example, the cover page and simple table of contents page), it will set the appropriate guide type.

If you use the keyword %STARTPAGE% for the guide type, it will be replaced by the appropriate type for Kindle or Epub, as specified by the current value of the configuration option Start page guide type. However, this has become unnecessary since all ereaders now recognise (or quietly ignore) the ‘text’ guide type.

Please note that Amazon may choose to ignore the start page and set the start location itself. See KB0138: Why does the start page not work on Kindle? in the Jutoh Knowledge Base.

How to add an ISBN to your books

Some platforms require you to supply an ISBN for your ebooks. For example, to get your books into the premium Smashwords catalogue, you need an ISBN for each ebook. This needs to be separate for each book edition – paperbacks, hardbacks and distinct ebook editions for different platforms all need separate ISBNs. You can buy a set of ISBNs from the relevant agency (in the UK, it’s Nielsen), or you can see if your ebook publisher such as Smashwords can supply ISBNs.

Having got your ISBN, where do you put it? Go to the metadata in Project Properties (just click on the Edit button on the toolbar) and click on the ‘...’ button next to the Identifier field. Click Add to add a new value to this element, and choose Add ISBN. Enter the ISBN (just the number, including dashes) into the Value field. Now delete the original value, ‘Element 1’.

OK, so you have different ISBNs for different ebook editions – but you want to publish your ebook to different platforms, with different ISBNs, without having to edit separate Jutoh files for each edition. The way to accomplish this is via string tables. String tables allow you to set up substitution tables; since we can specify a different table for each configuration (Kindle, Epub and so on), we can put a variable called, say, %ISBN% into the ISBN value field, and substitute a different ISBN value from the different tables, depending on the current configuration.

Let’s assume that you are using two configurations, Kindle and Epub. The Kindle book is going to the Kindle store, and the Epub book is going to the iTunes store.

  1. Click Edit on the toolbar, then the Strings tab. Click the ‘+’ button to add a new string table, and call it Kindle.

  2. Click Add and enter ‘ISBN’ to add a new string whose name is ISBN.

  3. Click on the value field (second column) and enter the ISBN for the Kindle store.

  4. Repeat the above, adding a new string table called Apple Books and adding the second ISBN value.

  5. Click OK to dismiss the Project Properties.

  6. Click Edit on the toolbar again, then the Configurations tab.

  7. Click on the Kindle configuration, and scroll down to the String Tables group.

  8. Select ‘Kindle’ in the Project string table property.

  9. Click on the Epub configuration, and scroll down to the String Tables group.

  10. Select Apple Books in the Project string table property.

  11. Click on the Metadata tab and enter %ISBN% into the Identifier field.

  12. Press OK.

Now when you select a configuration, a different string table will be used and the %ISBN% variable will be filled in with the value of ‘ISBN’ in the appropriate string table.

If you have different editions of your book with the same format (for example, a Kindle file you put on your web site, and one that you upload to Kindle), you can just add another configuration (taking care to set the format property correctly) and a string table to go with it. So you can have as many configurations as you have sites that you upload to.

You can use the string table to change other things in your metadata and (if you check the Replace strings in content configuration property) your book pages.

For more information on string tables, see Chapter 14: Working With String Tables.

Jutoh and Epub 3

There is support for some Epub 3 features – you can switch Epub 3 support on by setting the Epub version configuration property to 3. The adaptations to Epub 3 are currently as follows:

Jutoh is distributed with EpubCheck 3, which means it can check both Epub 2 and Epub 3 files if you have Java installed.

Summary

This chapter has described a variety of features that advanced books might need. For other miscellaneous topics, you may also find it useful to search Jutoh’s help by typing into the Search Help field in the Jutoh toolbar.

Next, we look at various strategies to cope with errors that might occur in your book.


Contents | Start | End | Previous: Chapter 26: Using Jutoh’s Proofing Tools | Next: Chapter 28: Troubleshooting Your Book