How do I make 'Custom Blocks' appear in .mobi version of a bookdown book?

55 views Asked by At

I'm using bookdown to author a technical book. I've followed the format layed out in the bookdown book very closely and it looks good in epub, html, and pdf versions. I made heavy use of custom blocks to highlight specific kinds of information but when I convert to a .mobi the custom blocks no longer render properly. The icons don't show at all. I've tried converting with kindlegen and with calibre and it is the same.

I downloaded the .mobi version of the Yihui Xie's excellent bookdown book directly from the site and uploaded it to my tablet kindle reader. It shows the same problem. Is this even possible?

1

There are 1 answers

0
JohnAD On BEST ANSWER

The default MOBI format does not support background-image in div tags, so the icons get stripped out.

If you have access to the open-source Calibre program, try this: download the epub version from bookdown. The convert to mobi, but in the "MOBI" settings tag, change the format from [old] to [new] which is Amazon's mod'd kindle mobi format.

That version of the mobi file should have the icons included and visible.

However, IMO, it is best to upload the book to Amazon as an epub. (Subtle thing I encountered: remove the cover and cover image from the book.)