Kindle Once Again - this time for Walk, Hike, Saunter

 Last time I did this was Dec 2017. At the moment, memory of how to do it is pretty foggy, but luckily I have my earlier blog posts on this to refresh my memory so printing them out to review. (look for Kindle label in this blog to find). 


This book is a little easier than the others - text and inline photos, a table of contents, but no index. Susan has promised it will be out in two and a half weeks, so will try to do that. My immediate issue is that I remember that I have to make some changes to the Indesign file before putting out the epub file that I will update for Kindle, but don't remember quite what they were. Pausing to read my prior posts, and to review Kindle code for Healing Miles.

From my 2012 notes I saw that to get reliable chapter breaks, each chapter had to be a separate xhtml file. The default of Indesign is to put out one big xhtml file, but it will break on a style, so I need to be sure the current Indesign document (for Walk, Hike, Saunter) has an appropriate paragraph style at, and only at, each break point. Reviewed last Kindle indd file. Paragraph Styles have a box for Export Tags where you mark a particular style as causing an epub split.

When looking at the old indd for Kindle (or when setting up the new one) look at the Paragraph Styles flyout. There is an option for Edit Export Tags. I did that on the old file, and saw that I had tagged all forced paragraph breaks, as well as the standard chapter heading, and a few odd sections.

I did a test export to epub, and got a font error: 

There is no such font as Baskerville Semibold, but I was able to use the brute force approach of making a test copy of my file, deleting half to find which half had the error, applied the same technique to the half that caused the error, and narrowed it down to one word having a bad character style.


11/9/20 back to it after a few distracted days due to election. I'm still using Indesign CS6. The book images were b&w, but Kindle can be color, and looks much better. They want 3200 pixels wide and 300 dpi. I have a set of book interior images in color and sized for Kindle. I went thru the Indesign file I copied for Kindle, and relinked all the images using the Kindle color images, hoping that Indesign epub build would setup the links properly. The epub build downsized the images no matter what I did, so I will copy a set of the correctly sized images into the OEBPS>image folder where they should be, and manually change the links to them in the generated html.

Once I put the corrected images in the epub image folder, I downloaded a current Kindle Previewer from the kdp.amazon.com site, opened it, and dragged my epub to the previewer. Got E21011: The book title was not set. Please set the title before generating the mobi.. Now checking that out.

In the content.opf file put out by indesign, the title had not been filled in, so I added it:

Looking within that opf file is a line where the title should be, and I changed it to <dc:title>Walk, Hike, Saunter: Seasoned Women Share Tales and Trails</dc:title>

I then updated the epub, reran the Kindle Previewer and got to where it displayed the book without errors. Formatting still needed to look better, but no errors that stopped the process. 

Just to summarize the epub update process once for this post. Indesign writes an epub file. That file is identical to a zip file, and making changes requires that you rename it from .epub to .zip and then double click the resulting zip file to see the inner files. You extract and modify as required, update the zip file and rename it to epub. Look at results on Kindle previewer and repeat process till satisfied.

What I saw on this first test was that my color images on the simulated tablet were only about half the screen width of the text, and should fill the screen width. My next step is to look at the html generated for one of these problem images.

Looked at CSS file generated by ID6 and saw there was a class with image size generated for each image: example: img.frame-9 {
height:326px;
width:279px;
Don't think that is needed at all. Will check html and css for prior book Healing Miles.
Ok, that css has the frame classes, but each is as follows:
img.frame-7 {
width:98%;
I did more tests with image options on exporting epub, and this one assigned all images the same frame with width:100%; I changed the css to 98%.
I've been using the search files function of Notepad++ to quickly find the <div> statements where I need put in a page number anchor for table of content purposes. i.e. <div id="p240"> I use that same function to review and correct my hyperlinks.

11/17 update
Spent a day updating and testing all hyperlinks, as well as converting table of contents from page numbers to hyperlinks and testing. I've also been using epubcheck to check the epub before submitting to Kindle Previewer. A few errors and a huge number of warnings. A lot of my images have spaces in them i.e. your name here.jpeg and spaces in filenames generate warnings.

Once I got to where the Kindle Previewer generated good looking output, I clicked The Book Information choice in View:

I had some problems with Table of Contents and Start Reading showing up as unspecified. This was a matter of getting the anchor names right, and specifying in the Contents.opf correctly.

These lines had to be in the contents.opf:
   In the manifest:
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />
   And in the guide:
</spine>
<guide>
<reference type="toc" title="Contents" href="WalkHike1Kindle1-4.xhtml"/>
<reference type="text" title="Praise for Susan Alcorn’s Walk, Hike, Saunter" href="WalkHike1Kindle1.xhtml"/>
</guide>

The manifest item points to ncx, the first guide item points to the actual table of contents page in the book, and the type="text" ...Praise for link is the start reading identifier.

Once I got the Book Information all specified, I was able to go to File on the Kindle Previewer 3 and click the export choice, and write out a mobi file. I then plugged my old Kindle into my computer and with windows explorer, opened the Kindle and it's documents file, and dragged the mobi file to it.

Then I could display the book on my Kindle, which is where I am now. In general things look good, but bulleted lists look bad, bullets almost overlayed by text. Also paragraph indents are much too small. In my research, I finally found https://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf
which I wish I had looked at much earlier. There are a number of new rules re fonts, allowable css, accessibility, etc. Will start on those today. 

I'm testing a bullet list fix. The list is a normal <ul> list with the list items for example like
<li class="WHBodyleftBullets"><span class="char-style-override-21">•&#9;</span>Thru-hiked Tahoe where the &#9 is a tab character after the bullet. That appeared ok on the Previewer. I have replaced the tab with a non breaking space &#160; and also made a change to the override-21. It is now
span.char-style-override-21 {
display:inline-block;
text-indent:0;
white-space:pre-wrap;
width:15px; this width was 9 and making it larger moved the text away from the bullet. Now will do previewer again, and if it looks ok, generate the mobi file for my Kindle and try there.
Well, the &#160; didn't work on the Kindle. The bullet got a separate line. However, I just did that change on one chapter. The css change on the character style override applied to the entire book, and bulleted lists in other chapters looked slightly better because of the width increase from 9 to 15.

11/18 Resolved the bullet problem by looking in a prior book with bullets - Patagonia Chronicle
and reviewed its xhtml code for bullets. I ended up copying the appropriate css classes including media queries, and copying the code for bulleted lists. On observation - on the working code, the list items in an unordered list were not enclosed in li markers, but just normal paragraph markers. Instead of
<ul)
<li>blahblahblah</li> it was <p>blahblahblah</p>
</ul>
I don't know if that actually mattered, but I made that change.

The working code for the bulleted phrase is:
<p class="bullet2a"><span class="hide">&#xa0;&#xa0;&#xa0;&#xa0;</span>•&#xa0;&#xa0;Thru-hiked Tahoe Rim Trail (CA, NV)—165 miles.</p> 

These is the working css, including the media queries (at the end of all the css):

@media amzn-mobi {
p.bullet2a {
text-align: left;
font-weight:normal;
text-indent: -2em;
}
}

@media not amzn-mobi {
p {
margin-top: 0;
margin-bottom: 0;
}
.hide {display: none;}
p.bullet2a {
text-align: left;
font-weight:normal;
text-indent: -1em;
margin-left: 2em;
}
}

Replacing the <li> items with <p> items causes a lot of epubcheck errors, though it goes thru Kindle Previewer with no errors. I am trying to enclose the entire list of former li items inside of one li and it appears to work:
<ul><li>
<p>sdfgsdfgsdfg</p>
<p>sdfgsdfgsdfg</p>
<p>sdfgsdfgsdfg</p>
</li></ul>
11/20 bulleted lists all look ok on previewer, ok when opened in chrome, and ok when loaded to Kindle, so exporting as a kpf file from Kindle Previewer, which I think is what goes into the publish on Kindle step.

Went to kdp.amazon.com to our dashboard and uploaded the kpf file and the cover image (rgb). Uploads went ok, now waiting on "processing your file".
Check of loaded file turned up two possible spelling errors. One Nuun tablets - ok, and one legitimate error, so fixing and reloading. 

Published 11/20 may take up to 72 hours to be available.














Comments

Popular posts from this blog

Patagonia - Torres del Paine - Trip Planning Stream of Consciousness

Hot weather hiking affliction: Golfer's Vasculitis