Issues with pi symbol when compiling

I have a book that contains a joke with the symbol small pi. When compiled and exported to pdf for the paperback version, everything worked. An ebook reader just informed me that the symbol did not come through in the ebook. It looked fine in the Kindle previewer, but not in purchased copies; it did not work in my epub files at all (now that I knew to go back and check). Any suggestions? (Apologies if this was covered elsewhere; I’m traveling with no internet and doing a rush job in a restaurant now, but I didn’t see anything.) Thank you!

Judy Walker

Unicode characters can cause a bit of grief in e-books, not for any reasons with the technology itself in a pure sense—there are acceptable ways to include Unicode in the format; we are using the method of just printing the character itself directly into the HTML file, and declaring that the file is encoded using UTF–8. On any machine that can read UTF–8 text files, that will work fine. The problem is once you get past the point of pure specifications and into the dirty world of device implementation, especially once you start going back in time a few years to some of the earliest reader programs and platforms.

A second method which may prove more portable is to declare the symbol as a symbol request rather than print the symbol verbatim. In HTML, the code for that is π but to get that through Scrivener’s compile engine, you have to somehow tell it that you’re typing in raw HTML, otherwise it will attempt to preserve what you typed by turning that into π, so that it prints just like you see it in this message, rather than as π (& is how you print an ampersand in HTML, since it is otherwise a special character used for printing other special characters). To do that, you would need to (a) not be using Preserve Formatting for its intended purpose anywhere in the book and (b) change a setting in the HTML Options compile pane to Treat “Preserve Formatting” blocks as raw HTML. Then of course you would type in the aforementioned code for π in your editor, select it and apply Format/Formatting/Preserve Formatting.

There is of course the final problem with all of this: the target device needs that actual character in its font set to display it. If it doesn’t have a π symbol in its display font, then there is nothing you can do about it short of taking a screenshot of it and placing the image inline. If it is in the flow of text, I don’t recommend it however, as the reader will nearly always be able to change the display size of the font to suit their eyesight, and a picture of a character will more often than not stay the same size, or get really blurry.

Thanks so much, AmberV! Raw html with preserve formatting seems to have done the trick, and I’ll be uploading new files as soon as I can get wifi. I’ll think next time I’ll just skip the geek tshirts. :stuck_out_tongue:

Oh no! :cry: